« Useful layers of indirection | Main | Return of the backup MX host »

Encrypted root filesystem question

François-René ÐVB Rideau asked:

Interesting. Can you publish your configuration files and the list of packages used? Do you carry the key on a floppy? On a USB key? Or do you type a long key at boot up? Is all of the disk encrypted, or only the user partition? etc.

The configuration files are minimal. The important Debian package to install is cryptsetup. In the /usr/share/doc/cryptsetup directory are HOWTOs for setting up encryption on root and swap partitions. Those files are short and the instructions worked perfectly for me. I compiled my own kernel using make-kpkg from the kernel-package package. You'll need a 2.6.4 or later kernel with cryptographic routines and LVM enabled. While I use a monolithic kernel, using modules and mkinitrd works fine as well.

My key is a fairly long passphrase. It can be whatever length you want, but you need to type it into the prompt at boot time. Reading from USB keys is not supported by the startup script, but I imagine you can hack it without much difficulty if you wanted to read from a USB mount at boot time.

You setup encryption by partition. My laptop partition structure is:

/dev/hda1/boot200MBext3unencrypted
/dev/hda2/19GBxfsAES encrypted
/dev/hda3swap1GBswapAES encrypted
/dev/hda4LVM60GBLVM PVAES encrypted

I created several logical volumes on the encrypted /dev/hda4 while leaving 5GB available for temporary snapshots volumes.

My /etc/crypttab looks like this:
root /dev/hda2
cswap /dev/hda3 /dev/random swap
mainpv /dev/hda4

Besides the very helpful HOWTOs in the Debian package, I also referred to this useful guide.

I hope that helps, let me know if you have more questions.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on August 24, 2005 8:29 PM.

The previous post in this blog was Useful layers of indirection.

The next post in this blog is Return of the backup MX host.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.