Showing results for 
Search instead for 
Did you mean: 

unmounting /tmp

Go to solution
Super Advisor

unmounting /tmp

Hi Admins,

I was trying to unmount /tmp online.But ended up with below error.

umount /tmp
umount: cannot unmount /tmp : Device busy
umount: return error 1.
test:/>fuser -cu /tmp

But fuser shows no process using /tmp.

Can i unmount /home online..

Please suggest.

Note : this is just testing purpose..

Pete Randall
Outstanding Contributor

Re: unmounting /tmp

Quite often someone has the target filesystem as their PWD - they've cd'ed into it. It won't show up with fuser, but it still causes the device to be busy. You might be able to unmount /home, especially if you can force all the users off the system first. Chances are that you will still find it busy, though. That is why the usual approach is to reboot into single user mode, where only / is mounted. You can then proceed to mount /usr and any other filesystems that you need to do what ever it is you need.


Steven E. Protter
Exalted Contributor

Re: unmounting /tmp


logon ssh, console is better

cd /
fuser -cuk /tmp

DO NOT do this on a live, running system. All services need to be down to try this trick.

Steven E Protter
Owner of ISN Corporation
Ismail Azad
Esteemed Contributor

Re: unmounting /tmp

Hi himacs,

Strangely if you have configured "file system swap" on the /tmp filesystem , then you would not be able to unmount /tmp or any filsystem until you "unconfigure" that space whether it's with swapoff or a deletion from fstab and a reboot.

However, as pete mentioned fuser is unable to find a user that returns $PWD as /tmp and logically speaking if you tried to unmount a filesystem a user was currently accessing {which is not_possible} , at which point of the file system hierarchy would the user be in now?. I hope you get the point.

Ismail Azad
Read, read and read... Then read again until you read "between the lines".....

Re: unmounting /tmp

>fuser shows no process using /tmp.

Have you tried lsof?