Backup linux partitions

From wiki.network-crawler.de
Jump to: navigation, search

To backup my linux - in this case Debian ETCH i use partimage.

To install partimage with Debian ETCH you just have to:

apt-get install partimage

Then i do:

partimage -z2 -b -d save /dev/hdc2 /media/usbdisk/debian_etch_backup.img.bz2


-z val, --compress val

Set image file compression level:
val=0: don’t compress: very fast but very big image file
val=1: compress using gzip: fast and small image file (default)
val=2: compress using bzip2: very slow and very small image file

-b

batch mode: the GUI won’t wait for an user action

-d, --nodesc

Don’t ask any description for the image file

To recover simply do:

partimage restore /dev/hda2 /media/usbdisk/debian_etch_backup.img.bz2

It's also possible only to recover the mbr:

partimage restmbr /media/usbdisk/debian_etch_backup.img.bz2