LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-23-2014, 09:32 AM   #1
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Rep: Reputation: 49
How to determine why I can't unmount a volume


I have a volume that I thought was only used for some samba shares. All those shares are commented out in smb.conf and samba was restarted, but a umount of that volume tells me the "device is busy" still.

How can I tell what is still using a particular volume?
 
Old 07-23-2014, 09:55 AM   #2
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 55
Are there any users who's current location is on the mounted volume?
 
1 members found this post helpful.
Old 07-23-2014, 10:40 AM   #3
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
just looked in passwd, there are! It's for a couple "service accounts" we have. Guess I need to change those then and see if I can umount then?
 
Old 07-23-2014, 10:48 AM   #4
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
OK, just changed their home directories, but I still can't umount. Any other tips on where to check now?
 
Old 07-23-2014, 10:58 AM   #5
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Use lsof to find what is using it:

Code:
lsof | grep sda(or your volume name)
 
1 members found this post helpful.
Old 07-23-2014, 11:01 AM   #6
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
Very cool. When I do a lsof | grep VolumeIWantToUnmount, all I get is this though

bash 15602 MyUserName cwd DIR 8,17 4096 2 /VolumeIWantToUnmount
su 15630 root cwd DIR 8,17 4096 2 /VolumeIWantToUnmount
 
Old 07-23-2014, 11:09 AM   #7
grim76
Member
 
Registered: Jun 2007
Distribution: Debian, SLES, Ubuntu
Posts: 308

Rep: Reputation: 50
Looks like you are in the directory that you are trying to unmount. You will want to make sure that you are not in that location as well.
 
1 members found this post helpful.
Old 07-23-2014, 11:22 AM   #8
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
I even just changed to my home directory, which isn't even on the same array as the one I want to unmount, but it's still giving me the same message, and lsof shows the same output.

I even did a who, there's nobody else logged in to the server but me.
 
Old 07-23-2014, 11:24 AM   #9
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Looks like you have used su to become root. Were you on the volume in your pre-su user shell?

Tell you what.
  1. Log out. Completely.
  2. Log back in.
  3. Change to the root directory /
  4. Su to root
  5. Change to the root directory /
  6. Unmount your volume
 
1 members found this post helpful.
Old 07-23-2014, 11:34 AM   #10
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
That's it. and now i'm embarrassed haha. so was it that all along, or was it a combo of that and those users home directories being set to a folder on it? I'm guessing the former
 
Old 07-23-2014, 11:57 AM   #11
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 55
It's cause you were in the mounted volume. That's what I was alluding to in my post, sorry for the confusion.
 
1 members found this post helpful.
Old 07-23-2014, 12:01 PM   #12
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
Looking back, I totally misread your other post. Sorry about that. All is well now, I can mount/umount til the cows come home.

Thanks everybody. Going back to being embarrassed now haha.
 
Old 07-23-2014, 01:30 PM   #13
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by rjo98 View Post
Looking back, I totally misread your other post. Sorry about that. All is well now, I can mount/umount til the cows come home.

Thanks everybody. Going back to being embarrassed now haha.
No need to be.
Code:
lsof +D /path/to/directory
can show you what's "open" in that directory also.
 
1 members found this post helpful.
Old 07-23-2014, 02:38 PM   #14
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
That's cool. There's so many little commands and options like that you never know exist, until someone points them out.
 
Old 07-23-2014, 04:02 PM   #15
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
You can also use the fuser command to look at mount points - it will list all processes that have something open, and tell you how it is being used - each pid is followed by a series of key letters indicating its use:
Code:
              c      current directory.
              e      executable being run.
              f      open file. f is omitted in default display mode.
              F      open file for writing. F is omitted  in  default  display
                     mode.
              r      root directory.
              m      mmap'ed file or shared library.
If no letter is showing, then the process has a file open.
 
2 members found this post helpful.
  


Reply



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
[SOLVED] "unmount volume" or "eject volume" to safely remove a flash drive? Gregg Bell Linux - Newbie 15 04-30-2014 03:02 PM
[SOLVED] How to determine number of blocks of a logical volume Iyyappan Linux - Server 7 04-27-2012 12:58 AM
Missing unmount and unmount.cifs johnmccarthy Linux - Newbie 3 11-19-2011 07:01 AM
determine traffic volume per PC rogerdv Linux - Software 1 05-09-2008 04:54 PM
command 'unmount' not found - how can i unmount??? GloVe Linux - General 1 10-04-2003 06:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:09 AM.

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
Open Source Consulting | Domain Registration