1

Before the reinstall, I already had Ubuntu 16.04 installed and set up with an encrypted home partition. Now, I tried to reinstall and configure it so that basically the same setup is used again: For sda6 I selected ‘use as ext4 file system’, checked the box for formatting the partition and selected having it mounted at /; for sda5 (which contains the old encrypted home directory) I selected ‘use as ext4 file system’ as well [1], did not check the box for formatting it and selected having it mounted at /home. This seemed to have worked out well, but when I boot now, I am not prompted for the passphrase for the home partition like I used to and the syslog shows these suspicious lines:

Jan 02 18:22:31 HOSTNAME systemd[1]: dev-mapper-luks\xUUID.device: Job dev-mapper-luks\xUUID.device/start timed out.
Jan 02 18:22:31 HOSTNAME systemd[1]: Timed out waiting for device dev-mapper-luks\xUUID.device.
Jan 02 18:22:31 HOSTNAME systemd[1]: Dependency failed for File System Check on /dev/mapper/luks-95a5b792-d8c6-400b-9253-c998bb7b2141.
Jan 02 18:22:31 HOSTNAME systemd[1]: Dependency failed for /home.
Jan 02 18:22:31 HOSTNAME systemd[1]: Dependency failed for Local File Systems.
Jan 02 18:22:31 HOSTNAME systemd[1]: Dependency failed for Clean up any mess left by 0dns-up.
Jan 02 18:22:31 HOSTNAME systemd[1]: dns-clean.service: Job dns-clean.service/start failed with result 'dependency'.
Jan 02 18:22:31 HOSTNAME systemd[1]: local-fs.target: Job local-fs.target/start failed with result 'dependency'.
Jan 02 18:22:31 HOSTNAME systemd[1]: local-fs.target: Triggering OnFailure= dependencies.
Jan 02 18:22:31 HOSTNAME systemd[1]: home.mount: Job home.mount/start failed with result 'dependency'.
Jan 02 18:22:31 HOSTNAME systemd[1]: systemd-fsck@dev-mapper-luks\xUUID.service: Job systemd-fsck@dev-mapper-luks\xUUID.service/start failed with result 'dependency'.
Jan 02 18:22:31 HOSTNAME systemd[1]: dev-mapper-luks\xUUID.device: Job dev-mapper-luks\xUUID.device/start failed with result 'timeout'.

where obviously HOSTNAME and UUID stand for the actual hostname and UUID.

How can this problem be resolved?

[1] If one selects ‘file system for encryption’, it is always formatted.

  • Make sure your /etc/fstab and /etc/crypttab are configured properly. – jdwolf Jan 6 '18 at 18:23
  • @jdwolf OK – unfortunately I’m not at all familiar with working on these. From just looking at them it seems that /etc/crypttab doesn’t contain an entry for the /home partition, only one for cryptswap1. – sincero Jan 7 '18 at 11:37
  • Thats your problem then. Ultimately it should be saved there. Although you can use your prefered graphical tool. – jdwolf Jan 8 '18 at 1:52
  • What should be saved where? – sincero Jan 8 '18 at 12:30
  • I have found this instruction, which seems helpful in general but doesn’t apply to my use case, since (1) my machine uses BIOS, not EFI, and (2) I already have the encrypted partition set up. Is there a reliable instruction or tool to just insert the missing pieces in /etc/crypttab? – sincero Jan 8 '18 at 12:39
2

crypttab format is very simple. its just newdevice rawdevice password [options] Systemd is already detecting your device but when "none" is used as your password in crypttab the default behavior is to ask each time the device is mounted.

So add this to your crypttab:

echo "home UUID=<UUID of Luks partition> none" >> /etc/crypttab

You will also need to mount the device for it to ask so you need to add it to your fstab as well as /dev/mapper/home

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.