Operating System - HP-UX
1748268 Members
3652 Online
108760 Solutions
New Discussion юеВ

Re: Forcing an unmount of a filesystem

 
Andrew Kaplan
Super Advisor

Forcing an unmount of a filesystem

Hi there --

One of our servers, running HP-UX 11, needs to have one of its filesystems unmounted and subsequently remounted to read-only status. The filesystem in question is on a non-vg00 volume grouop. The standard umount command does not work due to the filesystem, running VxFS, being busy.

Is there a way, other than temporarily stopping the NFS daemon, to force the unmounting of the filesystem?
A Journey In The Quest Of Knowledge
7 REPLIES 7
Juli├бn Aimar
Frequent Advisor

Re: Forcing an unmount of a filesystem

Hi, execute fuser and verify if exists process running,

fuser -cu

example

fuser -cu /backup

Saludos


JEA
James R. Ferguson
Acclaimed Contributor

Re: Forcing an unmount of a filesystem

Hi Andrew:

To do what you want, I don't think that you have any choice but to quiesce the filesystem; unmount it; and mount it read-only.

To unmount it, of course, you could use 'fuser' to kill any processes using the filesystem.

Regards!

...JRF...
Suraj K Sankari
Honored Contributor

Re: Forcing an unmount of a filesystem

Hi,
1st check who is using this file system.
with the below command
#fuser -cu /FSname

for forcefully kill you need to give the command
#fuser -ku

Suraj
Matti_Kurkela
Honored Contributor

Re: Forcing an unmount of a filesystem

If this filesystem or parts of it is exported with NFS, then unexport it before attempting to unmount it (exportfs -u /export/point).

Stopping the NFS daemon would be overkill. It would prevent access to all NFS exported directory trees, rather than just this one.

NFS service works in kernel, so it does not show in the "fuser" listing. Nevertheless, it can keep a filesystem busy.

If you're unsure about which directories of this filesystem have been exported, use "showmount -e" to identify the exported directories.

If the change is permanent, edit /etc/exports to reflect the new state. If the filesystem is mounted read-only, the export should be read-only to all NFS clients too. Trying to export a read-only filesystem in read-write mode is a recipe for unnecessary error messages, either at next system reboot, or when someone actually attempts to write to the exported directory.

MK
MK
Dennis Handly
Acclaimed Contributor

Re: Forcing an unmount of a filesystem

>running HP-UX 11,

You need to be more specific which 11.XX OS version. (From previous threads you mention 11.00.)
I'm not sure if the unsupported 11.00 has the -o remount option that allows you to change the mount options. But as MK says, you should fix the exports/exportfs first.
James R. Ferguson
Acclaimed Contributor

Re: Forcing an unmount of a filesystem

Hi (again):

> Dennis: I'm not sure if the unsupported 11.00 has the -o remount option that allows you to change the mount options.

I thought about the remount option too, but the manpages (for 11.23) note, "It also changes a files system from read-only to read/write. remount cannot change a file system from read/write to read-only...".

The manpges for 11.0 simply say that the option, "Changes the mount options for a mounted file system, such as logging and caching policies or whether the file system can be written to."

Hence, this isn't going to help anyway.

Regards!

...JRF...
Viktor Balogh
Honored Contributor

Re: Forcing an unmount of a filesystem

as for remounting:

# mount -o remount,

And be sure to supply all the mount options per command line, the mount command won't look into the fstab for mount options when remounting. And after all, remount cannot change a file system from read/write to read-only. So you must by all means umount the filesystem first. (And if I recall it correctly, the remount option is available only from 11i v2.)


As Matti mentioned, fuser might won't give you the correct list of processes, instead of it you can use the lsof command which looks also into kernelspace. (but much slower.)

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.82/
****
Unix operates with beer.