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