- [Instructor] Hello, welcome to the last video
of this section,
creating entire disk images with fsarchiver.
In the previous video we learned
how to perform version control based backup with Git.
In this video we're finally going to create
entire disk images with the fsarchiver command.
Fsarchiver is a tool which can save the contents
of a complete filesystem to a compressed archive file.
Due to these abilities, it is one of the most complete
and easy-to-use tools for backup.
Fsarchiver is the successor of partimage,
the well-known filesystem backup solution.
Fsarchiver has the advantage of supporting newer file
systems like ext4 when compared to partimage,
however the latter has a minimal GUI
that makes it somewhat easier to use.
Fsarchiver is not installed in most distros by default.
You'll have to manually install it
using your package manager.
If you want more information go to this website.
So I've already installed it on my terminal.
Let's move on and see how to do it.
So for creating a backup of a filesystem or partition
use the savefs option of fsarchiver like this.
Here backup.fsa is the final backup file
and /dev/sda1 is the partition to backup.
Now to backup more than one partition at the same time
use the savefs option as earlier and pass the partitions
as the last parameters to fsarchiver.
Next to restore a partition from backup archive
use the restfs option of archiver in this way.
Id=0 denotes that we want to pick the first partition
from the archive to the partition,
specified as dest=/dev/sda1.
Let's restore multiple partitions from a backup archive.
As earlier use the restfs option as this.
Here we use two sets of the id dest parameter
to tell fsarchiver to restore the first two partitions
from the backup to two physical partitions.
We shall now explore the working of it.
Very similar to the way tar works,
fsarchiver goes through the filesystem
to create a list of files
and then saves them to a compressed archive file.
The advantage here is that unlike tar,
which only saves information about the files,
fsarchiver performs a backup of the filesystem as well.
This means that it is easier to restore the backup
on a fresh system
as it is not necessary to recreate the filesystem.
If you're seeing the /dev/sda1 notation for partitions
for the first time, this deserves some explanation.
/dev in Linux holds special files called device files
which refers to a physical device.
The sd in sda1 refers to SATA disk.
The next letter can be a, b, c and so on,
followed by the partition number.
Fantastic.
In this section we first learned archiving with tar
and cpio commands.
We then moved on to archiving and compressing with zip
and do fast archiving with pbzip2.
Also we created filesystems with compression
and backup snapshots with rsync.
Finally we looked into version control-based backup with Git
and then created entire disk images with fsarchiver.
In the next section we'll explore in detail
about the old-boy network.