Index: util-linux-2.13-pre6/mount/fstab.c =================================================================== --- util-linux-2.13-pre6.orig/mount/fstab.c +++ util-linux-2.13-pre6/mount/fstab.c @@ -40,6 +40,11 @@ get_mtab_info(void) { } } +void +reset_mtab_info(void) { + have_mtab_info = 0; +} + int mtab_does_not_exist(void) { get_mtab_info(); Index: util-linux-2.13-pre6/mount/fstab.h =================================================================== --- util-linux-2.13-pre6.orig/mount/fstab.h +++ util-linux-2.13-pre6/mount/fstab.h @@ -1,6 +1,7 @@ #include "mntent.h" int mtab_is_writable(void); int mtab_does_not_exist(void); +void reset_mtab_info(void); int is_mounted_once(const char *name); int is_mounted_same_loopfile(const char *loopfile, const char *dir); Index: util-linux-2.13-pre6/mount/mount.c =================================================================== --- util-linux-2.13-pre6.orig/mount/mount.c +++ util-linux-2.13-pre6/mount/mount.c @@ -510,6 +510,8 @@ create_mtab (void) { my_endmntent (mfp); unlock_mtab(); + + reset_mtab_info(); } /* count successful mount system calls */ @@ -826,6 +828,13 @@ update_mtab_entry(const char *spec, cons if (verbose) print_one (&mnt); + if (!nomtab && mtab_does_not_exist()) { + if (verbose > 1) + printf(_("mount: no %s found - creating it..\n"), + MOUNTED); + create_mtab (); + } + if (!nomtab && mtab_is_writable()) { if (flags & MS_REMOUNT) update_mtab (mnt.mnt_dir, &mnt); @@ -1774,13 +1783,6 @@ main(int argc, char *argv[]) { die (EX_USAGE, _("mount: only root can do that")); } - if (!nomtab && mtab_does_not_exist()) { - if (verbose > 1) - printf(_("mount: no %s found - creating it..\n"), - MOUNTED); - create_mtab (); - } - if (specseen) { if (uuid) spec = mount_get_devname_by_uuid(uuid);