Mounting encrypted lvm swap
is it required to use the encrypt flag in mkinitcpio and grub config when using encrypted swap in an lvm partition?
my setup is 1 boot partition, 1 lvm partition (swap, root).
the swap is not a real partition. i tried to use those flags but it won't mount but i can see it working upon boot.
About this post
- Posted
- Archived
- Score
- 3 · 100% up
- Kind
- Text
- ID
- 2f87it
6 comments
You need encrypt & lvm2 in mkinitcpio.conf, and the cryptdevice=<dev>:<vg> in GRUB_CMDLINE_LINUX_DEFAULT /etc/default/grub.
If you want to allow TRIM commands go through, also add :allow-discards to that GRUB_CMDLINE_LINUX_DEFAULT
Deleted before we saved it.
Nope, the setting in lvm.conf is for a different purpose. AFAIK that would go into play only if you resize or delete your lvm-LV
The allow-discards setting i mentioned is described on one of the wiki pages that talk about setting up encryption.
Edit 09-13: Above may or may not be true. I thought it would be that way from reading lvm.conf manpage, but have heard someone say in the meantime that this setting in lvm.conf really matters.
You should also generally move
keyboardbefore encrypt so that you can enter the keyboard. (In some cases it might work anyway, but just to be safe)