systemd-unit for a second LVM

Kernels & Hardware, configuring network, installing services

systemd-unit for a second LVM

Postby rolf3945 » 2017-11-29 16:38

Given: an encrypted Stretch on SSD, as usual /boot un-encrypted, with an luks-encrypted volume containing a LVM for /root and /swap in the logical volumes. This setup is nicely decrypted, fscked and mounted during boot, the PC is usable afterwards.

Got a second luks encrypted volume on a big disk, also containing a LVM with 2 logical volumes, one of them intended to replace the /home on the SSD. I managed to get the luks container opened during boot with a keyfile, and now I am stuck. There is no more automatic action, I have to enable the LVM with vgscan and vgchange manually, and then I can do a fsck the ext4 filesystem on the LVs and then mount the LVs.

I want this to be happen automatically. As far as I understand the man pages and the Ubuntu Howto, I need to put this into a systemd unit (I am new to this). Reading the stuff has not really helped me, its very theoretical and I am missing practical examples how to handle such a bit more unusual situation. Also the most trusted web search machine has not put up something I could use for such a use case.

Hints how to generate or write a suitable unit are welcome.

Thanks for reading, Rolf
Posts: 7
Joined: 2009-06-11 19:29

Return to System configuration

Who is online

Users browsing this forum: fender0107401 and 13 guests