Partimage-ng

From PrgmrWiki

https://code.launchpad.net/partimage-ng/+download


yum install e2fsprogs-devel e2fsprogs
http://superb-west.dl.sourceforge.net/sourceforge/linux-ntfs/ntfsprogs-2.0.0.tar.gz
 (the ntfsprogs rpm in the yum repo won't work, it's an older version)  

please note, also the parted-devel package isn't compiled correctly for this. you need

http://ftp.gnu.org/gnu/parted/parted-1.8.8.tar.bz2

then you must configure with

./configure --without-readline --enable-device-mapper

otherwise it won't cope with lvm.

wget http://www.cmake.org/files/v2.6/cmake-2.6.3.tar.gz
./configure; gmake; gmake install;
 cd partimage-ng
mkdir build
cd build
cmake ..
make; make install


also, I had to add

/usr/local/lib

to /etc/ld.so.conf


finally, you can run it to save a domain

[root@69-12-128-194 build]# ./src/partimage-ng save /dev/mapper/194_domU-falcor test3
Error: /dev/md2: unrecognised disk label
Detected drives and partitions:
Drive: /dev/mapper/194_domU-ami { /dev/mapper/194_domU-amip1 }
Drive: /dev/mapper/194_domU-falcor { /dev/mapper/194_domU-falcorp1 }
Drive: /dev/mapper/194_domU-falcor1 { /dev/mapper/194_domU-falcor1p1 }
Drive: /dev/mapper/194_domU-falcorp1 { /dev/mapper/194_domU-falcorp1p1 }
Drive: /dev/mapper/194_domU-kernel { /dev/mapper/194_domU-kernelp1 }
Drive: /dev/mapper/194_domU-logan { /dev/mapper/194_domU-loganp1 }
Drive: /dev/mapper/194_domU-test { /dev/mapper/194_domU-testp1 }
Drive: /dev/mapper/194_domU-testtwo { /dev/mapper/194_domU-testtwop1 }
Drive: /dev/md0 { /dev/md0p1 }
Drive: /dev/md1 { /dev/md1p1 }
Drive: /dev/md2 { }
Drive: /dev/sda { /dev/sda1 /dev/sda2 /dev/sda3 }
Drive: /dev/mapper/194_domU-ami, label loop
Drive: /dev/mapper/194_domU-falcor, label msdos
Drive: /dev/mapper/194_domU-falcor1, label loop
Drive: /dev/mapper/194_domU-falcorp1, label loop
Drive: /dev/mapper/194_domU-kernel, label loop
Drive: /dev/mapper/194_domU-logan, label loop
Drive: /dev/mapper/194_domU-test, label msdos
Drive: /dev/mapper/194_domU-testtwo, label msdos
Drive: /dev/md0, label loop
Drive: /dev/md1, label loop
Drive: /dev/md2, label unknown
Drive: /dev/sda, label msdos
Partition: /dev/mapper/194_domU-amip1, type 0, filesystem ext3
Partition: /dev/mapper/194_domU-falcor1p1, type 0, filesystem ext3
Partition: /dev/mapper/194_domU-falcorp1, type 0, filesystem ext3
Partition: /dev/mapper/194_domU-falcorp1p1, type 0, filesystem ext3
Partition: /dev/mapper/194_domU-kernelp1, type 0, filesystem ext3
Partition: /dev/mapper/194_domU-loganp1, type 0, filesystem ext3
Partition: /dev/mapper/194_domU-testp1, type 0, filesystem ext3
Partition: /dev/mapper/194_domU-testtwop1, type 0, filesystem ext3
Partition: /dev/md0p1, type 0, filesystem ext2
Partition: /dev/md1p1, type 0, filesystem ext3
Partition: /dev/sda1, type 0, filesystem ext2
Partition: /dev/sda2, type 0, filesystem ext3
Partition: /dev/sda3, type 0
Saving the whole drive /dev/mapper/194_domU-falcor
 == Found 1 partitions on the disk, partition table type: 'msdos' == 
 == Processing partition: type 0, geometry {63, 20000924} == 
Filesystem: ext3
Ext2Partition info:
Block size = 4096
Blocks count = 2500107
Used blocks count = 134857
Bitmap start block = 0
Bitmap end block = 2500106
Bitmap allocated size = 315392
start = 0
end = 2500106
real end = 2523135
Saving block #: Number of blocks saved: 134857

note how I needed to use the /dev/mapper name, not the symlink. it doesn't dereference symlinks


obviously you restore with 'restore'