2

For backup reasons I need to use dd to copy a whole hard drive (including MBR, partitions,...). The hard drive is 80 GB in size where only 1.8 GB are used.

The command I'm using is the following:

dd if=/dev/sda bs=8M | gzip -9 > /mnt/backupserver/ddCopy.bin.gz

My question here is: Is that already the best way to minimalize how much space is used, or is there any other (better way?)

To take the above example with the 1.8 GB used on a 80 GB drive....the copy takes up way over 2 GB despite the zipping.

Edit as it was asked in a comment here the details about sda:

  • Contains a NTFS partition whose size is 80 GB (as that whole drive only has 1 partition)
  • du says 1.8 GB of sda are in use
  • Contains a windows xp as OS
Thomas
  • 143
  • 2
  • Before copying fill the unused space with zeros 2) Use a better compression algorithm than DEFLATE, e.g. LZMA2
  • – Marco Jan 18 '16 at 11:05
  • Or zpaq - usually better compression, but slower. – Tom Zych Jan 18 '16 at 11:08
  • @marco speed is not really a concern for me (it can take a full day without a problem). The only problematic thing is disk space for me. – Thomas Jan 18 '16 at 11:52
  • Specifying the filesystems and specific OS would probably help. Also when you say "1.8GB are used", I supposed that's spaced used within the filesystem(s), rather than space used by the filesystem(s) (i.e. partitions)? – jcaron Jan 18 '16 at 12:33
  • @jcaron I added the info as edit to the bottom. du run from the linux live cd says 1.8 GB are used – Thomas Jan 18 '16 at 12:40