Operating System - HP-UX
1827629 Members
3467 Online
109966 Solutions
New Discussion

Why can't I unmount /tmp ?

 
SOLVED
Go to solution
Jerry_109
Super Advisor

Why can't I unmount /tmp ?

Hello All,

Why can't we unmount fdhp31:/tmp ?

##################################
root@fdhp31[/root]
HP-UX fdhp31 B.11.23 U 9000/800/A500-7X
##################################
root@fdhp31[/root]
# bdf /tmp
Filesystem kbytes used avail %used Mounted on
/dev/vg00/tmp 2048000 32936 1999392 2% /tmp

root@fdhp31[/root]
# grep tmp /etc/fstab
/dev/vg00/tmp /tmp vxfs delaylog 0 2

##################################
root@fdhp31[/root]
# cat /etc/mnttab
/dev/vg00/root / vxfs ioerror=mwdisable,delaylog,dev=40000003 0 1 1199742090
/dev/vg00/stand /stand hfs defaults,dev=40000001 0 0 1199742093
/dev/vg00/usr /usr vxfs ioerror=mwdisable,delaylog,dev=40000007 0 0 1199742805
/dev/vg00/opt /opt vxfs ioerror=mwdisable,delaylog,dev=40000005 0 0 1199743217
/dev/vg00/home /home vxfs ioerror=mwdisable,delaylog,dev=40000004 0 0 1199743258
/dev/vg00/tmp /tmp vxfs ioerror=mwdisable,delaylog,dev=40000006 0 0 1199743287
/dev/vg00/var /var vxfs ioerror=mwdisable,delaylog,dev=40000008 0 0 1199743332
-hosts /net autofs ignore,indirect,nosuid,soft,nobrowse,dev=60000000 0 0 1199743522
##################################

root@fdhp31[/]
# fuser -u /dev/vg00/tmp
/dev/vg00/tmp:

root@fdhp31[/]
# umount /tmp
umount: cannot unmount /tmp : Device busy
umount: return error 1.
8 REPLIES 8
Geoff Wild
Honored Contributor
Solution

Re: Why can't I unmount /tmp ?

Your answer is in the error:

umount: cannot unmount /tmp : Device busy


fuser -cu /tmp


/tmp is used by the OS...

Why do you need to un mount it?

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Jerry_109
Super Advisor

Re: Why can't I unmount /tmp ?


A co-worker was testing the umount command on a test system. I have successfully unmounted /tmp before. Just want to understand why ? I'll see if I can install lsof to gather more info ( maybe a socket ? )
Thanks.
##################################
root@fdhp31[/]
# fuser -cu /tmp
/tmp:

root@fdhp31[/]
# umount /tmp
umount: cannot unmount /tmp : Device busy
umount: return error 1.
Mridul Shrivastava
Honored Contributor

Re: Why can't I unmount /tmp ?

fuser o/p clearly shows that it is being used by root hence we can not unmount a filesystem which is still in use. This is the reason we are getting error device busy
Time has a wonderful way of weeding out the trivial
Geoff Wild
Honored Contributor

Re: Why can't I unmount /tmp ?

Well - if fuser -cu returns nothing, then it more then likely means a process was probably killed with -9, and a file in /tmp is still considered open....

That probably won't clear up until after a reboot.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Jerry_109
Super Advisor

Re: Why can't I unmount /tmp ?

Here's where it worked just now on another system:


root@hohp201[/root]
# bdf /tmp
Filesystem kbytes used avail %used Mounted on
/dev/vg00/tmp 2228224 4208 2207544 0% /tmp
root@hohp201[/root]
# fuser -u /dev/vg00/tmp
/dev/vg00/tmp: 2684o(root) 2671o(root) 2702o(root) 2693o(root) 4416c(root) 4415c(root) 4413c(root) 4417c(root) 4422c(root)

root@hohp201[/root]
# fuser -ku /dev/vg00/tmp
/dev/vg00/tmp: 2684o(root) 2671o(root) 2702o(root) 2693o(root) 4416c(root) 4415c(root) 4413c(root) 4417c(root) 4422c(root)

root@hohp201[/root]
# fuser -u /dev/vg00/tmp
/dev/vg00/tmp:

root@hohp201[/root]
# umount /tmp
root@hohp201[/root]
# bdf /tmp
Filesystem kbytes used avail %used Mounted on
/dev/vg00/root 212992 146536 66056 69% /
root@hohp201[/root]
# mount /dev/vg00/tmp /tmp
root@hohp201[/root]
# bdf /tmp
Filesystem kbytes used avail %used Mounted on
/dev/vg00/tmp 2228224 4208 2207544 0% /tmp
root@hohp201[/root]

Sandman!
Honored Contributor

Re: Why can't I unmount /tmp ?

Well then try sending SIGKILL through fuser to all the processes that maybe using /tmp and if that does not fix it then a reboot is the only way to go.

# fuser -cuk /tmp
Bill Hassell
Honored Contributor

Re: Why can't I unmount /tmp ?

Unfortunately, fuser is only 50% complete in reporting processes that have a file or directory open. The most common problem is that someone has cd'ed into the /tmp directory structure and fuser can't find the user process. That's why you must download lsof as it will always find all the processes that could be blocking an unmount.


Bill Hassell, sysadmin
Leonid Mishkind
Frequent Advisor

Re: Why can't I unmount /tmp ?

Hi. You can use the lsof utility to see open files in you system .
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.78/

Very useful.

Leonid.