1.\" Copyright (c) 1980, 1989, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)mount.8 8.8 (Berkeley) 6/16/94 33.\" $FreeBSD$ 34.\" 35.Dd June 16, 1994 36.Dt MOUNT 8 37.Os BSD 4 38.Sh NAME 39.Nm mount 40.Nd mount file systems 41.Sh SYNOPSIS 42.Nm 43.Op Fl adfpruvw 44.Op Fl t Ar ufs | external_type 45.Nm 46.Op Fl dfpruvw 47.Ar special | node 48.Nm 49.Op Fl dfpruvw 50.Op Fl o Ar options 51.Op Fl t Ar ufs | external_type 52.Ar special node 53.Sh DESCRIPTION 54The 55.Nm 56command 57calls the 58.Xr mount 2 59system call to prepare and graft a 60.Ar "special device" 61or the remote node (rhost:path) on to the file system tree at the point 62.Ar node . 63If either 64.Ar special 65or 66.Ar node 67are not provided, the appropriate information is taken from the 68.Xr fstab 5 69file. 70.Pp 71The system maintains a list of currently mounted file systems. 72If no arguments are given to 73.Nm , 74this list is printed. 75.Pp 76The options are as follows: 77.Bl -tag -width indent 78.It Fl a 79All the filesystems described in 80.Xr fstab 5 81are mounted. 82Exceptions are those marked as 83.Dq noauto , 84excluded by the 85.Fl t 86flag (see below), or if they are already mounted (except the 87root filesystem which is always remounted to preserve 88traditional single user mode behavior). 89.It Fl d 90Causes everything to be done except for the actual system call. 91This option is useful in conjunction with the 92.Fl v 93flag to 94determine what the 95.Nm 96command is trying to do. 97.It Fl f 98Forces the revocation of write access when trying to downgrade 99a filesystem mount status from read-write to read-only. 100Also 101forces the R/W mount of an unclean filesystem (dangerous; use with 102caution). 103.It Fl o 104Options are specified with a 105.Fl o 106flag followed by a comma separated string of options. 107In case of conflicting options being specified, the rightmost option 108takes effect. 109The following options are available: 110.Bl -tag -width indent 111.It Cm async 112All 113.Tn I/O 114to the file system should be done asynchronously. 115This is a 116.Em dangerous 117flag to set, 118and should not be used unless you are prepared to recreate the file 119system should your system crash. 120.It Cm current 121When used with the 122.Fl u 123flag, this is the same as specifying the options currently in effect for 124the mounted filesystem. 125.It Cm force 126The same as 127.Fl f ; 128forces the revocation of write access when trying to downgrade 129a filesystem mount status from read-write to read-only. 130Also 131forces the R/W mount of an unclean filesystem (dangerous; use with caution). 132.It Cm fstab 133When used with the 134.Fl u 135flag, this is the same as specifying all the options listed in the 136.Xr fstab 5 137file for the filesystem. 138.It Cm noasync 139Metadata I/O should be done synchronously, while data I/O should be done 140asynchronously. 141This is the default. 142.It Cm noatime 143Do not update the file access time when reading from a file. 144This option 145is useful on filesystems where there are large numbers of files and 146performance is more critical than updating the file access time (which is 147rarely ever important). 148This option is currently only supported on local filesystems. 149.It Cm noauto 150This filesystem should be skipped when 151.Nm 152is run with the 153.Fl a 154flag. 155.It Cm noclusterr 156Disable read clustering. 157.It Cm noclusterw 158Disable write clustering. 159.It Cm nodev 160Do not interpret character or block special devices on the file system. 161This option is useful for a server that has file systems containing 162special devices for architectures other than its own. 163.It Cm noexec 164Do not allow execution of any binaries on the mounted file system. 165This option is useful for a server that has file systems containing 166binaries for architectures other than its own. 167.It Cm nosuid 168Do not allow set-user-identifier or set-group-identifier bits to take effect. 169Note: this option is worthless if a public available suid or sgid 170wrapper like 171.Xr suidperl 1 172is installed on your system. 173.It Cm nosymfollow 174Do not follow symlinks 175on the mounted file system. 176.It Cm rdonly 177The same as 178.Fl r ; 179mount the file system read-only (even the super-user may not write it). 180.It Cm sync 181All 182.Tn I/O 183to the file system should be done synchronously. 184.It Cm suiddir 185A directory on the mounted filesystem will respond to the SUID bit 186being set, by setting the owner of any new files to be the same 187as the owner of the directory. 188New directories will inherit the bit from their parents. 189Execute bits are removed from 190the file, and it will not be given to root. 191.Pp 192This feature is designed for use on fileservers serving PC users via 193ftp, SAMBA, or netatalk. 194It provides security holes for shell users and as 195such should not be used on shell machines, especially on home directories. 196This option requires the SUIDDIR 197option in the kernel to work. 198Only UFS filesystems support this option. 199See 200.Xr chmod 2 201for more information. 202.It Cm update 203The same as 204.Fl u ; 205indicate that the status of an already mounted file system should be changed. 206.It Cm union 207Causes the namespace at the mount point to appear as the union 208of the mounted filesystem root and the existing directory. 209Lookups will be done in the mounted filesystem first. 210If those operations fail due to a non-existent file the underlying 211directory is then accessed. 212All creates are done in the mounted filesystem. 213.El 214.Pp 215Any additional options specific to a filesystem type that is not 216one of the internally known types (see the 217.Fl t 218option) may be passed as a comma separated list; these options are 219distinguished by a leading 220.Dq \&- 221(dash). 222Options that take a value are specified using the syntax -option=value. 223For example, the 224.Nm 225command: 226.Bd -literal -offset indent 227mount -t unionfs -o -b /sys $HOME/sys 228.Ed 229.Pp 230causes 231.Nm 232to execute the equivalent of: 233.Bd -literal -offset indent 234/sbin/mount_unionfs -b /sys $HOME/sys 235.Ed 236.Pp 237Additional options specific to filesystem types 238which are not internally known 239(see the description of the 240.Fl t 241option below) 242may be described in the manual pages for the associated 243.Pa /sbin/mount_ Ns Sy XXX 244utilities. 245.It Fl p 246Print mount information in 247.Xr fstab 5 248format. 249Implies also the 250.Fl v 251option. 252.It Fl r 253The file system is to be mounted read-only. 254Mount the file system read-only (even the super-user may not write it). 255The same as the 256.Cm rdonly 257argument to the 258.Fl o 259option. 260.It Fl t Ar ufs | external_type 261The argument following the 262.Fl t 263is used to indicate the file system type. 264The type 265.Ar ufs 266is the default. 267The 268.Fl t 269option can be used 270to indicate that the actions should only be taken on 271filesystems of the specified type. 272More than one type may be specified in a comma separated list. 273The list of filesystem types can be prefixed with 274.Dq no 275to specify the filesystem types for which action should 276.Em not 277be taken. 278For example, the 279.Nm 280command: 281.Bd -literal -offset indent 282mount -a -t nonfs,nullfs 283.Ed 284.Pp 285mounts all filesystems except those of type 286.Tn NFS 287and 288.Tn NULLFS . 289.Pp 290If the type is not one of the internally known types, 291.Nm 292will attempt to execute a program in 293.Pa /sbin/mount_ Ns Sy XXX 294where 295.Sy XXX 296is replaced by the type name. 297For example, nfs filesystems are mounted by the program 298.Pa /sbin/mount_nfs . 299.Pp 300Most filesystems will be dynamically loaded by their 301.Nm 302programs 303if not already present in the kernel, using the 304.Xr vfsload 3 305subroutine. 306Because this mechanism requires writable temporary space, 307the filesystem type containing 308.Pa /tmp 309must be compiled into the kernel, and the filesystems containing 310.Pa /tmp 311and 312.Pa /usr/bin/ld 313must be listed in 314.Pa /etc/fstab 315before any filesystems which might be dynamically loaded. 316.It Fl u 317The 318.Fl u 319flag indicates that the status of an already mounted file 320system should be changed. 321Any of the options discussed above (the 322.Fl o 323option) 324may be changed; 325also a file system can be changed from read-only to read-write 326or vice versa. 327An attempt to change from read-write to read-only will fail if any 328files on the filesystem are currently open for writing unless the 329.Fl f 330flag is also specified. 331The set of options is determined by applying the options specified 332in the argument to 333.Fl o 334and finally applying the 335.Fl r 336or 337.Fl w 338option. 339.It Fl v 340Verbose mode. 341.It Fl w 342The file system object is to be read and write. 343.El 344.Sh DIAGNOSTICS 345Various, most of them are self-explanatory. 346.Pp 347.Dl XXXXX filesystem is not available 348.Pp 349The kernel does not support the respective filesystem type. 350Note that 351support for a particular filesystem might be provided either on a static 352(kernel compile-time), or dynamic basis (loaded as a kernel module by 353.Xr kldload 8 ) . 354Normally, 355.Nm 356or its subprocesses attempt to dynamically load a filesystem module if 357it has not been configured statically, using 358.Xr vfsload 3 . 359In this case, the above error message can also mean that you did not 360have permission to load the module. 361.Sh FILES 362.Bl -tag -width /etc/fstab -compact 363.It Pa /etc/fstab 364file system table 365.El 366.Sh SEE ALSO 367.Xr mount 2 , 368.Xr vfsload 3 , 369.Xr fstab 5 , 370.Xr kldload 8 , 371.Xr mount_cd9660 8 , 372.Xr mount_devfs 8 , 373.Xr mount_ext2fs 8 , 374.Xr mount_fdescfs 8 , 375.Xr mount_hpfs 8 , 376.Xr mount_linprocfs 8 , 377.Xr mount_msdosfs 8 , 378.Xr mount_nfs 8 , 379.Xr mount_ntfs 8 , 380.Xr mount_nullfs 8 , 381.Xr mount_nwfs 8 , 382.Xr mount_portalfs 8 , 383.Xr mount_procfs 8 , 384.Xr mount_std 8 , 385.Xr mount_umapfs 8 , 386.Xr mount_unionfs 8 , 387.Xr umount 8 388.Sh BUGS 389It is possible for a corrupted file system to cause a crash. 390.Sh CAVEATS 391After a successful 392.Nm , 393the permissions on the original mount point determine if 394.Pa ..\& 395is accessible from the mounted file system. 396The minimum permissions for 397the mount point for traversal across the mount point in both 398directions to be possible for all users is 0111 (execute for all). 399.Sh HISTORY 400A 401.Nm 402command appeared in 403.At v1 . 404