0

My server is running from a root directory in an encrypted luks container with lvm layout. To perform a backup of the root partition, it is usually the consensus that the filesystem can not be mounted, especially when using dd.

The partition layout looks as following:

sda                8:0    0  7.1T  0 disk  
├─sda1                8:1    0  256M  0 part  /boot/firmware
└─sda2                8:2    0  7.1T  0 part  
  └─luks        253:0    0  7.1T  0 crypt 
    ├─rasp-root 253:1    0  200G  0 lvm   /
    ├─rasp-swap 253:2    0   25G  0 lvm   [SWAP]
    └─rasp-data 253:3    0  6.9T  0 lvm   /mnt/data

I am wondering what is the most elegant way to perform a backup of rasp-root to rasp-data at early boot-stage before / is mounted? Is there even an easy way to perform automatic backups with an rotation routine?

  • I think your approach is an attempt to solve the wrong problem. The more conventional approach to making backups is to backup your data , rather than cloning volumes/disks with `dd`, especially on running systems. A clone for example always includes all empty blocks, doesn’t support incremental backups and cloning makes it difficult to restore for example only specific files. See https://en.wikipedia.org/wiki/List_of_backup_software – Bob Dec 29 '21 at 08:36
  • @Bob In general I would agree that ```dd``` comes with its downsides. Still, here the more relevant part is the stage of the backup process in early boot phase. I do not plan to take regular backups with dd, but I think its a good choice to do an initial one if you want to reset to an very early stage. – northcom Dec 29 '21 at 17:54

0 Answers0