Skip to contentSkip to conversation

LVM snapshot - "dd" file size

linux-lvm Thomas Bellembois 3 participants 4 messages Apr 16, 2008 – Apr 17, 2008

lore
Share & tools
lore
#0 lore raw

Hi!

I am using LVM partitions on a Debian Xen system. I use LVM snapshots to clone and backup my virtual machines.

I have noticed that the ISO file created with the "dd" command it much bigger that the partition used space (actually 4.7GB for the ISO - 500MB used space). No problem if I mount the LVM snapshot and "tar" all of the data.

I have googled the question and read that "dd" also copy "not used space". Why is the ISO file so big ? Is the "tar" method less safe ? Is there a better solution ?

Thanks for your answers.

Regards,

Thomas

#1 lore raw

this has nothing to do with LVM.

dd knows nothing about files, it just copies the entire device (or file or whatever).

tar will work, if you use the right command line switches. Search around on the web for pointers on how to use it.

Another intermediate way would be to compress the image you get with dd.

Quoted 27 lines · Thomas Bellembois

Hi!

I am using LVM partitions on a Debian Xen system. I use LVM snapshots to clone and backup my virtual machines.

I have noticed that the ISO file created with the "dd" command it much bigger that the partition used space (actually 4.7GB for the ISO - 500MB used space). No problem if I mount the LVM snapshot and "tar" all of the data.

I have googled the question and read that "dd" also copy "not used space". Why is the ISO file so big ? Is the "tar" method less safe ? Is there a better solution ?

Thanks for your answers.

Regards,

Thomas

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#2 lore raw

A compressed dd can still be quite large, as there still might contain non zero values..

if you compress the image, a possible way to make the resulting files smaller is to:

- do a: 'dd if=/dev/zero of=/dummyfile' on the filesystem first (you might want to use 'bs' and 'count' parameters)
- if you topped off the disk, delete the all zero dummyfile.

The zipped result might be smaller. (both with dd and with tar..)

Regards,
Denie

----- Original Message ----- From: <[email protected]>
To: "LVM general discussion and development" <[email protected]>
Sent: Wednesday, April 16, 2008 11:04 PM
Subject: Re: [linux-lvm] LVM snapshot - "dd" file size

Quoted 43 lines

this has nothing to do with LVM.

dd knows nothing about files, it just copies the entire device (or file or whatever).

tar will work, if you use the right command line switches. Search around on the web for pointers on how to use it.

Another intermediate way would be to compress the image you get with dd.

Quoted 22 lines · Thomas Bellembois

Hi!

I am using LVM partitions on a Debian Xen system. I use LVM snapshots to clone and backup my virtual machines.

I have noticed that the ISO file created with the "dd" command it much bigger that the partition used space (actually 4.7GB for the ISO - 500MB used space). No problem if I mount the LVM snapshot and "tar" all of the data.

I have googled the question and read that "dd" also copy "not used space". Why is the ISO file so big ? Is the "tar" method less safe ? Is there a better solution ?

Thanks for your answers.

Regards,

Thomas

Quoted 5 lines

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#3 lore raw

Nice tip ! It works fine !
Thanks a lot.

Ragards,

Thomas

Quoted 75 lines · Denie Andriessen

A compressed dd can still be quite large, as there still might contain non zero values..

if you compress the image, a possible way to make the resulting files smaller is to:

- do a: 'dd if=/dev/zero of=/dummyfile' on the filesystem first (you might want to use 'bs' and 'count' parameters)
- if you topped off the disk, delete the all zero dummyfile.

The zipped result might be smaller. (both with dd and with tar..)

Regards,
Denie

----- Original Message ----- From: <[email protected]>
To: "LVM general discussion and development" <[email protected]>
Sent: Wednesday, April 16, 2008 11:04 PM
Subject: Re: [linux-lvm] LVM snapshot - "dd" file size

Quoted 42 lines

this has nothing to do with LVM.

dd knows nothing about files, it just copies the entire device (or file or whatever).

tar will work, if you use the right command line switches. Search around on the web for pointers on how to use it.

Another intermediate way would be to compress the image you get with dd.

Quoted 25 lines · Thomas Bellembois

Hi!

I am using LVM partitions on a Debian Xen system. I use LVM snapshots to clone and backup my virtual machines.

I have noticed that the ISO file created with the "dd" command it much bigger that the partition used space (actually 4.7GB for the ISO - 500MB
used space). No problem if I mount the LVM snapshot and "tar" all of the
data.

I have googled the question and read that "dd" also copy "not used space".
Why is the ISO file so big ? Is the "tar" method less safe ? Is there a better solution ?

Thanks for your answers.

Regards,

Thomas

Quoted 5 lines

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

Quoted 6 lines

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/