Skip to content

Full disk encryption partitioning scheme on Arch

TL;DR: For those of you with multi-drive setups with some sort of encryption, what's your partitioning scheme and why?

To start, just wanna note that I’ve read all of the documentation on encryption on Arch in the wiki, and to be fair, this is likely more a partitioning question rather than an arch question.

System Info & Goal:

  • Non-UEFI Laptop
  • 2 drives (2Tb HDD and 512G SSD)
  • I’m looking to utilize full disk encryption.

I’ve looked into LVM on LUKS and I think this might be the way to go? Most of my confusion stems from my lack of knowledge in partitioning systems.

Essentially, I’m not sure of the best (subjective, I know) partitioning scheme for my device given the above desire.

Some of my confusions include:

  • whether or not my home directory should be on a separate drive as my root,
  • which drive those should reside on,
  • how much space to dedicate to each of these, and similar questions that are answered through a particular partitioning scheme.

My background is in Cybersecurity, and if I'm honest, I don't have a large background in partitioning systems for particular uses. So I think it’d be helpful to hear from others whom have some sort of encryption on a multi-drive setup and why you chose what you chose. Thanks in advance.

14 points16 comments
Open on Reddit
About this post
Posted
Archived
Score
14 · 89% up
Kind
Text
ID
17cb185

Author

2
posts
1
comments
0
media
View profile

19 comments

Your best bet is to use the 512GB SSD as / https://wiki.archlinux.org/title/Dm-crypt/Encrypting_an_entire_system#LUKS_on_a_partition; then create a specific non-standard mountpoint for your 2TB HDD (e.g. /mnt/bulk) which can be unlocked after the root partition in late userspace https://wiki.archlinux.org/title/Dm-crypt/System_configuration#crypttab .

You really shouldn't put /home on the HDD because it will slow down all your programs (such as browser caches, local configurations, etc.). You should use the /mnt/bulk/$(id -u) folder and symlink stuff as needed (e.g. ~/Music -> /mnt/bulk/1000/Music, ~/Pictures -> /mnt/bulk/1000/Pictures)

14 points

"main" disk encrypted and running btrfs under the hood on all partitions, secondary disk is ext4 one partition, decrypted using file key stored on the "main" drive at system start. Both encrypted using luks. I'm not sure how secure it is, but should be good enough to keep normal people away, which is precisely what I want. There's no best partitioning solution. You can throw everything on one partition and the system will still work. You can keep home on a separate partition if you consider reinstalling system and want to keep your personal files. I'd say keep system partitions (root, home, swap or anything else you want) on SSD, and format the other drive to ext4. Keep it simple and don't complicate your life unless you know what you're doing.

4 points

But you can't encrypt the "entire" disk. The efi partition has to be readable. How to handle this is where all the nuances come in.

1 points

I personally prefer two partitions: /boot and / . If you're like me, the best way to do this would be:

/boot EFI partition unencrypted

LVM combining rest of free space on that device plus other device as one logical volume

That volume contains luks encrypted volume, which when mounted, is /

So basically not LVM on LUKS but LUKS on LVM

3 points

I have /boot EFI like yours, and / encrypted and btrfs formatted. So no lvm. Is lvm better?

2 points

No, you're good here. LVM will add some overhead and is unnecessary - you get snapshots with btrfs.

The reason I recommended LVM to OP is because OP has multiple hard drives. In essence, OP will create LVM partitions on each drive and assign them to the same logical volume. That logical volume is basically treated like a block device, so OP can format the entire thing like it's one big partition and not have to worry about managing where things get installed etc

2 points

I have a 1tb drive with a 512gb drive that I installed afterwards. I have /boot and /root on my 1tb. Also have an EFI partition. My 512 is just a single partition mounted at /storage. Everything is luks2 encrypted.

I put a copy of automatic rsync backups for my /root partition (I use ext4) in /storage and use syncthing to mirror them to my desktop at home. I also manually make .tar archives of /home every couple months or so and put them in there, which get synced to my desktop as well. I avoided LVM because while it does make resizing partitions easier, there is greater chance of data loss if a drive breaks. I did not bother putting /home on a separate drive because I don't distro hop and I didn't see the point.

