Problems trying to unmount a tmpfs filesystem
I am using pam_mount to mount user home areas as tmpfs on login, and to unmount the area on logout. The line in question in pam_mount.conf.xml is as follows:
My first thoughts were that tmpfs was somehow bugged, but this was disproven since adding another line to mount a tmpfs somewhere other than the home area works fine. I have tried using the logout kill option in the configuration to kill any processes that might still be running, but also to no avail. And now, at the end of my rope, I come here in the hopes of finding a possible solution.
(X)ubuntu 12.04, heavily customized XFCE desktop, LightDM with KDE greeter, fully updated until a few days ago. Running on an SSD, using open-source graphics drivers.
Alright, I did a bit more testing on this. I disabled the pam_mount tmpfs line, and mounted a tmpfs as my home area (all of this done while logged in as root). I then logged out of root, logged in as myself (everything working OK with regards to the desktop), then logged out again and back in as root. Attempting to umount the home area again gives a device is busy error. I tried deleting everything inside the home area and trying again - still no joy. Yet again, the only thing that can successfully unmount the tmpfs is a lazy unmount.
I used the following specific commands:
EDIT: I have narrowed it down further - logging in though a virtual terminal does not 'corrupt' the tmpfs, while logging in though an X session does. I uninstalled gvfs just in case it was the culprit (these kinds of things usually are) but it was not. Anything else to try, short of uninstalling all graphical apps?
EDIT2: The mystery deepens. Doing the same thing on my Arch Linux install (again with XFCE) the unmounting worked just fine. I am now struggling to understand what is causing these problems.
This is most perplexing and I'd like to re-search this to help you.
A few questions if you don't mind-
Is it possible that the KDE Greeter could be conflicting with the XFCE Desktop Environment?
By tmpfs do you mean temporary file?
Is the directory encrypted?
If so this might help-
Looking and searching on the web I found a few things that may help-
Here's How To unmount when the device is busy
I know your not running Arch but this might help-
Encrypted $HOME - umount after logout and ssh access
I realize that this article is How To keep the directory mounted but perhaps by learning how it's kept mounted we can be enlightened to the reversal of what you have going on.
Maybe it's a encryption/decryption issue to be able to mount and 'unmount'
Thanks for replying! I thought this thread might die into oblivion. To answer your questions:
The home area is not encrypted. I have tried using fuser and lsof to find open files, but still nothing. However, on a different Ubuntu install (still using XFCE, but the Unity greeter) the process works fine.
By tmpfs I mean a 'tmpfs' type volume that acts as a ramdisk. The idea would be that the user's home area would be on a ramdisk, thus be volatile and lose all changes on logout, but also fast due to it running off the memory.
Could the fact that I use Winbind authentication change anything?
Do a "fuser <mountpoint>" when it hangs. It will show you what processes still have it open.
In the past, I have found that some desktops (gnome3/cinnamon/kde) leave processes hanging around after logout. These would prevent you from dismounting.
Another thing - remember that some desktops also use fuse mounts within the users home directory. So a "mount" listing might show these hanging around as well, and that too would prevent a dismount.
Try what jpollard; has recommended and I'll investigate 'Windbind and it's Authentication'
Authentication Methods (there are more than one kind)
- The balanced password with key exchange
- The Augmented password; key exchange password authenticated key retrieval
- Multi Server Methods and the Multi Party Methods
Using Windbind shouldn't be a problem as it is part of the Samba 7 suite.
The only thing I found is that turning off user enumeration maycause some programs to behave oddly-
If you do suspect that Windbind could be causing conflict the Windbind log should provide you with some clarification. Read through the log and see if you find something odd.
Found a bug with Windbind and Ubuntu but it was in 2010
Occasionally on various Ubuntu 64-bit LucidLynx systems (10.04.1), winbind goes into a state such that logging in fails.
What one member at Ubuntu tried and Solved his issue with Windbind and the log
Hope this helps
I have already tried the fuser thing (and lsof) but to no avail. mount shows no FUSE filesystems mounted within the home area, and there are no processes running as me after logout. However, I will look into the Winbind links.
Hmm...to no avail with the 'fuser'
I'm baffled not sure what is going on-
Would you like me to write to the folks I know at Ubuntu and see what they think? ?
I will test once more on a slightly updated system, but it would be nice to know exactly what to try to find the problem - perhaps the Ubuntu guys could give some answer on that? For reference, the exact procedure is as follows:
Assume a user, 'testuser' can be authenticated through Winbind, which is connected to a Samba3 domain. This user has a home area defined as /home/testuser
Log in as root on the machine, and create /home/testuser, then run
Logout as testuser, log in as root.
Attempt to unmount /home/testuser - this fails for me with 'Device is busy'
An important thing to note is that logging in through the graphical interface causes the problem, while logging in only through a virtual terminal doesn't. As mentioned before fuser and lsof do not show anything using that directory. The machine had GVFS uninstalled, however even with it installed there was no change. Repeat of the specs: XFCE desktop, LightDM with KDE greeter, Ubuntu 12.04.
At the moment I have defaulted back to our previous method of simply clearing /home on boot, but getting tmpfs to work properly will be really cool, especially if it can be linked with pam_mount to give automatic mounting/unmounting of the home area on login/logout.
Good news; I posted a thread on your behalf; in the Ubuntu Forum-
- I explained the details and spec's about your system and they know now all of what you have tried-
I should hear from them in a few days but a 'heads-up' if they require me to provide them with your systems output of commands that need to be executed this could get complicated so I would need you to be prompt and answer as soon as your able to.
As soon as one of the Ubuntu Members or Forum Staff answer me I'll let you know what they have to say and what they think-
Thank you so much for this! Getting system information quickly may be an issue - I may be able to get a copy of the OS running at home on a virtual machine, but if I can't then it's weekdays only. Still - since this will ultimately benefit me I will try my best.
Your Welcome lp rob1!:hattip:
In that case just do what you can.
As soon as I hear from them I'll let you know in my next post what they want-
Nothing yet- sorry
115 folks have viewed the thread I made on your behalf but no reply yet-
Still not response. Not sure why-
Past experience with the folks @Ubuntu sometimes it takes a while-
|All times are GMT -5. The time now is 03:33 PM.|