Saturday, December 19, 2009

Backup and Restore ext4 filesystem using fsarchiver

Important Note: Until the time of writing this article, "partimage" DOESN'T SUPPORT EXT4, it detects ext4 as ext3 and then displays an error message saying "can't read bitmap block 0 from image", so if you use something like the bootable disk "systemrescuecd" for backup and you're using an ext4 filesystem, you'd better use another alternative such as "fsarchiver" as in the following steps:
  1. Create a mountpoint to save the image to, e.g. "/root/backup"
  2. "fsarchiver savefs /root/backup/backup.fsa /dev/sda1" where sda1 is the partition you wish to backup.
fsarchiver uses gzip compression by default and it will display a summary once it finishes, make sure the summary doesn't contain any errors. To restore the image:
  1. "fsarhiver restfs /root/backup/backup.fsa id=0,dest=/dev/sda1" where "/dev/sda1" is the partition you wish to restore and "id=0" is used to indicate that it's the first partition in the list of paritions - if any - inside the "backup.fsa" file.
For more information, visit http://www.fsarchiver.org/QuickStart

No comments: