Page 1 of 1

Encrypted /home not mounted on boot

Posted: Thu Jun 07, 2012 3:01 pm
by rodolfoarce
Hello:

I have a Toshiba Sattelite L305D Laptop with a 500 GB SATA disk, running LinuxMint13 -Maya x86_64.

Before installing Maya, I had Fedora 14 with wich I created an encrypted /home scheme.

Code: Select all

/dev/sda1 -> /
/dev/sda2 -> swap
/dev/sda3 -> /home
## Some data about the encrypted partition

Code: Select all

rodolfo@laptop-toshiba ~ $ sudo cryptsetup status /dev/mapper/home
/dev/mapper/home is active and is in use.
  type:    LUKS1
  cipher:  aes-xts-plain64
  keysize: 512 bits
  device:  /dev/sda3
  offset:  4096 sectors
  size:    913229824 sectors
  mode:    read/write
Using the liveDVD during testing I tried to mount the encrypted partition, wich worked fine. After installation I followed my usual rutine for mounting the home partition during boot, that is insert the correct lines in /etc/crypttab and /etc/fstab.But i never got asked for the passphrase on boot. I get a message that /home could not be mounted and press S or M

Code: Select all

#/etc/cryptab
home   /dev/sda3    none    luks

#/etc/fstab
/dev/mapper/home    /home    ext4    defaults    1    2
I tried to configure the system to do the same with Maya, but it doesn create the /dev/mapper/home. In the /etc/cryptab and /etc/fstab I've tried using the UUID for the disks and doesn't work either

I can mount manually once booted the OS

Using various how-tos that I found i already tried to load the correct modules in the initrd, and also added special options to the kernel, but none of those work. This is mostly what I'm based
Kernel options and initrd conf:
https://help.ubuntu.com/community/Encry ... n.22_amd64

replacing:

Code: Select all

CRYPTROOT=target=home,source=/dev/sda3
in the example, also tried grub tweak but nothing works.

This example uses LVM, but I'm not using LVM just plain old ext4 partition.

I'm currently booting my system, login as root, luksOpen and mount the partition, then login as user.. The OS itself is working perfectly so far, I just can get it to luksOpen on boot

Re: Encrypted /home not mounted on boot

Posted: Wed Jun 13, 2012 6:53 am
by oobetimer
How about if you make a /etc/rc.local script?

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

mount /dev/sda3 /dev/mapper/home
exit 0

Re: Encrypted /home not mounted on boot

Posted: Wed Jun 13, 2012 8:13 am
by rodolfoarce
I will try that.. But I see some problems before we start, I'll let you know when i test it.

1. The /dev/mapper/home device only shows up AFTER the encryption passphrase is inserted. If I place the "unencrypt" command in rc.local also, my guess is that it wont show me because of the splash image when booting, I'll also try without the splash just to check.

2. I could place a file with the pasphrases in order for the rc.local to "unencrypt" automagically, to see if the rc.local can actuaylly perfom this action, I didn't test that before, but that would defy the porpuse of the device being encrypted.

Thanks a lot for your reply.. I'll let you know when I test