LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 01-29-2013, 07:05 AM   #1
lp rob1
LQ Newbie
 
Registered: Jul 2009
Posts: 13

Rep: Reputation: 0
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:
Code:
<volume options="size=100m,uid=%(USERUID),gid=%(USERGID),mode=0700" mountpoint="~" uid="1000-50000" fstype="tmpfs" />
The mounting part works - the user gets their home area with correct permissions and correct size for them to use. The problem is with unmounting on logout. The home area stays mounted after logout, and looking in auth.log pam_mount says that the device is busy, and thus it was unable to unmount. But the problems don't stop there - trying to unmount the area manually as root also fails due to the device being busy. I have checked with fuser and (at least with the best of my ability) using lsof, and no files are open within the home area. The only way I can get it to 'unmount' is to do a lazy unmount, but even that isn't a real unmount. Forcing unmount has no effect either.

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.

System specs:
(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:
Code:
mount -t tmpfs -o uid=1000,gid=1000,size=100m,mode=0700 none /home/user
(at this point I logged in as myself)
umount /home/user
Now that pam_mount has been ruled out, this thread is a general question of why does a home area mounted as tmpfs not allow itself to be unmounted again properly? Unfortunately I cannot find a way to change the title of this thread - perhaps a mod could do that?

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.

Last edited by colucix; 01-31-2013 at 05:58 AM. Reason: Two posts from the OP merged: thread sent back to Zero Reply List
 
Old 02-08-2013, 12:33 AM   #2
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware,CentOS & Linux Mint
Posts: 3,404
Blog Entries: 1

Rep: Reputation: Disabled
Hi:

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-
https://help.ubuntu.com/community/En...ivateDirectory

Quote:
I cannot find a way to change the title of this thread - perhaps a mod could do that?
Don't worry about that I'll do some re-search to help and if I can not I'll request a Moderators assistance.

Last edited by Ztcoracat; 02-08-2013 at 12:44 AM.
 
Old 02-08-2013, 12:59 AM   #3
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware,CentOS & Linux Mint
Posts: 3,404
Blog Entries: 1

Rep: Reputation: Disabled
Looking and searching on the web I found a few things that may help-


Here's How To unmount when the device is busy
http://ocaoimh.ie/2008/02/13/how-to-...evice-is-busy/
http://ubuntuforums.org/search.php?searchid=89102891

I know your not running Arch but this might help-
Encrypted $HOME - umount after logout and ssh access
https://bbs.archlinux.org/viewtopic.php?id=98227

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.
http://ubuntuforums.org/archive/inde...t-1694953.html

Maybe it's a encryption/decryption issue to be able to mount and 'unmount'

http://askubuntu.com/questions/19288...gin-and-logoff
 
Old 02-09-2013, 06:19 AM   #4
lp rob1
LQ Newbie
 
Registered: Jul 2009
Posts: 13

Original Poster
Rep: Reputation: 0
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?
 
Old 02-09-2013, 12:23 PM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 2,330

Rep: Reputation: 593Reputation: 593Reputation: 593Reputation: 593Reputation: 593Reputation: 593
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.

Last edited by jpollard; 02-09-2013 at 12:26 PM.
 
Old 02-09-2013, 12:51 PM   #6
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware,CentOS & Linux Mint
Posts: 3,404
Blog Entries: 1

Rep: Reputation: Disabled
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
 
Old 02-09-2013, 01:14 PM   #7
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware,CentOS & Linux Mint
Posts: 3,404
Blog Entries: 1

Rep: Reputation: Disabled
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.

http://h30097.www3.hp.com/docs/iass/...8/0044____.HTM

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.
https://bugs.launchpad.net/ubuntu/+s...ba/+bug/667269

What one member at Ubuntu tried and Solved his issue with Windbind and the log
http://ubuntuforums.org/showthread.php?t=1645039

Hope this helps
 
Old 02-10-2013, 02:43 AM   #8
lp rob1
LQ Newbie
 
Registered: Jul 2009
Posts: 13

Original Poster
Rep: Reputation: 0
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.
 
Old 02-11-2013, 03:07 PM   #9
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware,CentOS & Linux Mint
Posts: 3,404
Blog Entries: 1

Rep: Reputation: Disabled
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? ?
 
Old 02-12-2013, 11:50 AM   #10
lp rob1
LQ Newbie
 
Registered: Jul 2009
Posts: 13

Original Poster
Rep: Reputation: 0
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
Code:
mount -t tmpfs -o size=100m,uid=[testuser-uid],gid=[testuser-gid],mode=0700 none /home/testuser
Logout as root, and log in as testuser.
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.
 
Old 02-13-2013, 03:15 PM   #11
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware,CentOS & Linux Mint
Posts: 3,404
Blog Entries: 1

Rep: Reputation: Disabled
lp rob1:

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-
 
1 members found this post helpful.
Old 02-14-2013, 11:30 AM   #12
lp rob1
LQ Newbie
 
Registered: Jul 2009
Posts: 13

Original Poster
Rep: Reputation: 0
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.
 
Old 02-14-2013, 02:52 PM   #13
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware,CentOS & Linux Mint
Posts: 3,404
Blog Entries: 1

Rep: Reputation: Disabled
Your Welcome lp rob1!

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-
 
Old 02-21-2013, 06:08 PM   #14
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware,CentOS & Linux Mint
Posts: 3,404
Blog Entries: 1

Rep: Reputation: Disabled
Nothing yet- sorry
115 folks have viewed the thread I made on your behalf but no reply yet-
 
Old 03-11-2013, 11:28 PM   #15
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware,CentOS & Linux Mint
Posts: 3,404
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by Ztcoracat View Post
Nothing yet- sorry
115 folks have viewed the thread I made on your behalf but no reply yet-
3-4 weeks later; 150 members have view the thread.

Still not response. Not sure why-

Past experience with the folks @Ubuntu sometimes it takes a while-
 
1 members found this post helpful.
  


Reply

Tags
mount, pam, tmpfs


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/fstab "tmpfs /tmp tmpfs defaults 0 0" ramfs?! HOW? xcislav Linux - General 2 06-04-2011 04:03 AM
Why filesystem cannot unmount when it clearly show that it has been mounted? redhatwannabe Linux - Newbie 3 06-18-2010 10:21 PM
? unmount LogVol to make filesystem blesbok Linux - Newbie 6 05-16-2008 05:51 AM
Cannot unmount NFS if filesystem. jizlobber Red Hat 2 04-19-2006 12:07 PM
Can't upgrade because I can't unmount filesystem colpaarm Linux - Software 6 07-26-2003 05:53 AM


All times are GMT -5. The time now is 09:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration