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