Understanding how dd works
Mikkel L. Ellertson
mikkel at infinity-ltd.com
Wed Jun 25 16:02:35 UTC 2008
Patrick O'Callaghan wrote:
> On Wed, 2008-06-25 at 13:31 +0100, Dan Track wrote:
>> Thanks for the heads up on this. If the data blocks don't have
>> anything written into them, then what data is written into them when
>> using dd? if I restore the dd image will the blocks then be in the
>> same state i.e unwritten to?
>>
>> Also following on from this if I create a file using dd let's say 2GB,
>> how does the filesystem know that all these blocks belong to the file
>> myfile.img, and where is the information stored to say that a block
>> has data written into it or not?
>
> It's important to understand that this has nothing to do with 'dd', it's
> simply how the Unix filesystem works, and since Linux is "culturally
> derived" from Unix, it does the same thing. You would see the same
> effect just by using 'cp' or even 'cat'.
>
cp knows how to handle sparse files. From the cp man page:
By default, sparse SOURCE files are detected by a crude heuristic
and the corresponding DEST file is made sparse as well. That is the
behavior selected by --sparse=auto. Specify --sparse=always to
create a sparse DEST file whenever the SOURCE file contains a long
enough sequence of zero bytes. Use --sparse=never to inhibit
creation of sparse files.
So I would think that cp would give him a good copy...
Mikkel
--
Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20080625/3fdd4614/attachment-0001.sig>
More information about the fedora-list
mailing list