Subject: mount -u, mount -o update
To: None <netbsd-help@netbsd.org>
From: Ian D. Leroux <ian_leroux@fastmail.fm>
List: netbsd-help
Date: 02/14/2005 15:23:47
I thought I understood how these works, but apparently not. Cases in
point:

$ cat /etc/fstab |grep backups
/dev/wd0i /backups ffs ro,nodev,noexec,nosuid 0 3

$ sudo mount -u /backups
$ mount |grep backups
/dev/wd0i on /backups type ffs (local)

$ sudo mount -o update /backups
$ mount |grep backups
/dev/wd0i on /backups type ffs (read-only, noexec, nosuid, nodev, local)

$ sudo mount -o rw,update /backups
$ mount |grep backups
/dev/wd0i on /backups type ffs (read-only, noexec, nosuid, nodev, local)

Note that:
- mount -u behaves differently from mount -o update
- mount -u ignores the contents of fstab
- mount -o update respects the contents of fstab, but ignores the rw
flag

Some relevant extracts of man mount(8)
             update      The same as -u; indicate that the status of an
                         already mounted file system should be changed.

-u      The -u flag indicates that the status of an already mounted file
     system should be changed.  Any of the options discussed above (the -o
     option) may be changed; also a file system can be changed from read-only to
     read-write or vice versa.  An attempt to change from read-write to
     read-only will fail if any files on the filesystem are currently open for
     writing unless the -f flag is also specified.  The set of options is
     determined by first extracting the options for the file system from the
     fstab(5) file, then applying any options specified by the -o argument, and
     finally applying the -r or -w option.

There's an old PR (bin/15262) about the fact that -u and -o update have
different effects. Beyond that, I avow myself confused. Does anybody have a clue
to lend me?

Ian Leroux