[comp.sys.sgi] Force dismount NFS partitions?

dwatts@ki.UUCP (Dan Watts) (10/16/90)

Does anyone know of a way to force dismount of an NFS mounted partition?
I've got some partitions mounted from a remote Sun which is now down.
Unfortunately, now I can't do a 'df'.  It just hangs waiting for the
missing NFS mounts.  If I run 'umount', it hangs too.  It eventually
comes back with an error that the umount timed out, but does't remove
the mount entries.

I'm looking for anything that'll work, even pointers to how I could
write a program to manually muck with system files if that would get
the #?$%@! partitions dismounted.
-- 
#####################################################################
# CompuServe: >INTERNET:uunet.UU.NET!ki!dwatts    Dan Watts         #
# UUCP      : ...!{uunet | wgc386}!ki!dwatts      Ki Research, Inc. #
############### New Dimensions In Network Connectivity ##############

marinell@Iris1.UCIS.Dal.Ca (Kevin Marinelli) (10/17/90)

In article <870@ki.UUCP> dwatts@ki.UUCP (Dan Watts) writes:
>Does anyone know of a way to force dismount of an NFS mounted partition?
>I've got some partitions mounted from a remote Sun which is now down.
>Unfortunately, now I can't do a 'df'.  It just hangs waiting for the
>missing NFS mounts.  If I run 'umount', it hangs too.  It eventually
>comes back with an error that the umount timed out, but does't remove
>the mount entries.
>
>I'm looking for anything that'll work, even pointers to how I could
>write a program to manually muck with system files if that would get
>the #?$%@! partitions dismounted.
>-- 
    If you set up the NFS mounted partitions to be "soft" mounted,
the system will not hang when host server goes away.
everything will continue to work, although  any access to the partition via
df will report that it cannot be accessed. Otherwise, the partition will look
like an empty subdirectory when it is not mounted.

Kevin Marinelli
Academic Computing Services
Dalhousie University

sims@cam.nist.gov (Jim Sims) (10/17/90)

In article <870@ki.UUCP> dwatts@ki.UUCP (Dan Watts) writes:
>Does anyone know of a way to force dismount of an NFS mounted
>partition?

Assuming the mounts are hard, the only way I know of to
force dismounts is to reboot! :=)

>I've got some partitions mounted from a remote Sun which is now
down.
>Unfortunately, now I can't do a 'df'.  It just hangs waiting
for the
>missing NFS mounts.

There is a trick to get around the df hanging problem.
df gets its information for mounted file systems from
/etc/mtab, so you can edit /etc/mtab to remove the lines
pertaining the file systems from the server which is down.
This will trick df into thinking the file systems are not
mounted, when in fact they are. Unfortunately, a cd to the
file systems from the down server will still hang.

-----------------------------------------------------------------------
NAME:   James S. Sims                    TELE: (301) 975-2710
USMAIL: National Institute of Standards and Technology
(formerly National Bureau of Standards)  ARPA,BITNET: sims@enh.nist.gov

moraes@cs.toronto.edu (Mark Moraes) (10/17/90)

marinell@Iris1.UCIS.Dal.Ca (Kevin Marinelli) writes:
>    If you set up the NFS mounted partitions to be "soft" mounted,
>the system will not hang when host server goes away.
>everything will continue to work, although  any access to the partition via
>df will report that it cannot be accessed. Otherwise, the partition will look
>like an empty subdirectory when it is not mounted.

Since reads and writes on soft-mounted partitions can fail if the
server is loaded or confused, this can cause programs that don't check
system call return values to blithely keep going, creating trashed
files.  There's a large number of such programs.  Mounting rw
partitions soft is not a good idea if you value files in those
partitions.

	Mark.

brendan@illyria.wpd.sgi.com (Brendan Eich) (10/18/90)

In article <5415@fs2.cam.nist.gov>, sims@cam.nist.gov (Jim Sims) writes:
> In article <870@ki.UUCP> dwatts@ki.UUCP (Dan Watts) writes:
> >Does anyone know of a way to force dismount of an NFS mounted
> >partition?
> 
> Assuming the mounts are hard, the only way I know of to
> force dismounts is to reboot! :=)

Too harsh.  Try umount -k, or fuser -k, or ps and kill/killall.  Provided
the filesystem was mounted with the "intr" option (currently an SGI but not
a Sun default), processes "hung" on it should be killable.

Soft mounts may be undesirable for other reasons (if you're writing to the
filesystem and you want all writes to complete, up till you decide for other
reasons to do the unmount/reboot).

