bug-ddrescue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-ddrescue] direct disk access will not read partial sector


From: Felix Ehlermann
Subject: Re: [Bug-ddrescue] direct disk access will not read partial sector
Date: Fri, 30 Nov 2012 13:06:14 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0

Dear Scott,

as far as I have understood how (magnetic) hard disk drives work, it is not possible to read fractions of a sector because of the way the data is stored on the disk.
(Unless using vendor specific commands maybe..)

There is a very nice white paper by Western Digital which explains how data is stored in 512 and 4096 byte sector format drives:
http://www.wdc.com/wdproducts/library/WhitePapers/ENG/2579-771430.pdf
(or http://www.wdc.com/wdproducts/library/?id=216&type=87 for other languages)

As ddrescue's goal is usually to recover as much data from a damaged or failing drive as possible I would not expect it to discard any data it has already read successfully. Discarding data can be done effectively with other tools at a later point of time - as you already explained.

I think that adding the possibility to discard such "unwanted" bytes would needlessly complicate the implementation of ddrescue without any gain for ddrescues main usecase which is recovering as much data as possible and not discarding recovered data.

So as a fellow user of ddrescue I would like to oppose your suggestion of adding this feature since requesting such "unaligned" reads is likely to be undesired by the user as the hard drive would have to read the entire sector anyway.


Kind Regards
Felix

On 30.11.2012 07:14, Scott Dwyer wrote:
I have found a workaround for me by reading the full allocated file and then using truncate to cut the file to proper length, although this reads a few extra sectors. But I would think that ddrescue should try to read a whole sector and only write what is asked of, as opposed to not try at all. I am not sure what you mean by domain fragmentation though.


On 11/28/2012 2:54 PM, Antonio Diaz Diaz wrote:
Hello Scott,

Scott Dwyer wrote:
I do not know if this would be considered a bug, or just the nature of the direct disk access. When using the -d option, ddrescue will not attempt to read data that does not start or end on a sector boundary.

I thinh it is the nature of direct disk access. The kernel does not accept such partial sector reads.

Of course partial reads could be faked by reading the whole sector and writing only the requested part. AFAIK neither linux nor glibc implement this with direct disk access. I am not sure if it would be a good idea for ddrescue to implement it or not. It may mean reading the same sector more than once in extreme cases of domain fragmentation. But I guess such domains are even less normal that what you are doing. :-)


Regards,
Antonio.



_______________________________________________
Bug-ddrescue mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-ddrescue





reply via email to

[Prev in Thread] Current Thread [Next in Thread]