# LUKS encyrypted home partition not unmounted on logout

## sirlark

I followed this guide to set up an encrypted partition for my main user's home directory. I've also got encrypted swap. Everything works in so far as I login, provide a password, and can continue normally. But when I log out, and then log in as root on a text console my home partition is still mounted and readable

```

root@volundr ~ # mount

...

/dev/mapper/_dev_sdb1 on /home/sirlark type ext4 (rw,helper=crypt)

...

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 ~ # lsof | grep /home/sirlark

```

If I login to my normal user via a text console, and logout again, lsof tells me that some gnome-keyring files are still in use, but not if I login via lightdm

Any idea how I could track down what is blocking the unmount?

----------

## Massimo B.

I've seen that in the early days I started with LUKS some years ago but never seen recently.

Have you tried..

```
<logout wait="microseconds" hup="yes/no" term="yes/no" kill="yes/no" />
```

----------

## sirlark

Yeah, I've tried 500 microseconds, and yes on all. The issue seems to be that it can't find the mount point (even manually)

----------

## sirlark

These two links seem to be relevant

http://forums.debian.net/viewtopic.php?t=77599

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666891

I'm going to try playing with pam_mount.conf.xml to get it to make an additional call to cryptsetup LuksClose

----------

## sirlark

which doesn't work either  :Sad: 

----------

## Roman_Gruber

ever thought of using sync before unmounting?

----------

## b52_

Did you solve this issue anyhow?

Same problem here. If I su to this user in a shell and logout again, the home folder gets unmounted as expected. But after login and logout with lightdm the home folder stays mounted and I am even as root not able to umount it:

```
No vfsmount found while searching for "..." as a container file, or as a mountpoint. (According to the intersection of cmtab (/run/cmtab) with smtabs)
```

lsof says no open files for this user...

----------

