1 '\" te
   2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
   3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6 .TH MOUNT 1M "May 29, 2008"
   7 .SH NAME
   8 mount, umount \- mount or unmount file systems and remote resources
   9 .SH SYNOPSIS
  10 .LP
  11 .nf
  12 \fBmount\fR [\fB-p\fR | \fB-v\fR]
  13 .fi
  14 
  15 .LP
  16 .nf
  17 \fBmount\fR [\fB-F\fR \fIFSType\fR] [\fIgeneric_options\fR] [\fB-o\fR \fIspecific_options\fR]
  18      [\fB-O\fR] \fIspecial\fR | \fImount_point\fR
  19 .fi
  20 
  21 .LP
  22 .nf
  23 \fBmount\fR [\fB-F\fR \fIFSType\fR] [\fIgeneric_options\fR] [\fB-o\fR \fIspecific_options\fR]
  24      [\fB-O\fR] \fIspecial\fR \fImount_point\fR
  25 .fi
  26 
  27 .LP
  28 .nf
  29 \fBmount\fR \fB-a\fR [\fB-F\fR \fIFSType\fR] [\fB-V\fR] [\fIcurrent_options\fR]
  30      [\fB-o\fR \fIspecific_options\fR] [\fImount_point\fR]...
  31 .fi
  32 
  33 .LP
  34 .nf
  35 \fBumount\fR [\fB-f\fR] [\fB-V\fR] [\fB-o\fR \fIspecific_options\fR] \fIspecial\fR | \fImount_point\fR
  36 .fi
  37 
  38 .LP
  39 .nf
  40 \fBumount\fR \fB-a\fR [\fB-f\fR] [\fB-V\fR] [\fB-o\fR \fIspecific_options\fR] [\fImount_point\fR]...
  41 .fi
  42 
  43 .SH DESCRIPTION
  44 .sp
  45 .LP
  46 \fBmount\fR attaches a file system to the file system hierarchy at the
  47 \fImount_point\fR, which is the pathname of a directory. If \fImount_point\fR
  48 has any contents prior to the \fBmount\fR operation, these are hidden until the
  49 file system is unmounted.
  50 .sp
  51 .LP
  52 \fBumount\fR unmounts a currently mounted file system, which may be specified
  53 either as a \fImount_point\fR or as \fIspecial\fR, the device on which the file
  54 system resides.
  55 .sp
  56 .LP
  57 The table of currently mounted file systems can be found by examining the
  58 mounted file system information file. This is provided by a file system that is
  59 usually mounted on \fB/etc/mnttab\fR. The mounted file system information is
  60 described in \fBmnttab\fR(4). Mounting a file system adds an entry to the mount
  61 table; a \fBumount\fR removes an entry from the table.
  62 .sp
  63 .LP
  64 When invoked with both the \fIspecial\fR and \fImount_point\fR arguments and
  65 the \fB-F\fR option, \fBmount\fR validates all arguments except for
  66 \fIspecial\fR and invokes the appropriate \fIFSType\fR-specific \fBmount\fR
  67 module. If invoked with no arguments, \fBmount\fR lists all the mounted file
  68 systems recorded in the mount table, \fB/etc/mnttab\fR. If invoked with a
  69 partial argument list (with only one of \fIspecial\fR or \fImount_point\fR, or
  70 with both \fIspecial\fR or \fImount_point\fR specified but not \fIFSType\fR),
  71 \fBmount\fR will search \fB/etc/vfstab\fR for an entry that will supply the
  72 missing arguments. If no entry is found, and the special argument starts with
  73 \fB/\fR, the default local file system type specified in \fB/etc/default/fs\fR
  74 will be used. Otherwise the default remote file system type will be used. The
  75 default remote file system type is determined by the first entry in the
  76 \fB/etc/dfs/fstypes\fR file. After filling in missing arguments, \fBmount\fR
  77 will invoke the \fIFSType\fR-specific \fBmount\fR module.
  78 .sp
  79 .LP
  80 For file system types that support it, a file can be mounted directly as a file
  81 system by specifying the full path to the file as the special argument.  In
  82 such a case, the \fBnosuid\fR option is enforced. If specific file system
  83 support for such loopback file mounts is not present, you can still use
  84 \fBlofiadm\fR(1M) to mount a file system image. In this case, no special
  85 options are enforced.
  86 .sp
  87 .LP
  88 Only a user with sufficient privilege (at least \fBPRIV_SYS_MOUNT\fR) can mount
  89 or unmount file systems using \fBmount\fR and \fBumount\fR. However, any user
  90 can use \fBmount\fR to list mounted file systems and resources.
  91 .SH OPTIONS
  92 .sp
  93 .ne 2
  94 .na
  95 \fB\fB-F\fR \fIFSType\fR\fR
  96 .ad
  97 .sp .6
  98 .RS 4n
  99 Used to specify the \fIFSType\fR on which to operate. The \fIFSType\fR must be
 100 specified or must be determinable from \fB/etc/vfstab\fR, or by consulting
 101 \fB/etc/default/fs\fR or \fB/etc/dfs/fstypes\fR.
 102 .RE
 103 
 104 .sp
 105 .ne 2
 106 .na
 107 \fB\fB-a\fR [ \fImount_points\fR. . . ]\fR
 108 .ad
 109 .sp .6
 110 .RS 4n
 111 Perform mount or umount operations in parallel, when possible.
 112 .sp
 113 If mount points are not specified, \fBmount\fR will mount all file systems
 114 whose \fB/etc/vfstab\fR "mount at boot" field is \fByes\fR. If mount points are
 115 specified, then \fB/etc/vfstab\fR "mount at boot" field will be ignored.
 116 .sp
 117 If mount points are specified, \fBumount\fR will only \fBumount\fR those mount
 118 points. If none is specified, then \fBumount\fR will attempt to \fBunmount\fR
 119 all file systems in \fB/etc/mnttab\fR, with the exception of certain system
 120 required file systems: \fB/\fR, \fB/usr\fR, \fB/var\fR, \fB/var/adm\fR,
 121 \fB/var/run\fR, \fB/proc\fR, \fB/dev/fd\fR and \fB/tmp\fR.
 122 .RE
 123 
 124 .sp
 125 .ne 2
 126 .na
 127 \fB\fB-f\fR\fR
 128 .ad
 129 .sp .6
 130 .RS 4n
 131 Forcibly unmount a file system.
 132 .sp
 133 Without this option, \fBumount\fR does not allow a file system to be unmounted
 134 if a file on the file system is busy. Using this option can cause data loss for
 135 open files; programs which access files after the file system has been
 136 unmounted will get an error (\fBEIO\fR).
 137 .RE
 138 
 139 .sp
 140 .ne 2
 141 .na
 142 \fB\fB-p\fR\fR
 143 .ad
 144 .sp .6
 145 .RS 4n
 146 Print the list of mounted file systems in the \fB/etc/vfstab\fR format. Must be
 147 the only option specified. See \fBBUGS\fR.
 148 .RE
 149 
 150 .sp
 151 .ne 2
 152 .na
 153 \fB\fB-v\fR\fR
 154 .ad
 155 .sp .6
 156 .RS 4n
 157 Print the list of mounted file systems in verbose format. Must be the only
 158 option specified.
 159 .RE
 160 
 161 .sp
 162 .ne 2
 163 .na
 164 \fB\fB-V\fR\fR
 165 .ad
 166 .sp .6
 167 .RS 4n
 168 Echo the complete command line, but do not execute the command. \fBumount\fR
 169 generates a command line by using the options and arguments provided by the
 170 user and adding to them information derived from \fB/etc/mnttab\fR. This option
 171 should be used to verify and validate the command line.
 172 .RE
 173 
 174 .sp
 175 .ne 2
 176 .na
 177 \fB\fIgeneric_options\fR\fR
 178 .ad
 179 .sp .6
 180 .RS 4n
 181 Options that are commonly supported by most \fIFSType\fR-specific command
 182 modules. The following options are available:
 183 .sp
 184 .ne 2
 185 .na
 186 \fB\fB-m\fR\fR
 187 .ad
 188 .sp .6
 189 .RS 4n
 190 Mount the file system without making an entry in \fB/etc/mnttab\fR.
 191 .RE
 192 
 193 .sp
 194 .ne 2
 195 .na
 196 \fB\fB-g\fR\fR
 197 .ad
 198 .sp .6
 199 .RS 4n
 200 Globally mount the file system. On a clustered system, this globally mounts the
 201 file system on all nodes of the cluster. On a non-clustered system this has no
 202 effect.
 203 .RE
 204 
 205 .sp
 206 .ne 2
 207 .na
 208 \fB\fB-o\fR\fR
 209 .ad
 210 .sp .6
 211 .RS 4n
 212 Specify \fIFSType\fR-specific options in a comma separated (without spaces)
 213 list of suboptions and keyword-attribute pairs for interpretation by the
 214 \fIFSType\fR-specific module of the command. (See \fBmount_ufs\fR(1M).) When
 215 you use \fB-o\fR with a file system that has an entry in \fB/etc/vfstab\fR, any
 216 \fBmount\fR options entered for that file system in \fB/etc/vfstab\fR are
 217 ignored.
 218 .sp
 219 The following options are supported:
 220 .sp
 221 .ne 2
 222 .na
 223 \fB\fBdevices | nodevices\fR\fR
 224 .ad
 225 .sp .6
 226 .RS 4n
 227 Allow or disallow the opening of device-special files. The default is
 228 \fBdevices\fR.
 229 .sp
 230 If you use \fBnosuid\fR in conjunction with \fBdevices\fR, the behavior is
 231 equivalent to that of \fBnosuid\fR.
 232 .RE
 233 
 234 .sp
 235 .ne 2
 236 .na
 237 \fB\fBexec | noexec\fR\fR
 238 .ad
 239 .sp .6
 240 .RS 4n
 241 Allow or disallow executing programs in the file system. Allow or disallow
 242 \fBmmap\fR(2) with \fBPROT_EXEC\fR for files within the file system. The
 243 default is \fBexec\fR.
 244 .RE
 245 
 246 .sp
 247 .ne 2
 248 .na
 249 \fB\fBloop\fR\fR
 250 .ad
 251 .sp .6
 252 .RS 4n
 253 Ignored for compatibility.
 254 .RE
 255 
 256 .sp
 257 .ne 2
 258 .na
 259 \fB\fBnbmand | nonbmand\fR\fR
 260 .ad
 261 .sp .6
 262 .RS 4n
 263 Allow or disallow non-blocking mandatory locking semantics on this file system.
 264 Non-blocking mandatory locking is disallowed by default.
 265 .sp
 266 If the file system is mounted with the \fBnbmand\fR option, then applications
 267 can use the \fBfcntl\fR(2) interface to place non-blocking mandatory locks on
 268 files and the system enforces those semantics. If you enable this option, it
 269 can cause standards conformant applications to see unexpected errors.
 270 .sp
 271 To avoid the possibility of obtaining mandatory locks on system files, do not
 272 use the \fBnbmand\fR option with the following file systems:
 273 .sp
 274 .in +2
 275 .nf
 276 /
 277 /usr
 278 /etc
 279 /var
 280 /proc
 281 /dev
 282 /devices
 283 /system/contract
 284 /system/object
 285 /etc/mnttab
 286 /etc/dfs/sharetab
 287 .fi
 288 .in -2
 289 .sp
 290 
 291 Do not use the \fBremount\fR option to change the \fBnbmand\fR disposition of
 292 the file system. The \fBnbmand\fR option is mutually exclusive of the global
 293 option. See \fB-g\fR.
 294 .RE
 295 
 296 .sp
 297 .ne 2
 298 .na
 299 \fB\fBro | rw\fR\fR
 300 .ad
 301 .sp .6
 302 .RS 4n
 303 Specify read-only or read-write. The default is \fBrw\fR.
 304 .RE
 305 
 306 .sp
 307 .ne 2
 308 .na
 309 \fB\fBsetuid | nosetuid\fR\fR
 310 .ad
 311 .sp .6
 312 .RS 4n
 313 Allow or disallow \fBsetuid\fR or \fBsetgid\fR execution. The default is
 314 \fBsetuid\fR.
 315 .sp
 316 If you specify \fBsetuid\fR in conjunction with \fBnosuid\fR, the behavior is
 317 the same as \fBnosuid\fR.
 318 .sp
 319 \fBnosuid\fR is equivalent to \fBnosetuid\fR and \fBnodevices\fR. When
 320 \fBsuid\fR or \fBnosuid\fR is combined with \fBsetuid\fR or \fBnosetuid\fR and
 321 \fBdevices\fR or \fBnodevices\fR, the most restrictive options take effect.
 322 .sp
 323 This option is highly recommended whenever the file system is shared by way of
 324 NFS with the \fBroot=\fR option. Without it, NFS clients could add \fBsetuid\fR
 325 programs to the server or create devices that could open security holes.
 326 .RE
 327 
 328 .sp
 329 .ne 2
 330 .na
 331 \fB\fBsuid | nosuid\fR\fR
 332 .ad
 333 .sp .6
 334 .RS 4n
 335 Allow or disallow \fBsetuid\fR or \fBsetgid\fR execution. The default is
 336 \fBsuid\fR. This option also allows or disallows opening any device-special
 337 entries that appear within the filesystem.
 338 .sp
 339 \fBnosuid\fR is equivalent to \fBnosetuid\fR and \fBnodevices\fR. When
 340 \fBsuid\fR or \fBnosuid\fR is combined with \fBsetuid\fR or \fBnosetuid\fR and
 341 \fBdevices\fR or \fBnodevices\fR, the most restrictive options take effect.
 342 .sp
 343 This option is highly recommended whenever the file system is shared using NFS
 344 with the \fBroot=\fIoption\fR\fR, because, without it, NFS clients could add
 345 \fBsetuid\fR programs to the server, or create devices that could open security
 346 holes.
 347 .RE
 348 
 349 .RE
 350 
 351 .sp
 352 .ne 2
 353 .na
 354 \fB\fB-O\fR\fR
 355 .ad
 356 .sp .6
 357 .RS 4n
 358 Overlay mount. Allow the file system to be mounted over an existing mount
 359 point, making the underlying file system inaccessible. If a mount is attempted
 360 on a pre-existing mount point without setting this flag, the mount will fail,
 361 producing the error "device busy".
 362 .RE
 363 
 364 .sp
 365 .ne 2
 366 .na
 367 \fB\fB-r\fR\fR
 368 .ad
 369 .sp .6
 370 .RS 4n
 371 Mount the file system read-only.
 372 .RE
 373 
 374 .RE
 375 
 376 .SH EXAMPLES
 377 .LP
 378 \fBExample 1 \fRMounting and Unmounting a DVD Image Directly
 379 .sp
 380 .LP
 381 The following commands mount and unmount a DVD image.
 382 
 383 .sp
 384 .in +2
 385 .nf
 386 # \fBmount -F hsfs /images/solaris.iso /mnt/solaris-image\fR
 387 # \fBumount /mnt/solaris-image\fR
 388 .fi
 389 .in -2
 390 .sp
 391 
 392 .SH USAGE
 393 .sp
 394 .LP
 395 See \fBlargefile\fR(5) for the description of the behavior of \fBmount\fR and
 396 \fBumount\fR when encountering files greater than or equal to 2 Gbyte ( 2^31
 397 bytes).
 398 .SH FILES
 399 .sp
 400 .ne 2
 401 .na
 402 \fB\fB/etc/mnttab\fR\fR
 403 .ad
 404 .sp .6
 405 .RS 4n
 406 Table of mounted file systems.
 407 .RE
 408 
 409 .sp
 410 .ne 2
 411 .na
 412 \fB\fB/etc/default/fs\fR\fR
 413 .ad
 414 .sp .6
 415 .RS 4n
 416 Default local file system type. Default values can be set for the following
 417 flags in \fB/etc/default/fs\fR. For example: \fBLOCAL=ufs\fR
 418 .sp
 419 .ne 2
 420 .na
 421 \fB\fBLOCAL:\fR\fR
 422 .ad
 423 .sp .6
 424 .RS 4n
 425 The default partition for a command if no \fIFSType\fR is specified.
 426 .RE
 427 
 428 .RE
 429 
 430 .sp
 431 .ne 2
 432 .na
 433 \fB\fB/etc/vfstab\fR\fR
 434 .ad
 435 .sp .6
 436 .RS 4n
 437 List of default parameters for each file system.
 438 .RE
 439 
 440 .SH SEE ALSO
 441 .sp
 442 .LP
 443 \fBlofiadm\fR(1M), \fBmount_cachefs\fR(1M), \fBmount_hsfs\fR(1M),
 444 \fBmount_nfs\fR(1M), \fBmount_pcfs\fR(1M),  \fBmount_smbfs\fR(1M),
 445 \fBmount_tmpfs\fR(1M),  \fBmount_udfs\fR(1M), \fBmount_ufs\fR(1M),
 446 \fBmountall\fR(1M), \fBumountall\fR(1M), \fBfcntl\fR(2), \fBmmap\fR(2),
 447 \fBmnttab\fR(4), \fBvfstab\fR(4), \fBattributes\fR( 5), \fBlargefile\fR(5),
 448 \fBprivileges\fR(5), \fBlofs\fR(7FS), \fBpcfs\fR(7FS)
 449 .SH NOTES
 450 .sp
 451 .LP
 452 If the directory on which a file system is to be mounted is a symbolic link,
 453 the file system is mounted on the directory to which the symbolic link refers,
 454 rather than on top of the symbolic link itself.
 455 .SH BUGS
 456 .sp
 457 .LP
 458 The \fBmount\fR \fB-p\fR output is incorrect for \fBcachefs\fR.