Skip to content

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.

3 points4 comments
Open on Reddit
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

3 points
unknown author3 hidden

Deleted before we saved it.

1 points

Will it be enough to just edit the lvm.conf?

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.

1 points

You should also generally move keyboard before encrypt so that you can enter the keyboard. (In some cases it might work anyway, but just to be safe)

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.