Fsarchiver Tips and Tricks

Fsarchiver may be used to create a compressed and encrypted archive of an UNMOUNTED partition and store the archive in an arbitrary directory such as backup located on a mounted partition. It may also be used to obtain archive information or restore decompressed and decrypted archive data to an EXISTING and UNMOUNTED partition of suitable size.

[fish@fedora:6.14.11-300.fc42.x86_64:~]
$ lsblk -f /dev/nvme0n1p8
NAME FSTYPE FSVER LABEL  UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme0n1p8
     ext4   1.0   G8f42c f9cb3c11-11d6-4be7-8043-8b4796753dc0   23.5G    46% /
[fish@fedora:6.14.11-300.fc42.x86_64:~]
$ 

Following is a template that may be copied to the backup directory. This template contains command strings that may be copy pasted to create an archive or restore to a partition from an archive

FSARCHIVER ( Template_2024_0620 )

fsarchiver command string parameters:

        -j2 (2 cores - Fast compression)

        -Z7 (zstd compression from 1 (very fast) to 22 (very good))

        -c - (Encrypt/decrypt archive data with an interactive password)

        When creating an archive of an UNMOUNTED partition, user will be
        prompted for a CASE-SENSITIVE password after submitting an
        fsarchiver savefs request string. Then a second request will be
        made for a password. If the passwords are not identical the archive
        will NOT be created. Don't attempt to archive a mounted partition.

        When retoring an archive to a partition, user will be prompted
        for a CASE-SENSITIVE password after submitting an fsarchiver restfs
        request string. If the password submitted is not identical to the
        one used when the archive was created, the archive will not be
        restored. Don't attempt to restore to a mounted partition.

        -v (Verbose mode parameter can be used several times to increase
        the level of details)

Arbitrary names used in the following examples may be changed by the user
however the .fsa file extension is mandatory.

Example fsarchiver command strings to create a compressed and encrypted
archive, arbitrarily named ARCHIVE_00.fsa, from a desired UNMOUNTED
partition in /dev/nvme0n1 or /dev/nvme1n1 storing the archive in a mounted
directory, arbitrarily called backup, /mnt/backup/:

        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme0n1p1; date
        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme0n1p2; date
        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme0n1p3; date
        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme0n1p4; date
        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme0n1p5; date
        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme0n1p6; date
        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme0n1p7; date
        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme0n1p8; date

        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme1n1p1; date
        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme1n1p2; date
        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme1n1p3; date
        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme1n1p4; date
        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme1n1p5; date
        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme1n1p6; date
        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme1n1p7; date
        date; fsarchiver -j2 -Z7 -v -c - savefs /mnt/backup/ARCHIVE_00.fsa /dev/nvme1n1p8; date

COPY directory backup to facilitate its reuse.
File ARCHIVE_00.fsa may not be overwirtten and should be deleted before
reusing directory backup to store a new archive.

fsarchiver command to provide info about archive ARCHIVE_00:

        date; fsarchiver -v -c - archinfo ./ARCHIVE_00.fsa; date

Example fsarchiver command strings to format an EXISTING and UNMOUNTED
partition creating the same type filesystem that was used in the partition
when the archive was created, decompressing the archived data and storing
it in the target partition:

        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme0n1p1; date
        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme0n1p2; date
        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme0n1p3; date
        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme0n1p4; date
        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme0n1p5; date
        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme0n1p6; date
        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme0n1p7; date
        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme0n1p8; date

        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme1n1p1; date
        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme1n1p2; date
        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme1n1p3; date
        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme1n1p4; date
        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme1n1p5; date
        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme1n1p6; date
        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme1n1p7; date
        date; fsarchiver -v -c - restfs ./ARCHIVE_00.fsa id=0,dest=/dev/nvme1n1p8; date
EOF

Please use pre-formatted text for textual information, not screen shots.
The screen shots are hard to read, especially the 2nd image, and cannot be index and searched.