Score:0

Perform backup of root directory in luks-container form initramfs

cn flag

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?

cn flag
Bob
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
northcom avatar
cn flag
@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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.