I have the key for the 512gb on my root partition and the key for the root in my TPM. I also use secure boot with sbctl. When I turn on my laptop, TPM auto unlocks root if the hardware has not been tampered with and the kernel is properly signed. If either of those conditions are not met, I get prompted for the encryption passphrase. Once TPM unlocks my root, the root unlocks my /storage drive. Net effect is having a single password to get into the laptop without ever exposing unencrypted file system before login. Make sure to disable USB boot and to set a password on BIOS.

3 points

whether or not my home directory should be on a separate drive as my root

Separating home from root is not really needed. It is essentially a recommendation only if you are expecting to use the same home partition in different Linux installations. Separating them offers no extra security in almost any use-case. Not separating them, there will be less constraint and uncertainty about the size of either of them. And it is just simpler.

which drive those should reside on

You should put root and home in the SSD, and I recommend not to store bulk data in home, but keep it somewhere else; e.g. your HDD. You can keep notes, source files, and other frequently used things of rather low size in home; in the SSD.

Additional tip: you can use /tmp when you want to get faster performance for anything. It will be even faster than the SSD. You can put any files from your HDD into /tmp and work with them from there. /tmp is a temporary "disk" on RAM, and it is there by default on Arch. Of course you are limited by your RAM, so this will work only for some cases. I personally make a lot of use of this.

how much space to dedicate to each of these

root and home size depends on what your system will be like and what applications you will use. I personally have 3.8GB root usage and 5.9GB home usage currently, with two separated users, in a 4+ year-old system. So the space needed can be quite low, it depends on what you will do with your system. However, you can just give your entire SSD to root + home, if you do not want to keep space specifically for something else, or to keep some just in case.

​

My Setup

My use-case is with two compartmentalized users; keeping their activity and data independent.

At boot, I enter the root partition password. Then, each user's separate data partition is automatically decrypted and mounted when logging in with that user, with no need to enter the partition passwords.

Here is how I do it. With no need to store keys or passwords anywhere on disk. It might be useful for you otherwise too: https://www.reddit.com/r/archlinux/comments/145eo0e/comment/jnsabmp/

I found it here, as the nicest solution to what I want: https://wiki.archlinux.org/title/Dm-crypt/Mounting_at_login

​

Disk layout:

NVMe SSD - 120GB

  • boot : 520MB (42MB is used.)
  • (LUKS) root, including home: Rest of it. (9.7GB is used currently. Only games take up considerable space, and I do not have any right now.)

HDD - 1TB

  • (LVM) : 850GB
    • (LUKS) user 1's data partition : 600GB
      • All media and data. Downloads. Movies, anime, series. Academic data and documents. Backups. Cloud drives.
    • (LUKS) user 2's data partition : 250GB
      • More private stuff.
      • Bad stuff. ( ͡° ͜ʖ ͡°)

Everything is ext4, except for boot of course. All three LUKS passwords are different.

LVM turned out to be not needed really, as I never had the need to resize the partitions or anything. I would not do LVM at all if I was doing it now. There is value in keeping things simple too. So, if you think you will not need the functinality from LVM, it might be better to omit it.

Similarly, if you do not think you will like the extra functionality from zfs, btrfs or whatever, I recommend just using ext4 and LUKS; keeping things simple and standard. I see people here that decided to use btrfs just because they read things about it being awesome, but not using or even knowing any of its extra functionality, and then complaining about issues they have.

So, my overall recommendation is to keep things as simple as your use-case allows. Also, do not overthink the security. Security and privacy lead to an endless pit of never having the perfect setup. Just having encryption on your partitions and general common-sense can be more than enough to give enough security for most people's use-cases. I do not think you are a fugitive or some high-value target for hackers.

2 points

Thank you! I really appreciate your well thought out and SUPER informative answer.

2 points

You should brush up on storage, its best covered in the RHCSA curricula (for fundamentals).

1 points

In my UEFI notebook I have an EFI partition, a btrfs partition with subvolumes and swapfile, a Windows partition and other partition for sharing data between both OS. Plus Secure Boot

1 points

ZFS. It has built-in encryption support for individual datasets. Or you can encrypt the entire pool!

Since encryption is handled entirely by ZFS, my partitions look like this:

  • Main SSD has a small 512 MB EFI System partition and a second partition used in ZFS spanning the rest of the drive

  • Both HDDs have a single partition used in ZFS, they are combined into a striped vdev by ZFS, no mdadm magic needed.

0 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.