Table of Contents
Ubuntu - Backups - Backup using fsarchiver
fsarchiver is a filesystem archiver for Linux.
About FSArchiver
FSArchiver is a system tool that allows you to save the contents of a file-system to a compressed archive file.
- The file-system can be restored on a partition which has a different size and it can be restored on a different file-system.
- Unlike tar/dar, FSArchiver also creates the file-system when it extracts the data to partitions.
- Everything is check-summed in the archive in order to protect the data.
- If the archive is corrupt, you just loose the current file, not the whole archive.
- Fsarchiver is released under the GPL-v2 license. You should read the Quick start guide if you are using FSArchiver for the first time.
Detailed description
The purpose of this project is to provide a safe and flexible file-system backup/deployment tool.
- Other open-source file-systems tools such as partimage already exist.
- These tools are working at the filesystem blocks level, so it is not possible to restore the backup to a smaller partition, and restoring to a bigger partition forces you to resize the filesystem by hand.
- To have more details about it, read Fsarchiver vs partimage
The purpose is to have a very flexible program.
FSArchiver can extract an archive to a partition which is smaller that the original one as long as there is enough space to store the data.
- It can also restore the data on a different file-system, so it can use it when you want to convert your file-system: you can backup an ext3 file-system, and restore it as a reiserfs.
FSArchiver works at the file level.
- It can make an archive of filesystems (ext4, ext3, xfs, btrfs, reiserfs, ntfs, …) that the running kernel can mount with a read-write support.
- It will preserve all the standard file attributes (permissions, timestamps, symbolic-links, hard-links, extended-attributes, …), as long as the kernel has support for it enabled.
- It allows to preserve all the windows file attributes (ACL, standard attributes, …).
- It can be used with LVM snapshots in order to make consistent backups of all filesystems including the root filesystem.
Implemented features
The following features have already been implemented in the current version:
- Support for basic file attributes (permissions, ownership, …)
- Support for multiple file-systems per archive
- Support for extended attributes (they are used by SELinux)
- Support the basic file-system attributes (label, uuid, block-size) for all linux file-systems
- Experimental support for ntfs filesystems (ability to create flexible clones of windows partitions)
- Checksumming of everything which is written in the archive (headers, data blocks, whole files)
- Ability to restore an archive which is corrupt (it will just skip the current file)
- Multi-threaded lzo, gzip, bzip2, lzma/xz compression: if you have a dual-core / quad-core it will use all the power of your cpu
- Lzma/xz compression (slow but very efficient algorithm) to make your archive smaller.
- Support for splitting large archives into several files with a fixed maximum size
- Encryption of the archive using a password. Based on blowfish from libgcrypt
Limitations
There are several limitations anyway: it cannot preserve filesystem attributes that are very specific.
- For instance, if you create a snapshot in a btrfs volume (the new-generation file system for linux), FSArchiver will not know anything about that, and it will just backup the contents seen when you mount the partition.
FSArchiver is safe when it makes backups of partitions which are not mounted or mounted read-only.
- There is an option to force the backup of a read-write mounted volume, but there may be problems with the files that changed during the backup.
- If you want to backup partition which are in use, the best thing to do is to make an LVM snapshot of the partition using lvcreate -s, which is part of the LVM userland tools.
- Unfortunately you can only make snapshots of partitions which are LVM Logical Volumes.
- You can have more details about the current status of that project.
Protection against data loss
FSArchiver is using two levels of checksums to protect your data against corruption.
- Each block of each file has a 32bit checksum written in the archive.
- That way we can identify which block of your file is damaged.
- Once a file has been restored, the md5 checksum of the whole file is compared to the original md5.
- It is a 128bit checksum, so it will detect all file corruptions.
- In case one file is damaged, FSArchiver will restore all the other files from your archive, so you will not loose all your data.
- It is very different from tar.gz where the whole tar is compressed with gzip.
- In that case, the data which are written after the corruption are lost.
Download
FSArchiver can be downloaded either the sources [https://sourceforge.net/projects/fsarchiver/files/fsarchiver-src/] or a static binary [https://sourceforge.net/projects/fsarchiver/files/fsarchiver-bin/] from the sourceforge download page. [https://sourceforge.net/projects/fsarchiver/files/]
- You can also download SystemRescueCd [http://www.sysresccd.org/] which is a livecd that provides a recent FSArchiver and all the file-system tools and libraries required.
- So if you want to use FSArchiver to save or restore your root file-system, the best thing to do is to run FSArchiver from this livecd.
References
http://www.fsarchiver.org/Main_Page
http://www.fsarchiver.org/forums/
Track changes using the detailed ChangeLog [http://www.fsarchiver.org/Changelog]