FSArchiver Tutorial

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
User avatar
Level 20
Level 20
Posts: 11211
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

FSArchiver Tutorial

Postby austin.texas » Mon Nov 07, 2016 5:15 pm

TUTORIAL En Español (Spanish)

FSArchiver is a program that allows you to save the contents of a file-system to a compressed archive file.
  • You can use it to take a "snapshot" of your root partition, and then restore the snapshot to the same partition, if things go wrong.
  • You can clone your root partition to a different computer easily.
  • You can clone your root partition to a different hard drive on the same computer - but only if you delete the original before booting, or else change the UUID of one of the root partitions. The UUID of the cloned partition will be the same as the original.
  • FSArchiver copies files, not blocks, so you can restore the filesystem to a partition which is smaller than the original.
  • FSArchiver also creates the file-system when it extracts the data to partitions, so you can backup from a btrfs, ntfs, or ext3 partition, and restore to an ext4 partition. Or you can back up an ext4 root partition and restore it to an ntfs partition (which will then be ext4).
  • One of the advantages to using FSArchiver is that everything is checksummed in the archive in order to protect the data.
  • FSArchiver can create a compressed archive file of a directory, as well as a partition.
  • The archive file can be password protected.

It is best not to try to run FSArchiver to back up a mounted partition.
You can boot your live Mint DVD or USB, and install fsarchiver.
Alternatively, you can download and burn a Gparted Live CD. FSArchiver and Partimage are both on the Gparted Live CD.

When using the live Mint, double-click the Computer icon on the Desktop. That will open the File Manager and display all of the available partitions.
Open the partition where you want to save the compressed archive file.
Right-click on the folder where you want to save it > Open In Terminal.
In the terminal, first install fsarchiver:

Code: Select all

sudo apt-get install fsarchiver

I want to back up my / partition (/dev/sda3) for my Mint 18 Cinnamon on my SSD. I do that with this command:

Code: Select all

sudo fsarchiver savefs -vj3z7 LM18Cinn.fsa /dev/sda3

  • j3 tells fsarchiver to use 3 cores of my quad-core CPU. I have done it using 4 cores, as well. The default is 1 core.
  • z7 is Compression Level 7. Compression Levels 7, 8, and 9 are the best to use, with Level 9 being the slowest, but with the highest compression. http://www.fsarchiver.org/Compression
  • If you don't remember the -vj3z7 options, just run sudo fsarchiver savefs LM18Cinn.fsa /dev/sda3 - it will still work fine. The default Compression Level is 3.
  • The name of the archive you save must end in .fsa - "LM18Cinn.fsa" or "rootpartition.fsa" or "whatever.fsa"
My Mint 17.3 Cinnamon (9.7GB used) was compressed to 3.8GB. The compression only took about 3 minutes.

In the File Manager, right-click on the folder containing the archive file (mine is LM18Cinn.fsa).
I want to clone it to /dev/sdb9, so my restore command is:

Code: Select all

sudo fsarchiver -vj3 restfs LM18Cinn.fsa id=0,dest=/dev/sdb9

  • j3 tells fsarchiver to use 3 cores of my quad-core CPU. The default is 1 core.
  • The id=0 is essential. FSArchiver is capable of saving more than one filesystem or root partition in the same .fsa file, and you have to designate which one you want to restore. id=0 is the first one saved. id=1 is the second one saved, etc. Even if you only saved one, you still need to use id=0.
If you are restoring the root partition to the original partition, you are done.
If you are cloning the root partition to a different computer, you have to install Grub to the MBR of that computer.
If you are cloning the root partition to a different partition on the original computer, you have to install Grub and also fix the duplicate UUID's before trying to boot either OS..
Changing the UUID on either of the root partitions will require editing fstab and updating Grub. The first step would be to assign a new UUID number to one of the root partitions with this command (for /dev/sdb9):

Code: Select all

sudo tune2fs -U random /dev/sdb9

Some experienced users (Cosmo) prefer the GUI program - qt5-fsarchiver (formerly qt4-fsarchiver).
Also available as a live DVD - qt5-fsarchiver live DVD download

Forum rules:
Please don't add support questions to tutorials, start your own thread in the appropriate sub-forum instead.
Mint 18.1 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Microsoft-free environment since 1996

Linux Linx 2017

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 3 guests