Re: Understanding how dd works

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

 



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?

Thanks
Dan



On Wed, Jun 25, 2008 at 12:48 PM, Chris G <cl@xxxxxxxx> wrote:
> On Wed, Jun 25, 2008 at 12:27:04PM +0100, Dan Track wrote:
>> Hi
>>
>> I've got a xen vm file called test, if I copy it with dd I get the following
>> dd if=/opt/xen/test of=/opt/test-vm.img bs=4096
>> du -s /opt/xen/test = 1934112
>> du -s /opt/test-vm.img = 26240040
>>
>> My question is why is the test-vm.img larger in size than the original?
>>
> Perhaps because the original file is 'sparse', i.e. it has large
> unused chunks in it, when originally created these will be unallocated
> and use no space, only when written to will the space be allocated.
> However when you dd the file it writes everything (including 'nul'
> data) to the destination file.
>
> --
> Chris Green
>
> --
> fedora-list mailing list
> fedora-list@xxxxxxxxxx
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
>

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux