bug-ddrescue
[Top][All Lists]
Advanced

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

[Bug-ddrescue] Preallocating space, if possible


From: Matthew Ruffalo
Subject: [Bug-ddrescue] Preallocating space, if possible
Date: Fri, 11 Jun 2010 16:23:33 -0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4

Hello Antonio-

First, thank you for the wonderful tool. I've used ddrescue many times to recover data from failing hard drives, as well as for manually imaging working drives (the progress/speed display is very nice).

I'm curious whether it's possible for ddrescue to preallocate space for the file that it writes using posix_fallocate. I don't envision this as standard behavior; I remember reading a message that you posted to the mailing list saying that on some platforms, the size information is not available at all. Additionally, I've seen failing hard drives report erroneous sizes (such as an 80GB drive showing as 2.1TB -- it apparently reported 0xFFFFFFFF when queried).

If the size is available (which would be a compile-time option) and correct (which would be a runtime option that defaults to false), would you support using a preallocation system call in order to improve filesystem performance and reduce fragmentation? Modern filesystems such as ext4, xfs, ocfs2, etc. support very efficient preallocation of large files and it seems worth it to take advantage of this capability.

I did a quick grep through the source code and didn't find any instance of 'allocate'. My understanding (which is not all that likely to be correct) is that this behavior is distinct from the --sparse option. A sparse file's size is reported to be much larger than the allocated size on disk, whereas the new behavior would tell the filesystem in advance that e.g. the image file will eventually contain 250GB. The filesystem will then allocate this space as contiguously as possible.


Semi-related question: is there a publicly accessible source code repository for ddrescue? I created a repository on GitHub ( http://github.com/mruffalo/ddrescue ) that I will use to publish my changes in the event that I implement this feature myself. It contains all released versions of ddrescue back to version 0.6 and the authorship timestamps match the modification times of the archives on the GNU mirrors. For example:

Author: Antonio Diaz Diaz <address@hidden>  2005-01-04 05:39:00
Committer: Matthew Ruffalo <address@hidden>  2010-05-30 14:16:34
Tags: v0.9

Thank you,
--
Matt Ruffalo...
Department of Electrical Engineering and Computer Science
Case Western Reserve University



reply via email to

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