1837246 Members
4940 Online
110115 Solutions
New Discussion

umount /home

 
SOLVED
Go to solution
Scott Frye_1
Super Advisor

umount /home

Do I need to be in single user mode to umount /home?
11 REPLIES 11
Mark Grant
Honored Contributor
Solution

Re: umount /home

No but it might be easier.

Basially, you need to stop all processes that might be using /home before you can unmount it. If you can get all the users off that use it and stop all the applications that might use it too then there is no need ot go to single user. "fuser -cu /home" will list all the PID's that are using /home.
Never preceed any demonstration with anything more predictive than "watch this"
Mel Burslan
Honored Contributor

Re: umount /home

no you do not have to but if any user is logged in, it will show up as being used and will look busy for umount requests.

also, if there is any ill prepared application which sets its home directory to something like /homm/appl and launches at the startup, may have the same effect.

other than that it is not mandatory to be in single user mode to unmount it.

HTH
________________________________
UNIX because I majored in cryptology...
Scott Frye_1
Super Advisor

Re: umount /home

Thanks to both. I didn't think so, but... when we tried to do a lvextend, it said /home was busy. We didn't know the command to see what was running in home, this will help.
A. Clay Stephenson
Acclaimed Contributor

Re: umount /home

Not necessarily but probably. If you have lsof installed, do an lsof /home and see it is in use.

Chances are that at least some users are cd'ed to their home directories; if you can safely kill these processes then you can umount.
If it ain't broke, I can fix that.
V. Nyga
Honored Contributor

Re: umount /home

Hi Scott,

you can check with 'bdf' if /home is a separate filesystem 'Mounted on: /home'

Then you could umount it as mentioned above, if not you have to go to single user mode.

Regards
Volkmar
*** Say 'Thanks' with Kudos ***
Mark Grant
Honored Contributor

Re: umount /home

"lvextend" should not care if anyone is using the filesystem or not! Are you sure it was the "lvextend" command that said this?
Never preceed any demonstration with anything more predictive than "watch this"
Scott Frye_1
Super Advisor

Re: umount /home

Sorry, you are correct. We didn't even get to that point. It was the umount command that told us it was busy.
Scott J. Showalter
Frequent Advisor

Re: umount /home

Mark,

That depends on what type of filesystem it is. If it is vxfs, you would also need to have the seperate product called "online jfs" in order to extend the filesystem without unmounting it.
In a world without fences, who needs Gates?
Mark Grant
Honored Contributor

Re: umount /home

Scott number 2,

Actually, it doesn't matter what the filesystem type is to do the "lvextend". "lvextend" doesn't know anything about filesystems at all and will happily extend the logical volume, online, even if you don't have OnlineJFS. This is great if you use raw devices or like having useless space at the end of your filesystem :)

However, you are correct in saying that if you want to extend the filesystem on top of the logical volume then you would indeed need to have OnlineJFS to do it online.
Never preceed any demonstration with anything more predictive than "watch this"
Bill Hassell
Honored Contributor

Re: umount /home

The command to see processes that are using /home is:

fuser /home

However, fuser does not check several other possibilities such as a user that cd'ed into /home/whatever so fuser will not report any process IDs for this situation. lsof is the only toll that can do this. Note that you can always tell all the users to log off and stop all database processes or other applications at which point /home should be free. umount will tell you if it is ready. Once un-mounted, use lvextend followed by extendfs and then re-mount /home.

Given that all the users and most of the applications may need to be shutoff, it may be easier to do this in single user mode.


Bill Hassell, sysadmin
Dani Seely
Valued Contributor

Re: umount /home

Hey Scott,
To answer your question, as you have probably gathered already: No, you don't have to be in single user mode to umount /home.

To perform something like lvextend and extendfs, you are performing more than just general maintenance on the system and you can get hosed pretty easily or your users can be left in a state of confusion if the mountpoint becomes unavailable. Safest suggestion is to drop to single-user mode, sending message to the user that maintenace is being done and system will be back on-line shortly, perform your lvextend and extendfs, then boot back up. This should provide you a better sense of success, rather than just crossing your fingers. Also, should anything happen during the extension of the filesystem(s) you can run a manual fsck or other additional maintenance immediately rather than trying to determine who/what is affecting your filesystem.

Good luck! I'd prefer a few minutes of planned down time for safety precautions for something like this rather than a few hours of unplanned work stoppage while praying my backups are good.
Together We Stand!