You are not logged in.
Pages: 1
Hello.
My configuration is the following: NVMe M.2 SSD, LUKS2 full-disk encryption, Btrfs filesystem.
I would like to perform backup of whole Linux system (every subvolume, every file and it's properties/metadata, etc.) to another (non-system) HDD.
My goal is to be able to restore such backup after complete LUKS2 container & Btrfs filesystem recreation, and, most importantly, with few changes to key properties of those.
Changes:
1. LUKS2 container sector size: 512 bytes > 4096 bytes
2. Btrfs filesystem checksum algorithm: CRC32C > XXHASH
Motivation:
1. Btrfs filesystem sector size is already 4096 bytes (which is default). However, I forgot to tell cryptsetup about it during initial installation. Would like to fix.
2. XXHASH is stronger hash by itself & works even faster than CRC32C on my Ryzen CPU. I simply didn't know about it's existance during initial installation. Would like to try.
I understand that performance benefit from those two actions is most likely minimal, if any. And it's OK for me. In worst case, I'll just learn something new, so, nothing to lose here.
First action actually doesn't require container recreation and can be accompleshed with just "cryptsetup reencrypt" command.
However, such process could last long, power outages do happen from time to time, and I would like to have a backup anyway in case of any possible corruption.
I want this backup to be 100% identical to original system, so few edits will be required to bring restored system to fully working state.
Edits:
1. I'll handle reinstallation of GRUB image file myself, so, no need to worry about it.
2. /etc/default/grub: new UUID of LUKS2 container (to boot from GRUB).
3. /etc/crypttab: new UUID of LUKS2 container (to unlock with keyfile).
4. /etc/fstab: new UUID of Btrfs filesystem (to mount all subvolumes).
From what I read, I'll need to use "btrfs send/receive" commands to achive this goal. But there are some difficulties which I need to keep in mind.
1. System disk is NVMe M.2 SSD, backup disk is HDD.
2. Backup HDD currently suffers from same misconfiguration as system NVMe M.2 SSD: 4096 bytes physical & Btrfs filesystem sector size, 512 bytes LUKS2 container sector size; CRC32C Btrfs filesystem checksum algorithm.
3. Backup HDD already contains data which I do not wish to erase or otherwise lose, but free space should be enough to store full system backup near existing files.
System disk stores five Btrfs subvolumes (and it's respective mountpoints): @ (/), @home (/home), @vbox (/vbox), @cache (/vat/cache), @log (/var/log).
Backup disk currently stores only one Btrfs subvolume: @data, which simply contains all existing files on it.
I've only seen very simple guides about single data subvolume backup with btrfs send/receive.
So, my questions are:
1) How backup and restore processes would look like in case of full Linux system with multiple subvolumes? Is there any commands/flags to handle subvolumes recursively?
2) Will differences in sector sizes & checksum algorithms between disks or backup/restore targets cause any problems? If so, how to deal with them?
3) Should I create additional subvolume on backup disk specifically to store this backup?
Thank you very much for reading and for any possible help in advance!
Last edited by hotcapy (2023-09-29 08:48:39)
Offline
For the initial backup and restore you could use rsync (file-based backup), for example, while booted into another (live) Linux system.
I would also backup the Backup HDD to another disk, so you will always have at least two copies of your files at all time.
Offline
Btrfs itself does not handle subvolumes recursively. As far as I know, you always have to list all the subvolumes you want to snapshot or replicate yourself.
Last edited by willemw (2023-09-29 18:16:19)
Offline
Pages: 1