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

Re: Understanding how dd works



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


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