Skip to content

Is LVM worth the overhead to reduce decryption time in LVM on LUKS?

I have 2 partitions on my laptop--one for the system and another for my media data. I want both encrypted and without LVM, I could add a key to my system partition to automatically decrypt the second partition after entering the passphrase for the first partition. However, it still takes twice the amount of time to decrypt than if I were to just decrypt 1 partition .

  • Maybe I could make the encryption for the second partition much weaker, but I don't know if that's a security risk in this setup. Or maybe I just combine the two partitions into 1 partition? I don't know what advantages I might be losing doing this way.

  • Another scheme is to use LVM on LUKS for the entire drive, where only one decryption is necessary. I already use Btrfs whose features tend to overlap LVM's. Of course an added bonus is being able to shrink/extend encrypted logical volumes if I ever want to do that.

I think the obvious answer is to just combine the two partitions into 1 partition, but I'm more interested in hearing the pros/cons of each method just so I can understand when they might be useful in other situations.

Thanks.

2 points5 comments
Open on Reddit
About this post
Posted
Archived
Score
2 · 100% up
Kind
Text
ID
71vpis

Author

176
posts
219
comments
4
media
View profile

5 comments

I don't see any advantage in having 2 partitions. I use a setup like this, one large btrfs filesystem with subvolumes on luks. really depends on why you have 2 partitions in the first place... seems to me much more inflexible, as you have to know beforehand how big the partitions need to be. one partition, it doesn't matter, both filesets just share all the space.

3 points

However, it still takes twice the amount of time to decrypt than if I were to just decrypt 1 partition

Is this 'twice the time' something you measured? Details please.

My experience is that with modern hardware, dm_crypt is almost too fast to measure.

2 points

I'm a complete noob so maybe I'm interpreting the wrong info--systemd-analyze blame shows:

41.358s hdd-one.mount
12.352s var.mount
 5.584s systemd-cryptsetup@crypt_hdd-three.service
 5.468s systemd-cryptsetup@crypt_hdd-one.service
 5.328s systemd-cryptsetup@crypt_hdd-two.service
 1.929s hdd-two.mount
 ...

The ~5.4 seconds for each systemd-cryptsetup@crypt_______.service means it takes that long to decrypt each drive, right? I'm using i5-2500k processor. Also, I have no idea why my HDD's are taking so long to mount. I have Arch installed on an SSD (Samsung 850 Pro) and my boot time is abysmal--it takes at least 30 seconds to boot to Linux. I don't know if this is normal even with 3 HDDs that are mounted on startup (if it is normal, I guess I can delay mounting it and see what happens; otherwise, I want them mounted ASAP).

I have a Btrfs on LUKS setup and can provide further details if you can diagnose the issue. On my laptop I also have the same setup except I don't have a /var subvolume on an HDD and everything is on an SSD so there is no HDD to mount/decrypt--boot time is very low which is what you'd expect. I think having /var on an HDD might also be a culprit because the system needs to wait for the HDD to mount/decrypt but I'm not sure. I'm really trying to figure out whether it is mounting and/or decrypting that causes boot time to be so slow. I think systemd-analyze blame suggests mounting takes ~40 seconds, but I assume that's not literally the case because I've read that while man-db.service can be very long according to systemd-analyze blame, it's running in parallel so it's not an issue.

Thanks.

2 points

Great info. Let's wait for more knowledgeable help than me. :-)

I have not had a FDE system in a long time, but IIRC, it booted much, much faster than your example.

I can say that systems I have with btrfs roots seem to boot much slower than EXT4 or EXT4 on LVM.

Sorry.

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.