Fsarchiver is one useful piece of software

I have just used it to backup a Ubuntu 10.04 partition on one computer and restore it over a Mint partition on another computer.

I downloaded SystemrescueCD 1.5.4 and burnt it to a CD using Brasero. I connected an external hard disk onto which to save the backup and booted the SystemrescueCD to the command prompt. I could have carried on from the command-line but entered ‘wizard’ for the graphical interface.

The first step is to find the names of the partition on the hard disk that you want to backup and the partition on the external drive on which you want to save the partition. Run Parted (either from the menu or from the icon in the button toolbar) and it will give the partition name of the (e.g.) EXT4 partition used by Ubuntu 10.04. In my case the partition I wanted to backup was /dev/sda3. If you share the hard disk, there will also be an ntfs partition for Windows XP (for example) and another swap file partition. Click on the combo box in the top right hand corner of Parted and select the external drive. This will give you the name of the partition on the hard disk to which you want to save the backup. I think it is wise to avoid any Microsoft partitions even if this means you have to create an ext3 partition on the external drive. You can do this with Parted. In my case the external drive partition was /dev/sdb3.

Linux can’t use that raw device directly so we have to incorporate (or mount) the partition on the external drive into the file system. From the terminal window (in yellow) enter:
mkdir /mnt/usbhd
This creates a subdirectory (any name such as usbhd will do) in the existing /mnt directory which we will use to mount the external drive. Then enter:
mount /dev/sdb3 /mnt/usbhd
This provides the link between the partition on the external drive (/dev/sdb3) and the mount point (/mnt/usbhd). You can now test the link with:
cd /mnt/usbhd
ls -l
which should give a directory of the external drive.

If you enter ‘fsarchiver’ from the command line you will be shown a help file from which you can deduce the backup command:
‘fsarchiver savefs /mnt/usbhd/backup/YourBackupName.fsa /dev/sda3’ (without apostrophes)
This will backup the hard disk partition ‘/dev/sda3’ to a backup file with nameYourBackupName.fsa in a subdirectory ‘backup’ on your external drive. Typically your backup name would include the computer and operating system you were backing up. In my system I would use a name like ‘viglen-hitachi80mb-ub1004-100523.fsa (i.e computer, hard-drive, OS, date).

Now you can shutdown, connect the external drive to the second computer, boot with the systemrescue cd, Parted to find the partition names, mount the external drive in the same way. The ls -l should now show the backup file (after you have ‘cd /backup’ to changed to the backup subdirectory). To restore to the new hard drive, enter:
‘fsarchiver restfs /mnt/usbhd/backup/YourBackupName.fsa id=0,dest=/dev/sda3’ (without apostrophes)
The id=0 is used to distinguish the file systems if you backup more than one filesystem (e.g windows and Linux) in one operation. If you only backup the Linux partition then the id will always be 0. /dev/sda3 is obviously the partition you want to restore to.

Why am I so impressed with all this? Well I compare it with the problems I had when my wife’s computer failed. No pressure there then. The power supply was fine, the hard disk was fine. Somewhere there was a problem with the motherboard. I tried putting the hard disk in another box and in true Windows fashion, it would have none of the new hardware configuration. Even though I had a reasonably recent Acronis backup of the partition, I eventually had to install windows on a new hard disk in the new box (‘new’ in this household being used as a euphemism for ‘not currently used’. The eco-warrior in me means that I seldom have access to ‘real’ new!). I then installed all the software she used and then installed the hard-drive from the the failed computer as a second drive and then copied across her data to the new drive. Some palaver.

If she had been using Linux (don’t even ask!) then the system would have worked after the hard-drive had been transplanted to the second computer: Linux does most of its hardware determination at boot. Even had the hard-disk failed, it would have been a simple matter to restore the fsarchiver backup to another hard-disk. Fsarchiver works file by file and can therefore restore to partitions of different size (obviously not smaller than the backup) and even different partition formats (e.g. from ext4 to ext3).

One clever piece of software.

Advertisements

One Response to “Fsarchiver is one useful piece of software”

  1. Howard Hoyt Says:

    Whilst win b/u tools strike me as being more versatile, I agree that IMO, IMO, fsarchiver is the king of linux b/u.
    Possibly bare-metal Clonezilla offers some competition, but performance of fsarchiver plus its many other features keep me coming back to it for a quick backup of one of my partitions. AFAIK, have tried all the linux b/u solutions.
    I tend to build shell scripts for each of my partitions –

    sudo time fsarchiver -voj4z9 savefs myarchive myfiles

    FSA has never let me down, I just wish Linux had windows b/u features of incremental and individual file explore/restore similar to Acronis, Macrium Reflect, or Paragon, but considering FSA is FOSS, who’s complaining ?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: