I have a two drive system, with my main user's home directory stored on a luks encrypted partition taking up the entirety of one of the drives. This partition is mounted automatically on login of that user via pam-mount. Everything works so far, but when I log out, the partition is not unmounted, and is still readable by root. This happens whether the login is via an X greeter, or on the console. Logging in creates two entries listed by 'mount', /dev/mapper/_dev_sdb1 on /home/sirlark type ext4 (rw,helper=crypt) /dev/sdb1 on /home/sirlark type crypt (rw,helper=crypt) After logging out, only the first entry remains, but attempting to unmount that remaining entry yields the following root@volundr ~ # mount ... /dev/mapper/_dev_sdb1 on /home/sirlark type ext4 (rw,helper=crypt) ... root@volundr ~ # lsof | grep /home/sirlark root@volundr ~ # ps aux | grep sirlark root@volundr ~ # umount /home/sirlark No vfsmount found while searching for "/home/sirlark" as a container file, or as a mountpoint. (According to the intersection of cmtab (/run/cmtab) with smtabs) root@volundr ~ # cryptsetup close _dev_sdb1 device-mapper: remove ioctl on _dev_sdb1 failed: Device or resource busy <repeats numerous times> Device _dev_sdb1 is still in use. root@volundr ~ # Note, there are no processes belonging to the user still running, nor any files open on the partition. I have noted that when the user is logged in, /run/cmtab remains empty, so as a guess I think the problem is that pam-mount is somehow preventing it from being populated.
Are you sure there are no open files or directories? Sometimes symlinks may be used. How have you checked that there are no open files? Please use both fuser and lsof -n. Don't forget that non-user processes may use that partition too. I have a very similar setup and with some cleanup at umount it works fine. And please provide `emerge --info` output and versions of cryptsetup and pam_mount.
User unresponsive and likely a problem with stale open files.