3 ms·
Mostly local network storage which is backedup multiple times automatically, for the laptop I do manual btrfs send/receives manly to get things restored exactly
by cmurf 9y ago
Mostly local network storage which is backedup multiple times automatically, for the laptop I do manual btrfs send/receives manly to get things restored exactly the way they were.
#helps to see the fstab first
UUID=<rootfsuuid> / btrfs subvol=root 0 0
UUID=<espuuid> /boot/efi vfat umask=0077,shortname=winnt,x-systemd.automount,noauto 0 0
cd /boot
tar -acf boot-efi.tar efi/
mount <rootfsdev> /mnt
cd /mnt
btrfs sub snap -r root root.20170707
btrfs sub snap -r home home.20170707
btrfs send -p root.20170706 root.20170707 | btrfs receive /run/media/c/backup/
btrfs send -p home.20170706 home.20170707 | btrfs receive /run/media/c/backup/
cd
umount /mnt
So basically make ro snapshots of current root and home, and since they're separate subvolumes they can be done on separate schedules. And then send the incremental changes to the backup volume. While only incremental is sent, the receive side has each prior backup to the new subvolume points to all of those extents and is just updated with this backups changes. Meaning I do not have to restore the increments, I just restore the most recent subvolume on the backup. I only have to keep one dated read-only snapshot on each volume, there is no "initial" backup because each subvolume is complete.
Anyway, restores are easy and fast. I can also optionally just send/receive home and do a clean install of the OS.
Related, I've been meaning to look into this project in more detail which leverages btrfs snapshots and send/receive.
https://github.com/digint/btrbk https://github.com/digint/btrbk