Full system backup with SquashFS
SquashFS  makes highly compressed read-only backup archives of complete systems. It is convenient since you can mount it and find/grep/cp/tree in it without decompressing the whole SquashFS archive. Backup takes less time and overhead of file retrieval/traversal is lower compared to tar, but modifying an existing archive is impossible as a penalty.
Prepare live CD/DVD/USB
You should have Archiso#Configure the live medium on how to configure
packages.x86_64 and build live CD/DVD/USB with installed.
Backup in live environment
Boot into live CD/DVD/USB and mount filesystems you would like to backup.
# fsck /dev/sdb2 # fsck /dev/sdb1 # mount /dev/sdb2 /mnt # mount /dev/sdb1 /mnt/boot/efi # /somewhere/mksquashfs.sh SOURCE_DIRECTORY BACKUP_ARCHIVE_DIRECTORY
#!/usr/bin/env bash # Sanity if [ $# -ne 2 ]; then echo "invoke: mksquashfs.sh SOURCE_DIRECTORY BACKUP_ARCHIVE_DIRECTORY" exit 1 fi echo -ne "\n\nHave you fsck'd? " read # Backup mksquashfs \ "$1" "$2/$(date +%Y%m%d_%a).sfs" \ -comp gzip \ -xattrs \ -progress \ -mem 5G \ -wildcards \ -e \ boot/efi \ boot/grub \ boot/initramfs-linux"*".img
#!/bin/bash # Path to extract files target=/mnt # Path to backup SquashFS archive file archive=/somewhere/backup.sfs unsquashfs -stat $archive unsquashfs -force -dest $target $archive
- Fix fstab
- mkinitcpio -p linux
Restore (mount and copy)
- mount somewhere/backup.sfs /mnt
- cp /mnt/somefile /somewhere/damaged-somefile