I am a big fan of linux and like trying out new distros now and then. I usually have my home folders and roots in a lvm atop an encrypted partition, but this tends to become cumbersome with every initramfs creation process being more alien than the last one.

I value privacy, but most of my valuable information or personal is stored in the home folders. Moreover, I partitioned using GPT, so multiple partitions are not that hard to setup even outside a lvm.

So the question is: Is root crypting and lvm-ing of "/" worth it, especially with all the early userspace hassle I have to deal with?

  • 2
    Perhaps something I should have mentioned is swap. I work on a laptop so I frequently use swap-to-disk. This is an easily exploitable feature unless the partition is encrypted and because mounting such a swap is done before root mount this means that I might just as well mount the / too while I'm there.
    – nikitautiu
    Commented May 17, 2012 at 17:48

3 Answers 3


First of all the hassle with encrypted root and early userspace is typically already handled by your distribution (as far as i know Fedora, Debian, Ubuntu and OpenSUSE support encrypted root out of the box). That means you don't have to care for the setup itself.

One reason for encrypting / is just to be sure you don't leak any information at all. Think about programs writing temporary data into /tmp, log files containing sensitive information like username/passwords in /var/log or configuration files containing credentials like a password in /etc/fstab or some commands in the shell history of the root user.

Using LVM instead of partitions has one great benefit, you can easily resize/rename/remove logical volumes without the need to re-partition your disk itself, it is just more convenient than using partitions (GPT or MBR)

  • For me LVM has always been a de facto standard, it offers so much flexibility over traditional partitioning especially in a multi-boot environment. Also as long as I already learned how to use initramfs-tools and mkinitcpio, I might as well just learn any other ramfs tool some exotic distro has to offer. :D
    – nikitautiu
    Commented May 17, 2012 at 17:42
  • 1
    @vitiv just for the record initramfs-tools have excellent cryptoroot integration, just install cryptsetup, create the appropiate /etc/crypttab, adjust /etc/fstab and you are done. Commented May 17, 2012 at 17:48

/etc, /var, and /tmp come to mind. All can potentially have sensitive contents. All can be given separate volumes, but it's common for each of these to be on the same filesystem as the root directory. Maybe you've moved one or more off into their own volumes, but have you moved them all?

  • /etc contains:

    • hashed passwords; possibly multiple sorts, such as /etc/shadow and /etc/samba/smbpasswd

    • private keys of various sorts: SSL, SSH, Kerberos...

  • /var contains:

    • /var/log, many of which contents are intended to be read-only by root because they may contain sensitive data; for example, /var/log/httpd/access_log may contain GET data which is unencrypted entries by a web site's users, and therefore may be sensitive.

    • database files; MySQL typically stores its table and index files in /var/lib/mysql, for instance

  • /tmp contains temporary files, which may not sound sensitive, but there are a lot of attacks against Unix software that involves race conditions due to being able to modify or snipe a temporary file while the process is trying to use it. I know in many cases, the file contents are sensitive only in a short term way (i.e. not through a reboot) but I imagine some programs might be depending on the way sticky bits and mkstemp(3) behave to temporarily cache long-lived sensitive data, too.

  • 3
    /etc and /var are a good point. As for /tmp almost always set it up as tmpfs.
    – nikitautiu
    Commented May 17, 2012 at 17:38

Another reason is preventing tampering the filesystem. Once encrypted, it is much more complicated to do anything that could bite you on the next boot, e.g. placing a rootkit on your filesystem (be it by booting a live CD or moving the hdd to another machine temporarily). Your kernel (and initrd) are still vulnerable, but that can be alleviated by using either secure boot (with a properly signed boot chain) or by booting from a safe removable device (e.g. a flash drive or a memory card you have under control all the time).

  • 1
    indeed, encryption of /home is worthless if all the binaries can be tampered with before the user next boots. i'd say this i'd the most important answer. /home encryption only protects against sudden theft Commented Dec 19, 2016 at 15:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .