You are not logged in.

#1 2012-12-03 03:36:03

sseagull
Member
From: New York
Registered: 2012-12-03
Posts: 2

dm-crypt + LUKS with home directory issues (console and KDE)

Hello. Long-time Arch user, first-time poster. I usually manage to solve most issues, but this one is annoying.

I am encrypting my home directory (/home/user, not all of /home) using dm-crypt + LUKS following the instructions on the wiki and elsewhere to configure pam_mount. It is mostly ok, but two issues have popped up:

1.) When logging in through a console, the encrypted partition will only mount every other login. The first time, I see these messages (this is taken from journalctl, but it also displays on the console):

(mount.c:68): Messages from underlying mount program:
(mount.c:72): NOTE: mount.crypt does not support utab (systems with no mtab or read-only mtab) yet. This means that you will temporarily need to call umount.crypt(8) rather than umount(8) to get crypto volumes unmounted.

The home directory is mounted successfully, however. The second time, it says the same thing, as well as

(mount.c:72): crypt_activate_by_passphrase: File exists
(pam_mount.c:522): mount of /dev/disk/by-uuid/XXXXXXXXXXX failed

This second time, the encrypted volume will not mount. I have made sure the volume is indeed unmounted after the first logout.


2.) When using KDE (with KDM), the encrypted volume will not unmount when logging out, stating that it is in use. This is somewhat bothersome, as the computer will shut down with a mounted partition. This is more likely a problem with KDE leaving something open long enough to stop the automatic unmounting. After the logout, I can switch to a root console and unmount it manually, but that is a pain.

I'll note that the system is 100% up to date. So does anyone have dm-crypt + LUKS experience with these issues? I've seen some mentions of this around (https://bbs.archlinux.org/viewtopic.php?pid=1107386 and https://bugzilla.redhat.com/show_bug.cgi?id=599609) but any ideas?

Thanks
Ben

Offline

#2 2012-12-03 21:13:39

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: dm-crypt + LUKS with home directory issues (console and KDE)

For your issue 2) There is a "shutdown" mkinitcpio hook. Decription here: https://wiki.archlinux.org/index.php/Mk … time_Hooks
Maybe that ensures it is unmounted cleanly.

Offline

#3 2012-12-08 20:07:19

sseagull
Member
From: New York
Registered: 2012-12-03
Posts: 2

Re: dm-crypt + LUKS with home directory issues (console and KDE)

Thanks for the tip. With the shutdown hook, I was able to see what was happening right before poweroff. The home directory was umounted, but the encrypted volume wasn't closed.

I finally got some time to dig today, and was able to fix problem 1. The issue is that I had fstype="auto" in the pam_mount.conf.xml. This (I believe) caused pam_mount to call umount rather than umount.crypt. The solution was to put fstype="crypt" instead. This is probably a bug in pam_mount, since it should always call umount.crypt for crypt volumes, I would think.
After changing that, everything is unmounted and closed correctly.

As for problem 2, this is probably a bug in KDE. It seems to have happened in the past (see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=425314) but I guess is popping up again (seems to be akonadi stuff hanging around this time). A quick hack might be to put sleep time in startkde, but I'll hunt around the kde bug system.

Edit: The relevent bug report for the KDE problem seems to be https://bugs.kde.org/show_bug.cgi?id=244250

Last edited by sseagull (2012-12-08 20:50:58)

Offline

#4 2013-04-04 17:56:24

MrPrise
Member
Registered: 2010-03-23
Posts: 3

Re: dm-crypt + LUKS with home directory issues (console and KDE)

I have exactly the same problem that you wrote under #1 with a fresh Arch setup, but fstype="crypt" did not fix the problem for me.

Offline

Board footer

Powered by FluxBB