đģ BorgBackup
Created before 2022
BorgBackup (Arch Linux)
borg init --encryption={authenticated,repokey,..} /dir/backupdir
borg key export /dir/backupdir /dir/backupdirkey
sudo mount -t ext /dev/sdX
borg list /dir/archivedir
mkdir /dir/archivedir
borg init -e none /dir/archivedir
sudo borg create --stats --progress -C zlib,6 /dir/archivedir::root_archivename-{now:%-m-%d} /dir/inputfilesystem
mkdir /dir/archivedir
sudo dd if=/dev/sdX | borg create --stats --progress -C zlib,6 /dir/archivedir::sdX-{now:%-m-%d}
su -
mkdir /mnt/snapshot
mkdir /mnt/targetfs
mount -t ext4 /dir/archivedir /mnt/snapshot
mount -t ext4 /dir/filesystem /mnt/targetfs
cd /mnt/targetfs
borg extract --dry-run /mnt/snapshot/dir/archive::archivename-2020-03-09
borg extract /mnt/snapshot/dir/archive::archivename-2020-03-09
cd /
chroot /mnt/targetfs
echo "UUID=(blkid | grep sdXx(targetfs) | awk -F '"' '{print $2}') /mountpoint ext4 mountpermissions 1 0"
echo "UUID=(blkid | grep sdXx(snapshot) | awk -F '"' '{print $2}') /mountpoint ext4 mountpermissions 0 0"
vim /etc/fstab
/etc/fstab
changes if UUID mismatch
Check to see if the device is mounted first
borg key import /dir/backupkey
sudo borg extract \--stdout /dir/archive::my-sdx-2020-03-09 | dd of=/dev/sdx bs=10M
chroot /dev/sdx
fstab
changes if UUID mismatch
sudo borg check -v /dir/archive > archive.log
sudo borg check --repair /dir/archive
Remove the achive if needed (!)