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: src/sbin/mount/mount.8,v 1.31.2.12 2003/02/23 21:17:42 trhodes Exp $ 34.\" $DragonFly: src/sbin/mount/mount.8,v 1.8 2008/04/23 21:59:22 thomas Exp $ 35.\" 36.Dd June 10, 2009 37.Dt MOUNT 8 38.Os 39.Sh NAME 40.Nm mount 41.Nd mount file systems 42.Sh SYNOPSIS 43.Nm 44.Op Fl adfpruvw 45.Op Fl o Ar options 46.Op Fl t Ar type 47.Nm 48.Op Fl dfpruvw 49.Brq Ar special | node 50.Nm 51.Op Fl dfpruvw 52.Op Fl o Ar options 53.Op Fl t Ar type 54.Ar special node 55.Sh DESCRIPTION 56The 57.Nm 58utility calls the 59.Xr mount 2 60system call to prepare and graft a 61.Ar "special device" 62or the remote node (rhost:path) on to the file system tree at the point 63.Ar node . 64If either 65.Ar special 66or 67.Ar node 68are not provided, the appropriate information is taken from the 69.Xr fstab 5 70file. 71.Pp 72The system maintains a list of currently mounted file systems. 73If no arguments are given to 74.Nm , 75this list is printed. 76.Pp 77The options are as follows: 78.Bl -tag -width indent 79.It Fl a 80All the filesystems described in 81.Xr fstab 5 82are mounted. 83Exceptions are those marked as 84.Dq noauto , 85excluded by the 86.Fl t 87flag (see below), or if they are already mounted (except the 88root filesystem which is always remounted to preserve 89traditional single user mode behavior). 90.It Fl d 91Causes everything to be done except for the actual system call. 92This option is useful in conjunction with the 93.Fl v 94flag to 95determine what the 96.Nm 97command is trying to do. 98.It Fl f 99Forces the revocation of write access when trying to downgrade 100a filesystem mount status from read-write to read-only. 101Also 102forces the R/W mount of an unclean filesystem (dangerous; use with 103caution). 104.It Fl o 105Options are specified with a 106.Fl o 107flag followed by a comma separated string of options. 108If a 109.Dq no 110prefix is added or removed from a option name, then meaning is negated. 111In case of conflicting options being specified, the rightmost option 112takes effect. 113The following options are available: 114.Bl -tag -width indent 115.It Cm async 116All 117.Tn I/O 118to the file system should be done asynchronously. 119This is a 120.Em dangerous 121flag to set, 122and should not be used unless you are prepared to recreate the file 123system should your system crash. 124.It Cm current 125When used with the 126.Fl u 127flag, this is the same as specifying the options currently in effect for 128the mounted filesystem. 129.It Cm force 130The same as 131.Fl f ; 132forces the revocation of write access when trying to downgrade 133a filesystem mount status from read-write to read-only. 134Also 135forces the R/W mount of an unclean filesystem (dangerous; use with caution). 136.It Cm fstab 137When used with the 138.Fl u 139flag, this is the same as specifying all the options listed in the 140.Xr fstab 5 141file for the filesystem. 142.It Cm noasync 143Metadata I/O should be done synchronously, while data I/O should be done 144asynchronously. 145This is the default. 146.It Cm noatime 147Do not update the file access time when reading from a file. 148This option 149is useful on filesystems where there are large numbers of files and 150performance is more critical than updating the file access time (which is 151rarely ever important). 152This option is currently only supported on local filesystems. 153.It Cm noauto 154This filesystem should be skipped when 155.Nm 156is run with the 157.Fl a 158flag. 159.It Cm noclusterr 160Disable read clustering. 161.It Cm noclusterw 162Disable write clustering. 163.It Cm nodev 164Do not interpret character or block special devices on the file system. 165This option is useful for a server that has file systems containing 166special devices for architectures other than its own. 167This option is set automatically when the user does not have super-user 168privileges. 169.It Cm noexec 170Do not allow execution of any binaries on the mounted file system. 171This option is useful for a server that has file systems containing 172binaries for architectures other than its own. 173.It Cm nosuid 174Do not allow set-user-identifier or set-group-identifier bits to take effect. 175Note: this option is worthless if a public available suid or sgid 176wrapper like 177.Xr suidperl 1 178is installed on your system. 179It is set automatically when the user does not have super-user privileges. 180.It Cm nosymfollow 181Do not follow symlinks 182on the mounted file system. 183.It Cm rdonly , ro , norw 184The same as 185.Fl r ; 186mount the file system read-only (even the super-user may not write it). 187.It Cm sync 188All 189.Tn I/O 190to the file system should be done synchronously. 191.It Cm suiddir 192A directory on the mounted filesystem will respond to the SUID bit 193being set, by setting the owner of any new files to be the same 194as the owner of the directory. 195New directories will inherit the bit from their parents. 196Execute bits are removed from 197the file, and it will not be given to root. 198.Pp 199This feature is designed for use on fileservers serving PC users via 200ftp, SAMBA, or netatalk. 201It provides security holes for shell users and as 202such should not be used on shell machines, especially on home directories. 203This option requires the SUIDDIR 204option in the kernel to work. 205Only 206.Xr UFS 5 207filesystems support this option. 208See 209.Xr chmod 2 210for more information. 211.It Cm update 212The same as 213.Fl u ; 214indicate that the status of an already mounted file system should be changed. 215.It Cm union 216Causes the namespace at the mount point to appear as the union 217of the mounted filesystem root and the existing directory. 218Lookups will be done in the mounted filesystem first. 219If those operations fail due to a non-existent file the underlying 220directory is then accessed. 221All creates are done in the mounted filesystem. 222.It Cm ignore 223Will be ignored by 224.Xr df 1 . 225.El 226.Pp 227Any additional options specific to a filesystem type that is not 228one of the internally known types (see the 229.Fl t 230option) may be passed as a comma separated list; these options are 231distinguished by a leading 232.Dq \&- 233(dash). 234Options that take a value are specified using the syntax -option=value. 235For example, the 236.Nm 237command: 238.Bd -literal -offset indent 239mount -t mfs -o nosuid,-N,-s=4000 /dev/da0s0b /tmp 240.Ed 241.Pp 242causes 243.Nm 244to execute the equivalent of: 245.Bd -literal -offset indent 246/sbin/mount_mfs -o nosuid -N -s 4000 /dev/da0s0b /tmp 247.Ed 248.Pp 249Additional options specific to filesystem types 250which are not internally known 251(see the description of the 252.Fl t 253option below) 254may be described in the manual pages for the associated 255.Pa /sbin/mount_ Ns Sy XXX 256utilities. 257.It Fl p 258Print mount information in 259.Xr fstab 5 260format. 261If fstab is missing or if the freq and passno fields are omitted, 262the default values as described in 263.Xr fstab 5 264are used. 265Implies also the 266.Fl v 267option. 268.It Fl r 269The file system is to be mounted read-only. 270Mount the file system read-only (even the super-user may not write it). 271The same as the 272.Cm rdonly 273argument to the 274.Fl o 275option. 276.It Fl t Ar type 277The argument following the 278.Fl t 279is used to indicate the file system type. 280The type 281.Cm ufs 282is the default. 283The 284.Fl t 285option can be used 286to indicate that the actions should only be taken on 287filesystems of the specified type. 288More than one type may be specified in a comma separated list. 289The list of filesystem types can be prefixed with 290.Dq no 291to specify the filesystem types for which action should 292.Em not 293be taken. 294For example, the 295.Nm 296command: 297.Bd -literal -offset indent 298mount -a -t nonfs,mfs 299.Ed 300.Pp 301mounts all filesystems except those of type 302.Tn NFS 303and 304.Tn MFS . 305.Pp 306If the type is not the internally known type, 307.Cm ufs , 308.Nm 309will attempt to execute a program in 310.Pa /sbin/mount_ Ns Sy XXX 311where 312.Sy XXX 313is replaced by the type name. 314For example, nfs filesystems are mounted by the program 315.Pa /sbin/mount_nfs . 316.Pp 317Most filesystems will be dynamically loaded by their 318.Nm 319programs 320if not already present in the kernel, using the 321.Xr vfsload 3 322subroutine. 323Because this mechanism requires writable temporary space, 324the filesystem type containing 325.Pa /tmp 326must be compiled into the kernel, and the filesystems containing 327.Pa /tmp 328and 329.Pa /usr/bin/ld 330must be listed in 331.Pa /etc/fstab 332before any filesystems which might be dynamically loaded. 333.It Fl u 334The 335.Fl u 336flag indicates that the status of an already mounted file 337system should be changed. 338Any of the options discussed above (the 339.Fl o 340option) 341may be changed; 342also a file system can be changed from read-only to read-write 343or vice versa. 344An attempt to change from read-write to read-only will fail if any 345files on the filesystem are currently open for writing unless the 346.Fl f 347flag is also specified. 348The set of options is determined by applying the options specified 349in the argument to 350.Fl o 351and finally applying the 352.Fl r 353or 354.Fl w 355option. 356.It Fl v 357Verbose mode. 358.It Fl w 359The file system object is to be read and write. 360.El 361.Sh FILES 362.Bl -tag -width /etc/fstab -compact 363.It Pa /etc/fstab 364file system table 365.El 366.Sh DIAGNOSTICS 367Various, most of them are self-explanatory. 368.Pp 369.Dl XXXXX filesystem is not available 370.Pp 371The kernel does not support the respective filesystem type. 372Note that 373support for a particular filesystem might be provided either on a static 374(kernel compile-time), or dynamic basis (loaded as a kernel module by 375.Xr kldload 8 ) . 376Normally, 377.Nm 378or its subprocesses attempt to dynamically load a filesystem module if 379it has not been configured statically, using 380.Xr vfsload 3 . 381In this case, the above error message can also mean that you did not 382have permission to load the module. 383.Sh SEE ALSO 384.Xr df 1 , 385.Xr lsvfs 1 , 386.Xr mount 2 , 387.Xr vfsload 3 , 388.Xr UFS 5 , 389.Xr devtab 5 , 390.Xr fstab 5 , 391.Xr kldload 8 , 392.Xr mount_cd9660 8 , 393.Xr mount_devfs 8 , 394.Xr mount_ext2fs 8 , 395.Xr mount_fdesc 8 , 396.Xr mount_hammer 8 , 397.Xr mount_hpfs 8 , 398.Xr mount_linprocfs 8 , 399.Xr mount_mfs 8 , 400.Xr mount_msdos 8 , 401.Xr mount_nfs 8 , 402.Xr mount_ntfs 8 , 403.Xr mount_null 8 , 404.Xr mount_nwfs 8 , 405.Xr mount_portal 8 , 406.Xr mount_procfs 8 , 407.Xr mount_smbfs 8 , 408.Xr mount_std 8 , 409.Xr mount_tmpfs 8 , 410.Xr mount_udf 8 , 411.Xr mount_union 8 , 412.Xr sysctl 8 , 413.Xr umount 8 414.Sh CAVEATS 415After a successful 416.Nm , 417the permissions on the original mount point determine if 418.Pa ..\& 419is accessible from the mounted file system. 420The minimum permissions for 421the mount point for traversal across the mount point in both 422directions to be possible for all users is 0111 (execute for all). 423.Sh HISTORY 424A 425.Nm 426utility appeared in 427.At v1 . 428.Sh BUGS 429It is possible for a corrupted file system to cause a crash. 430