Commit Graph

29 Commits

Author SHA1 Message Date
Rick Macklem
4261923e76 Add a new "-N" option to umount(8), that does a forced dismount of an NFS mount
point.

The new "-N" option does a forced dismount of an NFS mount point, but avoids
doing any checking of the mounted-on path, so that it will not get hung
when a vnode lock is held by another hung process on the mounted-on vnode.
The most common case of this is a "umount" with the "-f" option.
Other than avoiding checking the mounted-on path, it performs the same
forced dismount as a successful "umount -f" would do.

This commit includes a content change to the man page.

Tested by:	pho
Reviewed by:	kib
MFC after:	2 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D11735
2017-07-29 20:08:25 +00:00
Warner Losh
fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Allan Jude
f1a6b7cb09 sbin/umount/umount.8: Amend HISTORY
umount first appeared in V1, confirmed using TUHS archive
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/man/man1/umount.1

PR:		212554
Submitted by:	Sevan Janiyan <venture37@geeklan.co.uk>
2016-09-16 04:12:32 +00:00
Edward Tomasz Napierala
debc480e03 Add new unmount(2) flag, MNT_NONBUSY, to check whether there are
any open vnodes before proceeding. Make autounmound(8) use this flag.
Without it, even an unsuccessfull unmount causes filesystem flush,
which interferes with normal operation.

Reviewed by:	kib@
Approved by:	re (gjb@)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D7047
2016-07-07 09:03:57 +00:00
Rick Macklem
1e68ee21e0 Document that a forced dismount of an NFSv3 mount when the
NLM (rpc.lockd) is running can crash the system.
Unfortunately this is not easy to fix, but I have left
PR#200585 open.

PR:		200585
MFC after:	3 days
2015-06-17 23:24:46 +00:00
Edward Tomasz Napierala
a0252a0a82 Cross-reference autounmountd(8) from umount(8).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-11-22 16:46:00 +00:00
Rick Macklem
6b43e31fe7 Add a sentence to the umount.8 man page to clarify the behaviour
for forced dismount when used on an NFS mount point. Requested by
Jeremy Chadwick.
This is a content change.

MFC after:	2 weeks
2011-05-31 18:27:18 +00:00
Ruslan Ermilov
34ae1bb65b It's possible to unmount multiple items at once, make it clear. 2011-03-24 12:35:09 +00:00
Pawel Jakub Dawidek
48423f5d8f Be more precise how to get fsids - 'mount -v' doesn't show fsids unless is run
by root.

