You are not logged in.
I'm trying to get an encrypted /home partition set-up working. I created a dmcrypt partition as per https://wiki.archlinux.org/index.php/Dm … ile_system , using:
cryptsetup -c aes-xts-plain -y -s 256 luksFormat /dev/sdb2After mounting this new partition, I then rsynced the files from my current /home partition
rsync -avHxz /home /mnt/tmphomeI then followed this guide https://wiki.archlinux.org/index.php/Dm … _boot_time for mounting the encrypted partition at boot time. I set up the /etc/crypttab file to mount by UUID as per the example, naming the device crypthome. I then edited by fstab to mount /dev/mapper/crypthome as /home.
However, when I boot with this setup, I can see a message about the entering a password to unlock the volume appear during boot, but the system never actually lets me enter the password (and then becomes unhappy as it can't mount home and drops me to entering root password to fix the system). When I revert my /etc/fstab to mounting the old unencrypted /home partition, and reboot, then I am actually able to enter the password to unlock the unencrypted partition. (But, of course, it's then my old unencrypted /home partition which ends up mounted as /home)
What am I doing wrong? And/or is there a better way to get an encrypted /home setup working?
Last edited by emacsomancer (2014-11-13 18:12:22)
Offline
However, when I boot with this setup, I can see a message about the entering a password to unlock the volume appear during boot, but the system never actually lets me enter the password (and then becomes unhappy as it can't mount home and drops me to entering root password to fix the system).
That you see the message is a good sign. On my system this message gets mixed up with other messages but still I can enter the password and after that the system boots. Maybe there is just no keyboard support on your system at that early stage? Make sure that "keyboard" is included in HOOKS in /etc/mkinitcpio.conf. If it isn't just add it and run "mkinitcpio -p linux" afterwards.
Offline
emacsomancer wrote:However, when I boot with this setup, I can see a message about the entering a password to unlock the volume appear during boot, but the system never actually lets me enter the password (and then becomes unhappy as it can't mount home and drops me to entering root password to fix the system).
That you see the message is a good sign. On my system this message gets mixed up with other messages but still I can enter the password and after that the system boots. Maybe there is just no keyboard support on your system at that early stage? Make sure that "keyboard" is included in HOOKS in /etc/mkinitcpio.conf. If it isn't just add it and run "mkinitcpio -p linux" afterwards.
There is indeed a keyboard hook in /etc/mkinitcpio.conf. I am able to type when I see the message (and it gets mixed up with other messages as you said), but it seems to ignore the fact that I entered the password and crashes. As I said, when I actually have /etc/fstab *not* set to mount the /dev/mapper/crypthome partition, then I am able to unlock the partition at boot time as expected (and when the system boots up, I can see that indeed /dev/mapper/crypthome has been unlocked ... but, of course, not mounted as /home ).
Offline
I am able to type when I see the message (and it gets mixed up with other messages as you said), but it seems to ignore the fact that I entered the password and crashes. As I said, when I actually have /etc/fstab *not* set to mount the /dev/mapper/crypthome partition, then I am able to unlock the partition at boot time as expected (and when the system boots up, I can see that indeed /dev/mapper/crypthome has been unlocked ... but, of course, not mounted as /home ).
Ah, sorry. I misread that. Could you try adding "x-systemd.device-timeout=0" to the options of your encrypted /home in your fstab? The only timeout the wiki pages are mentioning is in the crypttab file, so I assume you did not set that option already.
Offline
Ah, sorry. I misread that. Could you try adding "x-systemd.device-timeout=0" to the options of your encrypted /home in your fstab? The only timeout the wiki pages are mentioning is in the crypttab file, so I assume you did not set that option already.
Ok, so today I tried adding "x-systemd.device-timeout=0" to the options for my encrypted /home in fstab, but it didn't seem to make a difference. It still tries and fails to mount the encrypted /home before I ever have a chance to unlock the partition, and thus becomes unhappy and drops me into "root recovery mode". Is there a way to specify in the crypttab file that loading should pause until the partition is unlocked? That seems like it would be the ideal. Though the boot-up messages almost make me feel like the system looks at /etc/fstab before /etc/crypttab.
Offline
Is there a way to specify in the crypttab file that loading should pause until the partition is unlocked? That seems like it would be the ideal. Though the boot-up messages almost make me feel like the system looks at /etc/fstab before /etc/crypttab.
As far as I know this should be the case. Systemd should translate your crypttab and fstab into services with correct dependencies.
When you are being dropped into the recovery shell you might have a look at the files in /var/run/systemd/generator/. Despite of that I'm also out of ideas here :-/
Offline
Try to open the encrypted device manually, using your key file. If that fails, the problem is usually an additional linefeed at the end of the file. Remove it and you should be fine.
Knowing others is wisdom, knowing yourself is enlightenment. ~Lao Tse
Offline
Finally figured it out - a stupid mistake on my part - the mount specification in fstab had a typo.....
Offline