Hi!
I installed openSUSE on a new disk and made a backup of /home but I forgot about my LUKS encrypted BTRFS RAID1 disks.
How can I add them back to my new installed system? I can unlock them with the passphrase and btrfs can see them but how can I have them to automount and decrypt at start-up like they used to?
I did as per your suggestion. It leads to booting into emergency mode.
if I comment out the fstab entry, system loads. But of course, my btrfs volumes are inaccesible.
crypttab is not user-readable.
But generally a good concept to keep in mind, though I wouldn’t worry about it when working with filesystems, most of them are not user programs.
I’ve found adding x-initrd.attach useful even for encrypted USB drives as otherwise systemd attempts to close them prior to unmounting the fs during shutdown. Add nofail option in crypttab and fstab entries if these are external drives or you do not want the boot to fail due to them.
To test:
# reload to let systemd pick up on updated crypttab entries
sudo systemctl daemon-reload
# use systemd to open the encrypted volumes
sudo systemctl start systemd-cryptsetup@sda.service
sudo systemctl start systemd-cryptsetup@sdb.service
# mount btrfs raid volume after uncommenting the line in fstab
sudo mount -av
Thanks @pavinjoseph it worked, except for this error when running cryptsetup:
Job for systemd-cryptsetup@sdb.service failed because the control process exited with error code.
See "systemctl status systemd-cryptsetup@sdb.service" and "journalctl -xeu systemd-cryptsetup@sdb.service" for details.
It’s better to name the encrypted device as something other than sda or sdb as those names are given to the disks by the system and could change after the next reboot, leading to some confusion. It would be already quite confusing as the disk /dev/sda and /dev/mapper/sda both existing!
Did systemd ask you for the encrypted volume’s password when starting it? Perhaps it only supports key files.
If there are errors, please show the output of:
The disks work with a passphrase, but I had a key setup to avoid the double password issue. Problem is the key is in my old root partition on my secondary disk. I think I have to generate the key again with the passphrase. I really didn’t think through this “migration”.