For the purpose of disaster recovery we do wish to backup:
- GPT partition table,
- disk geometry (to restore to different sizes drives)
- and the corresponding file systems of each partition.
rsync can do the remaining file and folder backup and restore part. The five partitions on a GPT partitioned disk and its FAT and RAID-1 style BTRFS file systems need to be back-upped too.
Sgdisk doesn't restore file system
sgdisk drive backup and restore commands. That does only backup and restore the partition configuration, without having the file systems restored on the corresponding partitions.
File does output many file system details
# file -sL /dev/sda? /dev/sda1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "mkfs.fat", sectors/cluster 8, Media descriptor 0xf8, sectors/track 32, heads 64, hidden sectors 8192, sectors 2097152 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 2048, reserved 0x1, serial number 0x7181b420, unlabeled /dev/sda2: BTRFS Filesystem label "root", sectorsize 4096, nodesize 16384, leafsize 16384, UUID=b81e9d42-c0a2-4a1e-8197-f6775419f654, 3018244096/20971520000 bytes used, 1 devices /dev/sda3: BTRFS Filesystem label "home", sectorsize 4096, nodesize 16384, leafsize 16384, UUID=2cf4e529-b242-4913-b283-fd18df73316a, 194707456/9965666304 bytes used, 1 devices
There is potential for a backup of the
file -sL output, still missing how to restore this part.
We need an online (not having to take the system down to make a backup) "clone" command that does not backup the folder and files themselves. In other words all the drive configuration before files and folders can be restored (with a different tool).
Which command(s) do(es) take care of drive disaster recovery before files and folders?
Note: A one-liner is rewarded as a better answer over having to enter multiple commands.