Operating System - HP-UX
1834169 Members
2152 Online
110064 Solutions
New Discussion

Re: Unmounting filesystem

 
Leon Smith, Jr
Advisor

Unmounting filesystem

Why would a filesystem not umount when it appears that no processes are using it?
9 REPLIES 9
Biswajit Tripathy
Honored Contributor

Re: Unmounting filesystem

Does it print any error message when you are try
to unmount it?

- Biswajit
:-)
harry d brown jr
Honored Contributor

Re: Unmounting filesystem



Using "lsof" (http://hpux.ee.ualberta.ca/hppd/hpux/Sysadmin/lsof-4.74/) find out who has a file open,

OR

who is "cd'd" into the mount path!!!

lsof /mountpath

live free or die
harry d brown jr
Live Free or Die
Rick Garland
Honored Contributor

Re: Unmounting filesystem

Using the 'fuser' command you can see if any processes are using the filesystem.

fuser -c /

If there are processes using the filesystem it is busy and will not umount
A. Clay Stephenson
Acclaimed Contributor

Re: Unmounting filesystem

Because almost certainly at least one process is or the current working directory of some process is in the filesystem. I assume you are getting the "device busy" error. Lsof (list open files) is a much better tool than fuser at find these files.
If it ain't broke, I can fix that.
Biswajit Tripathy
Honored Contributor

Re: Unmounting filesystem

Note that, even if no process appears to be using
a filesystem, "umount" would still report "device busy"
if there is atleast one open shell whose current working
directory is a directory in the mounted filesystem.

- Biswajit
:-)
David de Beer
Valued Contributor

Re: Unmounting filesystem

Sometimes using the following doesn't give you the desired result:

fuser /mount/point

And you need to use:

fuser /dev/vg_name/volume_name

And for Oracle raw volumes:

fuser /dev/vg_name/rvolume_name

Regards,
David de Beer.
jpcast_real
Regular Advisor

Re: Unmounting filesystem


ls -aFR $1 | grep \/ | grep : | cut -d : -f 1 > /tmp/dir

Whith this little script you can kill all the processes which are accesing to a path or to any file below this path . It takes some time but it works.

more /tmp/dir | while read linea
do
fuser -ku $linea
ls -aF $linea | grep -v / > /tmp/file
more /tmp/file | while read archivo
do
fuser -ku ${linea}/${archivo}
if (( $?== 0 ))
then echo ${linea}/${archivo} "was busy" > /tmp/kk
fi
done
rm /tmp/file
done
rm /tmp/dir
Here rests one who was not what he wanted and didn't want what he was
YOGI_3
Frequent Advisor

Re: Unmounting filesystem

check for ur pwd...
if ur in the same dir it will show u device is busy n cannt unmount
There is never a wrong time to do the right things
Geoff Wild
Honored Contributor

Re: Unmounting filesystem

Do a:

fuser -cu /mountpoint

That will show you if any pids are tied to it...

Another thing to check - is it nfs exported? or an automount?

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.