[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-ddrescue] How about a "don't care" block state?
From: |
Ian Abbott |
Subject: |
Re: [Bug-ddrescue] How about a "don't care" block state? |
Date: |
Thu, 26 May 2011 17:37:15 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110526 Lightning/1.0b3pre Thunderbird/3.1.10 |
On 26/05/11 15:41, Matthew Ruffalo wrote:
> Ian-
>
> I have no useful advice about a 'minimum image size' parameter beyond
> what you've already said, but I feel compelled to point out that the
> --preallocate option does *not* zero-fill the file if you're using a
> filesystem and kernel that support preallocation. This includes ext4,
> ocfs2, xfs, etc., but *not* ext3, and I think any kernel past 2.6.22.
> Your glibc will also need the 'fallocate' system call wrapper, but if
> your kernel and filesystem are new enough then your glibc almost
> certainly is too.
>
> If you're not using an ancient system, preallocation is almost instant.
> For a simple test, try 'fallocate -l 100G file' to see how long it takes
> to preallocate 100GB:
>
> $ time fallocate -l 100G file
>
> real 0m0.547s
> user 0m0.000s
> sys 0m0.080s
>
> MMR...
Ah, well I was doing it on an ext3 system, so I got an ENOTSUP* error!
[*] or possibly EOPNOTSUPP as it has the same value on Linux.
Besides, it turns out preallocation doesn't help in this case anyway, as
it only preallocates up to the end of the last '+' block in the domain.
I think what I want is an option to set the minimum size of the regular
output file (it wouldn't work for special files), and also a method to
specify the minimum size automatically (perhaps by setting the minimum
output size to -1). The automatically determined minimum size would be
something like 'opos + min(isize-ipos, maxsize)', where opos is the
output position, isize is the input file size, ipos is the input
position, and maxsize is derived from the --max-size=<bytes> parameter
if specified, otherwise LLONG_MAX.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <address@hidden> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-