Bug 240889 - mount -t nozfs,noufs,nodevfs,notmpfs - does not work as advertised in man page
Summary: mount -t nozfs,noufs,nodevfs,notmpfs - does not work as advertised in man page
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.1-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-28 01:59 UTC by vermaden
Modified: 2019-09-28 06:33 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vermaden 2019-09-28 01:59:37 UTC
From man 8 mount page:


  -t [no]type[,type ...]
      The argument following the -t is used to indicate the file system
      type.  The type ufs is the default.  The -t option can be used to
      indicate that the actions should only be taken on file systems of
      the specified type.  More than one type may be specified in a
      comma separated list.  The list of file system types can be
      prefixed with no to specify the file system types for which
      action should not be taken.  For example, the mount command:
      
            mount -a -t nonfs,nullfs
      
      mounts all file systems except those of type NFS and NULLFS.
      
      The default behavior of mount is to pass the -t option directly
      to the nmount(2) system call in the fstype option.
      
      However, for the following file system types: cd9660, mfs,
      msdosfs, nfs, nullfs, smbfs, udf, and unionfs mount will not call
      nmount(2) directly and will instead attempt to execute a program
      in /sbin/mount_type where type is replaced by the file system
      type name.  For example, nfs file systems are mounted by the
      program /sbin/mount_nfs.
      
      Most file systems will be dynamically loaded by the kernel if not
      already present, and if the kernel module is available.
  

Default mount with all mounts:

% mount 
zroot/ROOT/12.1 on / (zfs, local, noatime, nfsv4acls)
devfs on /dev (devfs, local, multilabel)
linprocfs on /compat/linux/proc (linprocfs, local)
tmpfs on /compat/linux/dev/shm (tmpfs, local)
zroot/tmp on /tmp (zfs, local, noatime, nosuid, nfsv4acls)
zroot/home on /home (zfs, local, noatime, nfsv4acls)
zroot/var/log on /var/log (zfs, local, noatime, noexec, nosuid, nfsv4acls)
zroot/var/crash on /var/crash (zfs, local, noatime, noexec, nosuid, nfsv4acls)
zroot/jail on /jail (zfs, local, noatime, nfsv4acls)
zroot/var/mail on /var/mail (zfs, local, nfsv4acls)
zroot/usr/src on /usr/src (zfs, local, noatime, nfsv4acls)
zroot/usr/ports on /usr/ports (zfs, local, noatime, nosuid, nfsv4acls)
zroot/var/audit on /var/audit (zfs, local, noatime, noexec, nosuid, nfsv4acls)
zroot/var/tmp on /var/tmp (zfs, local, noatime, nosuid, nfsv4acls)
/dev/label/ASD on /mnt/tmp (msdosfs, local)
/dev/md0s1a on /mnt/ufs (ufs, local)
/dev/fuse on /mnt/ntfs (fusefs)
/dev/md0s1f on /mnt/ufs.other (ufs, local)
/dev/gpt/OTHER on /mnt/fat.other (msdosfs, local)

Excluding single filesystem works:

% mount -t nozfs
devfs on /dev (devfs, local, multilabel)
linprocfs on /compat/linux/proc (linprocfs, local)
tmpfs on /compat/linux/dev/shm (tmpfs, local)
/dev/label/ASD on /mnt/tmp (msdosfs, local)
/dev/md0s1a on /mnt/ufs (ufs, local)
/dev/fuse on /mnt/ntfs (fusefs)
/dev/md0s1f on /mnt/ufs.other (ufs, local)
/dev/gpt/OTHER on /mnt/fat.other (msdosfs, local)

Excluding multiple filesystem does not work (but should according to man page):

% mount -t nozfs,noufs,nodevfs,notmpfs
devfs on /dev (devfs, local, multilabel)
linprocfs on /compat/linux/proc (linprocfs, local)
tmpfs on /compat/linux/dev/shm (tmpfs, local)
/dev/label/ASD on /mnt/tmp (msdosfs, local)
/dev/md0s1a on /mnt/ufs (ufs, local)
/dev/fuse on /mnt/ntfs (fusefs)
/dev/md0s1f on /mnt/ufs.other (ufs, local)
/dev/gpt/OTHER on /mnt/fat.other (msdosfs, local)


Regards,
vermaden
Comment 1 vermaden 2019-09-28 02:00:02 UTC
This is on 12.1-BETA1 system.

% uname -v
FreeBSD 12.1-BETA1 r352546 GENERIC
Comment 2 Yuri Pankov freebsd_committer 2019-09-28 05:09:36 UTC
I think you are reading it wrong, you should specify "no" just one time as shown in the man page example you pasted:

    mount -a -t nonfs,nullfs

...so it should be:

    mount -t nozfs,ufs,devfs,tmpfs

...if you want exclude all of these FS types.
Comment 3 vermaden 2019-09-28 06:33:31 UTC
(In reply to Yuri Pankov from comment #2)

...so it works that way, ok, now its obvious.

I will close the bug as 'not bug'.

Thank You for explanation.

Regards,
vermaden