Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 544924 - Cannot unmount luks encrypted partition mounted via pam-mount
Summary: Cannot unmount luks encrypted partition mounted via pam-mount
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: Hanno Böck
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-29 12:26 UTC by James Dominy
Modified: 2020-09-09 14:11 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Dominy 2015-03-29 12:26:44 UTC
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.
Comment 1 Andrew Savchenko gentoo-dev 2015-04-02 11:17:41 UTC
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.
Comment 2 Hanno Böck gentoo-dev 2020-09-09 14:11:50 UTC
User unresponsive and likely a problem with stale open files.