1.\" Copyright (c) 1980, 1989, 1991 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)mount.8 6.20 (Berkeley) 04/06/93 7.\" 8.Dd 9.Dt MOUNT 8 10.Os BSD 4 11.Sh NAME 12.Nm mount , 13.Nm umount 14.Nd mount and dismount file systems 15.Sh SYNOPSIS 16.Nm mount 17.Op Fl afrwu 18.Op Fl t Ar ufs | lfs | external_type 19.Nm mount 20.Op Fl frwu 21.Ar special | node 22.Nm mount 23.Op Fl frwu 24.Op Fl t Ar ufs | lfs | external_type 25.Op Fl o Ar options 26.Ar special node 27.Nm umount 28.Op Fl af 29.Op Fl t Ar ufs | lfs | external_type 30.Nm umount 31.Op Fl f 32.Ar special | node 33.Sh DESCRIPTION 34The 35.Nm mount 36command 37calls the 38.Xr mount 2 39system call to prepare and graft a 40.Ar special 41device or the remote node 42(rhost:path) 43on to the file system tree at the point 44.Ar node. 45If either 46.Ar special 47or 48.Ar node 49are not provided, the appropriate 50information is taken from the 51.Xr fstab 5 52file. 53.Pp 54The system maintains a list of currently mounted file systems. 55If no arguments are given to 56.Nm mount, 57this list is printed. 58.Pp 59Options available for the 60.Nm mount 61command: 62.Bl -tag -width indent 63.It Fl F 64The standard mount options are parsed and 65passed to external program via the 66.Fl F 67option 68as a decimal number. 69(See example below.) 70.It Fl d 71Causes everything to be done except for the actual system call. 72This option is useful in conjunction with the 73.Fl v 74flag to 75determine what the 76.Nm mount 77command is trying to do. 78.It Fl f 79Forces the revocation of write access when trying to downgrade 80a filesystem mount status from read-write to read-only. 81.It Fl o 82Options are specified with a 83.Fl o 84flag 85followed by a comma separated string of options. 86The following options apply to any file system that is being mounted: 87.Bl -tag -width indent 88.It noexec 89Do not allow execution of any binaries on the mounted file system. 90This options is useful for a server that has file systems containing 91binaries for architectures other than its own. 92.It nosuid 93Do not allow set-user-identifier or set-group-identifier bits to take effect. 94.It nodev 95Do not interpret character or block special devices on the file system. 96This options is useful for a server that has file systems containing 97special devices for architectures other than its own. 98.It synchronous 99All 100.Tn I/O 101to the file system should be done synchronously. 102.It union 103Causes the namespace at the mount point to appear as the union 104of the mounted filesystem root and the existing directory. 105Lookups will be done in the mounted filesystem first. 106If those operations fail due to a non-existent file the underlying 107directory is then accessed. 108All creates are done in the mounted filesystem. 109.El 110.It Fl r 111The file system object is to be mounted read-only. 112.It Fl t Ar "ufs \\*(Ba lfs \\*(Ba external type" 113The argument following the 114.Fl t 115is used to indicate the file system type. 116The type 117.Ar ufs 118is the default. 119The \fI-t\fP option can be used 120to indicate that the actions should only be taken on 121filesystems of the specified type. 122More than one type may be specified in a comma separated list. 123The list of filesystem types can be prefixed with ``no'' to 124specify the filesystem types on which no action should be taken. 125For example, the 126.Nm mount 127command: 128.Bd -literal -offset indent 129mount -a -t nonfs,mfs 130.Ed 131.Pp 132mounts all filesystems except those of type 133.Tn NFS 134and 135.Tn MFS . 136.Pp 137If the type is not one of the internally known types, 138mount will attempt to execute a program in 139.Pa /sbin/mount_ Ns Em XXX 140where 141.Em XXX 142is replaced by the type name. 143For example, nfs filesystems are mounted by the program 144.Pa /sbin/mount_nfs . 145.It Fl u 146The 147.Fl u 148flag indicates that the status of an already mounted file 149system should be changed. 150Any of the options discussed above (the 151.Fl o 152option) 153may be changed; 154also a file system can be changed from read-only to read-write 155or vice versa. 156An attempt to change from read-write to read-only will fail if any 157files on the filesystem are currently open for writing unless the 158.Fl f 159flag is also specified. 160The set of options is determined by first extracting the options 161for the file system from the 162.Xr fstab 163table, 164then applying any options specified by the 165.Fl o 166argument, 167and finally applying the 168.Fl r 169or 170.Fl w 171option. 172.It Fl v 173Verbose mode. 174.It Fl w 175The file system object is to be read and write. 176.It Fl 177Any additional options specific to the program can 178be passed as a comma separated list; 179these options are distinguished by starting with a 180.Fl 181(dash). 182.El 183.Pp 184Those options that take a value are specified 185using the syntax -option=value. 186For example, the mount command: 187.Bd -literal -offset indent 188mount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp 189.Ed 190.Pp 191causes mount to attempt to execute: 192.Bd -literal -offset indent 193/sbin/mount_mfs -F 8 -N -s 4000 /dev/dk0b /tmp 194.Ed 195.Pp 196The options specific to NFS filesystems are described in the 197.Xr mount_nfs 8 198manual page. 199.Pp 200.Nm Umount 201removes the 202.Ar special 203device grafted at point 204.Ar node 205from file system tree. 206.Pp 207Options for the 208.Nm umount 209command: 210.Bl -tag -width indent 211.It Fl f 212The file system is forcibly unmounted. 213Active special devices continue to work, 214but all other files return errors if further accesses are attempted. 215The root file system cannot be forcibly unmounted. 216.It Fl a 217All of the file systems described in 218.Xr fstab 5 219are unmounted. 220.It Fl t 221Is used to indicate the actions should only be taken on 222filesystems of the specified type. 223More than one type may be specified in a comma separated list. 224The list of filesystem types can be prefixed with ``no'' to 225specify the filesystem types on which no action should be taken. 226(See example above for the 227.Nm mount 228command.) 229.El 230.Sh FILES 231.Bl -tag -width /etc/fstab -compact 232.It Pa /etc/fstab 233file system table 234.El 235.Sh SEE ALSO 236.Xr mount 2 , 237.Xr unmount 2 , 238.Xr fstab 5 239.Sh BUGS 240It is possible for a corrupted file system to cause a crash. 241.Sh HISTORY 242A 243.Nm 244command appeared in 245.At v6 . 246