Umount -k calls fuser -k, and fuser may race with a process that opens and
closes a file in the filesystem.  If it loses the race, it won't kill this
busying process.  Note also that 3.3 fuser needs a generous MAXUMEM (which
is defined in /usr/sysgen/master.d/kernel) -- at least as big as physical
memory plus fuser's size.  The default MAXUMEM, 512MB, is more than enough,
but some sites may trim it to prevent resource hogging.  This fuser/MAXUMEM
restriction will be fixed.

/be

guido@cwi.nl (Guido van Rossum) (10/18/90)

dwatts@ki.UUCP (Dan Watts) writes:

>Does anyone know of a way to force dismount of an NFS mounted partition?

Often 'unmount -k' works.

mds@sgi.com (Mark Stadler) (10/20/90)

In article <72497@sgi.sgi.com> brendan@illyria.wpd.sgi.com (Brendan Eich) writes:
>In article <5415@fs2.cam.nist.gov>, sims@cam.nist.gov (Jim Sims) writes:
>> In article <870@ki.UUCP> dwatts@ki.UUCP (Dan Watts) writes:
>> >Does anyone know of a way to force dismount of an NFS mounted
>
>Too harsh.  Try umount -k, or fuser -k, or ps and kill/killall.  Provided
>the filesystem was mounted with the "intr" option (currently an SGI but not
>a Sun default), processes "hung" on it should be killable.
...
>/be

doesn't AT&T have a command called "fumount".  it does a forced unmount
of whatever you tell it, even if it has to kill off processes.  maybe
this is just an RFS feature, but i thought it worked regardless of file
system type.  anybody heard of it?

--
-- mds	[aka Mark D Stadler  mds@sgi.com  ...!uunet!sgi!mds  (415)335-1327]

dwatts@ki.UUCP (Dan Watts) (10/23/90)

In article <1990Oct17.003935.15103@nstn.ns.ca> marinell@Iris1.UCIS.Dal.Ca (Kevin Marinelli) writes:
>In article <870@ki.UUCP> dwatts@ki.UUCP (Dan Watts) writes:
>> ... stuff deleted about nfs partitions ...
>    If you set up the NFS mounted partitions to be "soft" mounted,
>the system will not hang when host server goes away.
>everything will continue to work, although  any access to the partition via
>df will report that it cannot be accessed. Otherwise, the partition will look
>like an empty subdirectory when it is not mounted.


I do have them mounted as soft.  An example entry is:

puff:/usr/export/home/amiga   /puff/amiga   nfs bg,rw,soft,retry=2 0 0

unfortunately, if I try to shutdown the system or do a umount, it just hangs
there.  I get status messages every minute or so saying that the server isn't
responding.  It's been suggested that I do a 'umount -k <dir>' for each
of the remote NFS partitions.  I've not had the time yet to try this though.
At the time I did the umount, there were no processes with open files in the
remote system or with current directories there so I don't know if this will
do any good or not.

If when I boot up the server isn't there, then the umount works just find and
goes into the background trying to mount.  Just can't get umount to give up
and quit.
-- 
#####################################################################
# CompuServe: >INTERNET:uunet.UU.NET!ki!dwatts    Dan Watts         #
# UUCP      : ...!{uunet | wgc386}!ki!dwatts      Ki Research, Inc. #
############### New Dimensions In Network Connectivity ##############

dwatts@ki.UUCP (Dan Watts) (10/23/90)

In article <90Oct16.234936edt.1354@smoke.cs.toronto.edu> moraes@cs.toronto.edu (Mark Moraes) writes:
>marinell@Iris1.UCIS.Dal.Ca (Kevin Marinelli) writes:
>>    If you set up the NFS mounted partitions to be "soft" mounted,
>> ... stuff deleted ...
>Since reads and writes on soft-mounted partitions can fail if the
>server is loaded or confused, this can cause programs that don't check
>system call return values to blithely keep going, creating trashed
>files.  There's a large number of such programs.  Mounting rw
>partitions soft is not a good idea if you value files in those
>partitions.

I agree.  Luckily for me, I mount these systems mainly for read-only
purposes and do writes infrequently.  What NFS really needs is some
way to mount the remote partitions hard but be able to force a dismount
in the event of failure.  I presume (perhaps wrongly) that if I had a
SCSI drive totaly flake out and stop responding, I'd be able to umount
it and go on.  Never had the need to try this theory out.  Anyone know
if it would work?

How about SGI?  What about a 'umount -f <dir>' to force dismount??
-- 
#####################################################################
# CompuServe: >INTERNET:uunet.UU.NET!ki!dwatts    Dan Watts         #
# UUCP      : ...!{uunet | wgc386}!ki!dwatts      Ki Research, Inc. #
############### New Dimensions In Network Connectivity ##############