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.19 (Berkeley) 11/15/92 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.El 103.It Fl r 104The file system object is to be mounted read-only. 105.It Fl t Ar "ufs \\*(Ba lfs \\*(Ba external type" 106The argument following the 107.Fl t 108is used to indicate the file system type. 109The type 110.Ar ufs 111is the default. 112The \fI-t\fP option can be used 113to indicate that the actions should only be taken on 114filesystems of the specified type. 115More than one type may be specified in a comma separated list. 116The list of filesystem types can be prefixed with ``no'' to 117specify the filesystem types on which no action should be taken. 118For example, the 119.Nm mount 120command: 121.Bd -literal -offset indent 122mount -a -t nonfs,mfs 123.Ed 124.Pp 125mounts all filesystems except those of type 126.Tn NFS 127and 128.Tn MFS . 129.Pp 130If the type is not one of the internally known types, 131mount will attempt to execute a program in 132.Pa /sbin/mount_ Ns Em XXX 133where 134.Em XXX 135is replaced by the type name. 136For example, nfs filesystems are mounted by the program 137.Pa /sbin/mount_nfs . 138.It Fl u 139The 140.Fl u 141flag indicates that the status of an already mounted file 142system should be changed. 143Any of the options discussed above (the 144.Fl o 145option) 146may be changed; 147also a file system can be changed from read-only to read-write 148or vice versa. 149An attempt to change from read-write to read-only will fail if any 150files on the filesystem are currently open for writing unless the 151.Fl f 152flag is also specified. 153The set of options is determined by first extracting the options 154for the file system from the 155.Xr fstab 156table, 157then applying any options specified by the 158.Fl o 159argument, 160and finally applying the 161.Fl r 162or 163.Fl w 164option. 165.It Fl v 166Verbose mode. 167.It Fl w 168The file system object is to be read and write. 169.It Fl 170Any additional options specific to the program can 171be passed as a comma separated list; 172these options are distinguished by starting with a 173.Fl 174(dash). 175.El 176.Pp 177Those options that take a value are specified 178using the syntax -option=value. 179For example, the mount command: 180.Bd -literal -offset indent 181mount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp 182.Ed 183.Pp 184causes mount to attempt to execute: 185.Bd -literal -offset indent 186/sbin/mount_mfs -F 8 -N -s 4000 /dev/dk0b /tmp 187.Ed 188.Pp 189The options specific to NFS filesystems are described in the 190.Xr mount_nfs 8 191manual page. 192.Pp 193.Nm Umount 194removes the 195.Ar special 196device grafted at point 197.Ar node 198from file system tree. 199.Pp 200Options for the 201.Nm umount 202command: 203.Bl -tag -width indent 204.It Fl f 205The file system is forcibly unmounted. 206Active special devices continue to work, 207but all other files return errors if further accesses are attempted. 208The root file system cannot be forcibly unmounted. 209.It Fl a 210All of the file systems described in 211.Xr fstab 5 212are unmounted. 213.It Fl t 214Is used to indicate the actions should only be taken on 215filesystems of the specified type. 216More than one type may be specified in a comma separated list. 217The list of filesystem types can be prefixed with ``no'' to 218specify the filesystem types on which no action should be taken. 219(See example above for the 220.Nm mount 221command.) 222.El 223.Sh FILES 224.Bl -tag -width /etc/fstab -compact 225.It Pa /etc/fstab 226file system table 227.El 228.Sh SEE ALSO 229.Xr mount 2 , 230.Xr unmount 2 , 231.Xr fstab 5 232.Sh BUGS 233It is possible for a corrupted file system to cause a crash. 234.Sh HISTORY 235A 236.Nm 237command appeared in 238.At v6 . 239