Any distro would do, but for my case, it is Arch because I have more control over the partitions. I would like the OS, so root, swap and others on 1 drive. The /home should be on a separate drive. The tricky thing is to have everything encrypted, except /boot and /efi of course.

Now, here is what I can do

  1. FDE on 1 drive. This is easy: you create /efi, /boot and then create a large LUKS partition. From there, you create LVM on that LUKS partition and get your: /, /home and swap. Then mount everything correctly and install.

In the grub config, you only need to set it so it knows the LUKS partitom and where the root is. For eg, if your LUKs partition is /dev/sda3, you do:

  • cryptdevice=UUID=<uuid of the /dev/sda3>: cryptlvm rootfs=/dev/vg/root.
  1. Unencrypted /home on another drive. This is like 1) but /home is mounted on a separate drive. Still need to do the grub config, but nothing is needed for /home. It is automatically mounted when you login.

Now for my case: Encrypt /home

The encryption and mount part is easy. But how to get the OS to recognize it? The Arch wiki has this weird thing where you create an encryption key, they called it home.key, using cryptsetup. You then store the key in /etc and then in your /etc/crypttab, you specifiy the drive with /home and location of the key. No need for any passphrase.

The problem I have with this is that keys are stored in root. So if my root system is corrupted, I cant even decrypt home…

Any advice is welcome…

  • bodaciousFern@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    3 hours ago

    But how to get the OS to recognize it?

    My approach for doing this in Gentoo with an encrypted /home is to configure dracut to make a slightly customized initrd.

    Thanks to dracut modules, not too much configuration is needed - it prompts on boot for the password to decrypt, and then fstab is just configured to mount the decrypted uuid.

    Someone else mentioned using multiple key slots, but I think this is your only real secure option.

    Edit: on second thought, you may be able to get this to work in grub simply by adding rd.luks.uuid=xxx as a kernel boot parameter, and then having the decrypted /dev/mapper uuid in fstab for /home

  • treesoid@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    16 hours ago

    You could give the home partition two keys, one stored on the root as you described and the other stored somwhere else/remembered.

  • Lemmchen@feddit.org
    link
    fedilink
    arrow-up
    7
    ·
    16 hours ago

    You can always have a copy of the keyfile somewhere else, on an USB drive for example.
    Alternative is to also add a passphrase to the /home luks partition.

    • mazzilius_marsti@lemmy.worldOP
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      15 hours ago

      yeh if I encrypt /home using luks with passphrase, so cryptsetup. How do I tell the OS to decrypt it? I tried passphrase before and it cannot boot because /home cannot be mounted. That is why I searched and found out about the Arch wiki way: using keyfile stored in root.

      • Lemmchen@feddit.org
        link
        fedilink
        arrow-up
        7
        arrow-down
        1
        ·
        edit-2
        15 hours ago

        LUKS does offer multiple key slots. You can have the OS unlock it with a keyfile and be able to manually unlock it with a keyphrase when you don’t have access to that file.
        I’m not sure if you can tell the OS to unlock it with a passphrase on boot like with the root partition.

  • mina86@lemmy.wtf
    link
    fedilink
    English
    arrow-up
    2
    ·
    10 hours ago

    If you go with adding a passphrase to the drive keep in mind that if it’s a unique one you may end up forgetting it since you won’t normally be using it. Even if you set it to the same passphrase as root partition, if you ever change passphrase for root you might forget to change home passphrase.

    I would probably just make a physical copy of the key file. It’s just 32 bytes (no, larger key file doesn’t make things any more secure) so you can hexdump -C it and copy the key on a piece of paper.

  • hendrik@palaver.p3x.de
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 hours ago

    I went with the option with keyfiles. I keep backups of LUKS headers and keyfile in case a harddisk gets damaged. Currently have that stored as a file attachment in my password manager.