4

My 10.04 machine uses three partitions: 5 GB for /boot, 25 GB for / and 120 GB for /home. / and /home are encrypted with LUKS passphrase.

I've downloaded the alternate installer in order to reinstall the machine. I want my / partition to be rewritten, but to keep my existing /home.

Any way to tell the installer my /home already exists in a separate LUKS partition?

Thanks in advance,

Adam

Adam Matan
  • 12,519

1 Answers1

4

What I would do is to reinstall using /boot and / and leave the /home partition alone during the install. Once you have installed you can install cryptsetup, set up your partition in /etc/crypttab and /etc/fstab and you'll be away. I'll assume you have an encrypted swap For the details, once you have installed and rebooted, open a terminal and:

sudo apt-get install cryptsetup
cryptsetup luksOpen /dev/sda6 crypthome
cd /
mount -t ext4 /dev/mapper/crypthome /home

Edit the partition details and file system type as required. Now you can browse /home and ensure it is what you expect. Then you need to put the following in /etc/crypttab

crypthome /dev/sda6 none         luks
cryptswap /dev/sda7 /dev/urandom swap

And in /etc/fstab you need to add these lines to the end

/dev/mapper/crypthome  /home  ext4  defaults  0  2
/dev/mapper/cryptswap  none   swap  sw        0  0

Do a reboot to check it all works as expected and you're away :)

Hamish Downer
  • 19,181
  • I wanna do pretty much the same but use a partition with custom password. I use pam_mount to automount the partition but it fails on Oneiric. Maybe you can have a look at it http://askubuntu.com/questions/73435/pam-mount-wont-automount-encrypted-partiton – n3rd Oct 29 '11 at 05:18