creating images of encrypted partitions with partimage

partimage is a tool for creating images of whole partitions. It supports all major file systems, like ext2/ext3. It will only backup the used blocks of a partition and thus save space. In order to do so, it needs to detect the type of the file system. Encrypted file systems can not be used directly. You first have to open the device:

cryptsetup luksOpen /dev/sdXX SOMENAME

After that you can use the new device /dev/mapper/SOMENAME. You have to specify this device directly on the command line, because it will not be auto detected by partimage in the ncurses mode. Another important option is -M, which will not backup the MBR. If you forget this parameter the whole thing will fail. In the end the command looks like that:

partimage -z1 -d -M save /dev/mapper/SOMENAME FILENAME.img.gz

Tags: , , , ,

Leave a Reply