Approved by:	re (kib)
2009-08-17 07:38:47 +00:00
Mark Murray
4c723140a4 Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp
2004-04-09 19:58:40 +00:00
Christian Brueffer
0e9efd1904 s/considred/considered/ 2004-03-04 00:52:16 +00:00
Ian Dowse
38f102c2f6 When mount(8) is invoked with the `-v' flag, display the filesystem
ID for each file system in addition to the normal information.

In umount(8), accept filesystem IDs as well as the usual device and
path names. This makes it possible to unambiguously specify which
file system is to be unmounted even when two or more file systems
share the same device and mountpoint names (e.g. NFS mounts from
the same export into different chroots).

Suggested by:	Dan Nelson <dnelson@allantgroup.com>
2003-07-18 17:43:13 +00:00
Ruslan Ermilov
865df8ffec mdoc(7) fixes: Fix the markup in the recently added ENVIRONMENT section. 2003-05-19 19:58:29 +00:00
Matthew N. Dodd
6e3bc9dad6 Bump the date for recent commits. 2003-04-07 22:58:35 +00:00
Matthew N. Dodd
564b641ef9 Clarify the behavior of PATH_FSTAB with regard to 'tainted' execution.
Requested by:	 ru
2003-04-07 14:21:14 +00:00
Matthew N. Dodd
ef258dd967 Implement the '-F' option for mount & umount which allows the user to
specify an alternate fstab file.
2003-04-07 12:56:01 +00:00
Tom Rhodes
ce66ddb763 s/filesystem/file system/g as discussed on -developers 2002-08-21 18:11:48 +00:00
Philippe Charnier
629e80effb The .Nm utility. 2002-07-06 19:35:14 +00:00
Ruslan Ermilov
9fe48c6e8d mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 11:04:34 +00:00
Ruslan Ermilov
0b381bf1fd Remove vestiges of MFS. 2001-06-01 10:07:28 +00:00
Ruslan Ermilov
7c7fb079b9 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 16:52:27 +00:00
David Malone
ceb453befe Clarify "mount -a -t" example - it only unmounts stuff in /etc/fstab.
Fix a typo.

PR:		19438
Submitted by:	Eoin Lawless <eoin@maths.tcd.ie>
Reviewed by:	sheldon
2000-07-13 16:20:54 +00:00
Brian Feldman
bc70c1725f quoting << Martin_Blapp
-	Completly changed the internals of umount(8). We do three
	checks now to see if 'argv' is in the mounttable. It they
	all fail, we return to main and print a warning.

-	fixed the umount mount-order. The checks are rather complex
	to do this. Cause umount(8) should also be able to unmount
	several devices at once ('umount -a', 'umount -A',
	'umount /mnt /mnt2'), the mount-order get's important.
	I added checks to mark and unmark already unmounted devices.

- 	Various fixes with nfs-unmounts (no rpc-calls were done,
	or they were done although there was an existing mount).
	Since we allow overlay-mounts, we should also handle them
	properly.

-	Translate the deprecated nfs-syntax with '@' to ':' like
	mount_nfs does. The ':' syntax has now precedence, but '@'
	still works.

-	'umount -v' is now fixed for all cases and doesn't print
	garbage like two times the mountpoint etc.

-	removed non documented and useless umount '-F'.

-	hanged nfsmounts can now unmounted 'without' any problems.
	I've removed stat() and realpath() checks on the mountpoint.
	Instead we just do a realpath() on the basedir of the
	mountpath and add the dirname again.
	Implemented this as an idea from phk. But there are still
	vfs-restrictions if the nfs_mount is busy. If there are
	unwritten metadata on a hanged nfs-mount, and we modify
	nfs_vfsops.c to not return EBUSY, we get a deadlock :(
	The problem has now moved from userland to kernel.

-	removed the BUGS part from the umount(8) manpage.

-	Converted it to ANSI C (more than 60% of the code have
	changed).

Martin_Blapp

Fixed PR's
----------

o [1999/02/03] bin/9893                 NFS umount of regular file impossible

s [1995/11/27] bin/841			stale nfs mounts cannot be umounted

o [1999/08/01] bin/12911	alfred  NFS umounts are not properly done
					if just the mountpoint gets umounted

Only partially solved:
----------------------

The problem is now in kernel:

o [1999/04/07] bin/11005		`umount -f' does not work if the
					NFS-server is down.

PR:		bin/9893 bin/841 bin/12911 bin/11005
Submitted by:	Martin Blapp <mb@imp.ch>
1999-10-17 16:26:58 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Philippe Charnier
adb378ce60 Use errx() instead of err() for malloc failures. -Wall. Do not dot
terminate errx() string. Remove unused #includes. Use .Tn for NFS.
1998-08-03 06:44:46 +00:00
Steve Price
cbc0b9d0e4 Fix a typo and while here cleanup the use of the .Nm macro.
PR:		docs/4339
Submitted by:	Matthew Hunt <mph@pobox.com>
1997-08-20 11:40:13 +00:00
Bruce Evans
d499a0ef65 Merge from Lite2.
- use new getvfsbyname() interface.
- new -A option, like -a except only mounted file systems are unmounted.

All non-cosmetic FreeBSD changes in umount.c, except ignoring of
realpath() failures, went away because they are done better in Lite2.
realpath() failures must be ignored so that non-pathnames like
"<above>:/foo" and "host:/bar" get as far as mount(2).

Reviewed by:	dfr
1997-06-16 11:20:05 +00:00
David Greenman
5974081cea From njw@cs.city.ac.uk (Nick Williams):
/sbin/umount does not return the correct exit status due to incorrect
logic in its internals.

Further, because of the nature of the code, you *cannot* use it to
umount a directory from a union mountpoint. Well, you can sometimes,
it depends on if the directory is at the top of the union stack or not :)

Submitted by:	njw@cs.city.ac.uk (Nick Williams)
1994-11-04 17:51:37 +00:00
Rodney W. Grimes
8fae3551ec BSD 4.4 Lite sbin Sources
Note:  XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.
1994-05-26 06:35:07 +00:00