bug-ddrescue
[Top][All Lists]
Advanced

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

[Bug-ddrescue] Suggestions: O_DIRECT raw file support, sparse file creat


From: Mark Knibbs
Subject: [Bug-ddrescue] Suggestions: O_DIRECT raw file support, sparse file creation
Date: Tue, 06 Mar 2007 17:15:13 +0000


Hi, I have two suggestions for ddrescue:
1. Add an option to use O_DIRECT for raw file access. Using dd with
 "iflag=direct" does that. It would be nice if ddrescue could too.
 Apparently the old raw file support has been removed in recent Linux
 kernels, and adding a simple command-line argument would be easier
anyway.
 With dd at least, in some cases iflag=direct gives better performance.
 For example, on my (quite old and slow) machine, using commands like
   dd if=/dev/sda of=/dev/null bs=x count=y
 to read the first 1GB of data gives peak performance of 17.5MB/s with
 bs=4096, count=262144. Specifying "iflag=direct" gives peak performance
of 19.8MB/s with bs=1048576, count=1024.
2. Add an option to create sparse output files. (dd_rescue can do that.)
 This would be very useful when e.g. creating image files of mostly-empty
disks (where most sectors contain all zero bytes).

Finally a question about the I/O done by ddrescue. Is it (or can it be) asynchronous? When reading and writing from different drives, there could be a pretty large performance boost by using asynchronous I/O. ddrescue could be asynchronously reading the next input chunk while writing the previous chunk to the output. While that may happen "automatically" for normal cached file I/O, when using O_DIRECT for both input and output of e.g. /dev/sda and /dev/sdb it could improve performance (or at least reduce the performance hit on other applications) a lot I think.




reply via email to

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