Backing up disk image via SSH

From PrgmrWiki

Jump to: navigation, search

backing up new system to another server ...

my current procedure to grab compressed disk image:

  • boot to Centos rescue image
  • mkdir /tmp/xvda1
  • mount /dev/xvda1 /tmp/xvda1
  • dd if=/dev/zero of=/tmp/xvda1/big_blank_file
  • rm /tmp/xvda1/big_blank_file
  • umount /tmp/xvda1
  • bzip2 < /dev/xvda1 | ssh me@my.other.server.tld "cat > xvda1_backup.bz2"

(The "big_blank_file" finagling for compressability may be not particularly necessary on a fresh image ...) With the zero-pad prep, a fresh Debian Lenny image (about 500 MB installed on a 12 GB disk) compresses down to less than 185 MB. After installing Apache2 and some user data, the disk image compressed from about 750 MB down to about 250 MB - without repeating the zero-pad prep.

Anyway ... this seems sufficient for my needs - just wondering if perhaps any "better" way recommended for grabbing disk image backups.

(see Backup for more on backups in general)