Don't canonicalize paths. For more details about this option see the
.B mount(8)
man page.
+.IP "\fB\-\-fake\fP"
+Causes everything to be done except for the actual system call; this
+``fakes'' unmounting the filesystem. It can be used to remove
+entries from
+.I /etc/mtab
+that were unmounted earlier with the -n option.
.SH "THE LOOP DEVICE"
The
int complained_err = 0;
char *complained_dev = NULL;
+/* True for fake umount (--fake). */
+static int fake = 0;
+
/*
* check_special_umountprog()
* If there is a special umount program for this type, exec it.
const char *opts, struct mntentchn *mc) {
int umnt_err = 0;
int isroot;
- int res;
+ int res = 0;
int status;
const char *loopdev;
int myloop = 0;
if (check_special_umountprog(spec, node, type, &status))
return status;
+ /* Skip the actual umounting for --fake */
+ if (fake)
+ goto writemtab;
/*
* Ignore the option "-d" for non-loop devices and loop devices with
* LO_FLAGS_AUTOCLEAR flag.
{ "types", 1, 0, 't' },
{ "no-canonicalize", 0, 0, 144 },
+ { "fake", 0, 0, 145 },
{ NULL, 0, 0, 0 }
};
case 144:
nocanonicalize = 1;
break;
+ case 145:
+ fake = 1;
+ break;
case 0:
break;
case '?':
}
if (restricted &&
- (all || types || nomtab || force || remount || nocanonicalize)) {
+ (all || types || nomtab || force || remount || nocanonicalize ||
+ fake)) {
die (2, _("umount: only root can do that"));
}