You can either download a livecd with FSArchiver on it (eg: any recent SystemRescue), or you can install it on your existing Linux system. If you want to install it, you have three solutions:
If you want to compile it from sources, you will need to have the following libraries installed on your system, including their header files. On RPM based distributions, you often have to install packages such as libXXX-devel to have the header files, since the base package (libXXX) does not provide these files. Here are the required libraries:
You can selectively disable support for missing libraries or header files. For example, on a system that lacks lzo and zstd:
./configure --prefix=/usr --disable-lzo --disable-zstd && make && make install
You can also use the static binary that provides support for all compression levels and does not require the libraries to be installed on your system.
To compile the sources, you have to run follow these instructions:
First, you have to download fsarchiver-0.8.8.tar.gz. Just save it to a temporary directory.
mkdir -p /var/tmp/fsarchiver
cd /var/tmp/fsarchiver
tar xfz /path/to/fsarchiver-x.y.z.tar.gz
cd /var/tmp/fsarchiver/fsarchiver-x.y.z
./configure --prefix=/usr
make && make install
If the compilation does not work, you can just download the static binary, extract it, and copy the binary somewhere on your system (/usr/local/sbin for instance).
Uninstalling fsarchiver is easy since it only installs one file on your system, which is the compiled binary. To uninstall fsarchiver, just remove /usr/sbin/fsarchiver.
FSArchiver has two kind of dependencies: libraries and file-system tools.
Several libraries with their header files are necessary to compile the sources (cf previous section about installation) and to execute the program if it has not been compiled in a static way. You can avoid the problem with libraries dependencies by using a static binary that you can download from the github release page.
The file-system tools for the file-system you are using are required to restore a file-system. You should not have any problem with the file-system tools (such as a program which is missing because it is not installed) when you save the file-system (using fsarchiver savefs). You only need the file-system tools (such as e2fsprogs, reiserfsprogs, xfsprogs, …) when you want to restore a file-system. And it should not really be a problem since you often want to restore a file-system by booting from a livecd such as SystemRescue, since you cannot restore your root file-system when you are using it, so booting from a livecd / usb-stick is mandatory in that case.
FSArchiver only requires the tools that match the file-system of the restoration. For instance, if you are trying to restore an archive to a reiserfs partition, you will need the reiserfsprogs to be available, even if the original filesystem was ext3 when you saved the file-system to an archive.
Using your distribution package manager ensures all necessary dependencies will be automatically installed.
Package information.
dnf install fsarchiver
Package information.
sudo apt-get update
sudo apt-get install fsarchiver
Package information.
sudo apt-get update
sudo apt-get install fsarchiver
Package information.
zypper in fsarchiver
Package information.
pacman -S fsarchiver
You should use these RPM packages that have been built for RHEL based distributions, that is the recommended way for most users:
NOTE: Installing fsarchiver’s rpm requires EPEL enabled.
Use the following commands to install:
yum install epel-release
yum install https://github.com/fdupoux/fsarchiver/releases/download/0.8.6/fsarchiver-0.8.6-1.el9.x86_64.rpm
If you want to compile fsarchiver yourself, use the following instructions:
yum install zlib-devel bzip2-devel lzo-devel lz4-devel xz-devel libzstd-devel e2fsprogs-devel libgcrypt-devel libattr-devel libblkid-devel
tar xfz fsarchiver-0.8.7.tar.gz
cd fsarchiver-0.8.7
./configure --prefix=/usr && make && make install
Gentoo implements support for packages using ebuild files. There is an official ebuild for fsarchiver, so you can directly install it using the emerge command as long as your portage tree is recent. You may also have to change the keywords to make the installation possible:
Run the installation command:
emerge app-backup/fsarchiver
There is an official fsarchiver package for Guix.