1 '\" te
   2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
   3 .\" Portions Copyright 1994-2008 The FreeBSD Project. All rights reserved.
   4 .\" Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
   5 .\" the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.THIS SOFTWARE IS PROVIDED
   6 .\" BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   7 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
   8 .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   9 .TH MOUNT_SMBFS 1M "Mar 31, 2009"
  10 .SH NAME
  11 mount_smbfs, umount_smbfs \- mount and unmount a shared resource from a CIFS
  12 file server
  13 .SH SYNOPSIS
  14 .LP
  15 .nf
  16 \fB/sbin/mount\fR [\fB-F smbfs\fR] [\fIgeneric-options\fR] [\fB-o\fR \fIname\fR\fB=\fR\fIvalue\fR] [\fB-O\fR] \fIresource\fR
  17 .fi
  18 
  19 .LP
  20 .nf
  21 \fB/sbin/mount\fR [\fB-F smbfs\fR] [\fIgeneric-options\fR] [\fB-o\fR \fIname\fR\fB=\fR\fIvalue\fR] [\fB-O\fR] \fImount-point\fR
  22 .fi
  23 
  24 .LP
  25 .nf
  26 \fB/sbin/mount\fR [\fB-F smbfs\fR] [\fIgeneric-options\fR] [\fB-o\fR \fIname\fR\fB=\fR\fIvalue\fR]
  27      [\fB-O\fR] \fIresource\fR \fImount-point\fR
  28 .fi
  29 
  30 .LP
  31 .nf
  32 \fB/sbin/umount\fR [\fB-F smbfs\fR] [\fIgeneric-options\fR] \fImount-point\fR
  33 .fi
  34 
  35 .SH DESCRIPTION
  36 .sp
  37 .LP
  38 The \fBmount\fR utility attaches a named resource, \fIresource\fR, to the file
  39 system hierarchy at the path name location, \fImount-point\fR, which must
  40 already exist.
  41 .sp
  42 .LP
  43 If \fImount-point\fR has any contents prior to the \fBmount\fR operation, those
  44 contents remain hidden until the resource is unmounted. An authorized user with
  45 the \fBSYS_MOUNT\fR privilege can perform a \fBmount\fR operation. Also, a user
  46 can perform SMBFS mount operations on a directory the user owns.
  47 .sp
  48 .LP
  49 If the resource is listed in the \fB/etc/vfstab\fR file, you can specify either
  50 \fIresource\fR or \fImount-point\fR as the \fBmount\fR command will consult the
  51 \fB/etc/vfstab\fR file for more information. If the \fB-F\fR option is omitted,
  52 \fBmount\fR takes the file system type from the entry in the \fB/etc/vfstab\fR
  53 file.
  54 .sp
  55 .LP
  56 If the resource is not listed in the \fB/etc/vfstab\fR file, the command line
  57 must specify both \fIresource\fR and \fImount-point\fR.
  58 .sp
  59 .LP
  60 The \fBumount\fR utility detaches a mounted file system from the file system
  61 hierarchy. An authorized user with the \fBSYS_MOUNT\fR privilege can perform a
  62 \fBumount\fR operation. Also, a user can perform SMBFS unmount operations on a
  63 directory the user owns.
  64 .sp
  65 .LP
  66 The \fBnetwork/smb/client\fR service must be enabled to successfully mount a
  67 CIFS share. This service is enabled, by default.
  68 .sp
  69 .LP
  70 To enable the service, enter the following \fBsvcadm\fR(1M) command:
  71 .sp
  72 .in +2
  73 .nf
  74 # \fBsvcadm enable network/smb/client\fR
  75 .fi
  76 .in -2
  77 .sp
  78 
  79 .SS "Operands"
  80 .sp
  81 .LP
  82 The \fBmount\fR command supports the following operands:
  83 .sp
  84 .ne 2
  85 .na
  86 \fB\fIresource\fR
  87 //[\fIworkgroup\fR;][\fIuser\fR[:\fIpassword\fR]@]\fIserver\fR/\fIshare\fR\fR
  88 .ad
  89 .sp .6
  90 .RS 4n
  91 .sp
  92 .LP
  93 The name of the resource to be mounted. In addition to its name, you can
  94 specify the following information about the resource:
  95 .RS +4
  96 .TP
  97 .ie t \(bu
  98 .el o
  99 \fIpassword\fR is the password associated with \fIuser\fR. If \fIpassword\fR is
 100 not specified, the mount first attempts to use the password stored by the
 101 \fBsmbutil login\fR command (if any). If that password fails to authenticate,
 102 the \fBmount_smbfs\fR prompts you for a password.
 103 .RE
 104 .RS +4
 105 .TP
 106 .ie t \(bu
 107 .el o
 108 \fIserver\fR is the DNS or NetBIOS name of the remote computer.
 109 .RE
 110 .RS +4
 111 .TP
 112 .ie t \(bu
 113 .el o
 114 \fIshare\fR is the resource name on the remote server.
 115 .RE
 116 .RS +4
 117 .TP
 118 .ie t \(bu
 119 .el o
 120 \fIuser\fR is the remote user name. If \fIuser\fR is omitted, the logged in
 121 user ID is used.
 122 .RE
 123 .RS +4
 124 .TP
 125 .ie t \(bu
 126 .el o
 127 \fIworkgroup\fR is the name of the workgroup or the Windows domain in which the
 128 user name is defined.
 129 .sp
 130 If the resource includes a workgroup, you must escape the semicolon that
 131 appears after the workgroup name to prevent it from being interpreted by the
 132 command shell. For instance, surround the entire resource name with double
 133 quotes: \fBmount -F smbfs "//SALES;george@RSERVER" /mnt\fR.
 134 .RE
 135 .RE
 136 
 137 .sp
 138 .ne 2
 139 .na
 140 \fB\fImount-point\fR\fR
 141 .ad
 142 .sp .6
 143 .RS 4n
 144 The path to the location where the file system is to be mounted or unmounted.
 145 The \fBmount\fR command maintains a table of mounted file systems in the
 146 \fB/etc/mnttab\fR file. See the \fBmnttab\fR(4) man page.
 147 .RE
 148 
 149 .SH OPTIONS
 150 .sp
 151 .LP
 152 See the \fBmount\fR(1M) man page for the list of supported
 153 \fIgeneric-options\fR.
 154 .sp
 155 .ne 2
 156 .na
 157 \fB\fB-o\fR \fIname\fR\fB=\fR\fIvalue\fR or\fR
 158 .ad
 159 .br
 160 .na
 161 \fB\fB-o\fR \fIname\fR\fR
 162 .ad
 163 .sp .6
 164 .RS 4n
 165 Sets the file system-specific properties. You can specify more than one
 166 name-value pair as a list of comma-separated pairs. No spaces are permitted in
 167 the list. The properties are as follows:
 168 .sp
 169 .ne 2
 170 .na
 171 \fB\fBdirperms=\fR\fIoctaltriplet\fR\fR
 172 .ad
 173 .sp .6
 174 .RS 4n
 175 Specifies the permissions to be assigned to directories. The value must be
 176 specified as an octal triplet, such as \fB755\fR. The default value for the
 177 directory mode is taken from the \fBfileperms\fR setting, with execute
 178 permission added where \fBfileperms\fR has read permission.
 179 .sp
 180 Note that these permissions have no relation to the rights granted by the CIFS
 181 server.
 182 .RE
 183 
 184 .sp
 185 .ne 2
 186 .na
 187 \fB\fBfileperms=\fR\fIoctaltriplet\fR\fR
 188 .ad
 189 .sp .6
 190 .RS 4n
 191 Specifies the permissions to be assigned to files. The value must be specified
 192 as an octal triplet, such as \fB644\fR. The default value is \fB700\fR.
 193 .sp
 194 Note that these permissions have no relation to the rights granted by the CIFS
 195 server.
 196 .RE
 197 
 198 .sp
 199 .ne 2
 200 .na
 201 \fB\fBgid=\fR\fIgroupid\fR\fR
 202 .ad
 203 .sp .6
 204 .RS 4n
 205 Assigns the specified group ID to files. The default value is the group ID of
 206 the directory where the volume is mounted.
 207 .RE
 208 
 209 .sp
 210 .ne 2
 211 .na
 212 \fB\fBintr\fR|\fBnointr\fR\fR
 213 .ad
 214 .sp .6
 215 .RS 4n
 216 Enable (or disable) cancellation of \fBsmbfs\fR(7FS) I/O operations when the
 217 user interrupts the calling thread (for example, by hitting Ctrl-C while an
 218 operation is underway). The default is \fBintr\fR (interruption enabled), so
 219 cancellation is normally allowed.
 220 .RE
 221 
 222 .sp
 223 .ne 2
 224 .na
 225 \fB\fBnoprompt\fR\fR
 226 .ad
 227 .sp .6
 228 .RS 4n
 229 Suppresses the prompting for a password when mounting a share. This property
 230 enables you to permit anonymous access to a share. Anonymous access does not
 231 require a password.
 232 .sp
 233 The \fBmount\fR operation fails if a password is required, the \fBnoprompt\fR
 234 property is set, and no password is stored by the \fBsmbutil login\fR command.
 235 .RE
 236 
 237 .sp
 238 .ne 2
 239 .na
 240 \fB\fBretry_count=\fR\fInumber\fR\fR
 241 .ad
 242 .sp .6
 243 .RS 4n
 244 Specifies the number of SMBFS retries to attempt before the connection is
 245 marked as broken. By default, 4 attempts are made.
 246 .sp
 247 The \fBretry_count\fR property value set by the \fBmount\fR command overrides
 248 the global value set in SMF or the value set in your \fB\&.nsmbrc\fR file.
 249 .RE
 250 
 251 .sp
 252 .ne 2
 253 .na
 254 \fB\fBtimeout=\fR\fIseconds\fR\fR
 255 .ad
 256 .sp .6
 257 .RS 4n
 258 Specifies the CIFS request timeout. By default, the timeout is 15 seconds.
 259 .sp
 260 The \fBtimeout\fR property value set by the \fBmount\fR command overrides the
 261 global value set in SMF or the value set in your \fB\&.nsmbrc\fR file.
 262 .RE
 263 
 264 .sp
 265 .ne 2
 266 .na
 267 \fB\fBuid=\fR\fIuserid\fR\fR
 268 .ad
 269 .sp .6
 270 .RS 4n
 271 Assigns the specified user ID files. The default value is the owner ID of the
 272 directory where the volume is mounted.
 273 .RE
 274 
 275 .sp
 276 .ne 2
 277 .na
 278 \fB\fBxattr\fR|\fBnoxattr\fR\fR
 279 .ad
 280 .sp .6
 281 .RS 4n
 282 Enable (or disable) Solaris Extended Attributes in this mount point. This
 283 option defaults to \fBxattr\fR (enabled Extended Attributes), but note: if the
 284 CIFS server does not support CIFS "named streams", \fBsmbfs\fR(7FS) forces this
 285 option to \fBnoxattr\fR. When a mount has the \fBnoxattr\fR option, attempts to
 286 use Solaris Extended attributes fail with EINVAL.
 287 .RE
 288 
 289 .RE
 290 
 291 .sp
 292 .ne 2
 293 .na
 294 \fB\fB-O\fR\fR
 295 .ad
 296 .sp .6
 297 .RS 4n
 298 Overlays mount. Allow the file system to be mounted over an existing mount
 299 point, making the underlying file system inaccessible. If a mount is attempted
 300 on a pre-existing mount point without setting this flag, the mount fails,
 301 producing the error "device busy."
 302 .RE
 303 
 304 .SH EXAMPLES
 305 .LP
 306 \fBExample 1 \fRMounting an SMBFS Share
 307 .sp
 308 .LP
 309 The following example shows how to mount the \fB/tmp\fR share from the
 310 \fBnano\fR server in the \fBSALES\fR workgroup on the local \fB/mnt\fR mount
 311 point. You must supply the password for the \fBroot\fR user to successfully
 312 perform the mount operation.
 313 
 314 .sp
 315 .in +2
 316 .nf
 317 # \fBmount -F smbfs "//SALES;root@nano.sfbay/tmp" /mnt\fR
 318 Password:
 319 .fi
 320 .in -2
 321 .sp
 322 
 323 .LP
 324 \fBExample 2 \fRVerifying That an SMBFS File System Is Mounted
 325 .sp
 326 .LP
 327 The following example shows how to mount the \fB/tmp\fR share from the
 328 \fBnano\fR server on the local \fB/mnt\fR mount point. You must supply the
 329 password for the \fBroot\fR user to successfully perform the mount operation.
 330 
 331 .sp
 332 .in +2
 333 .nf
 334 # \fBmount -F smbfs //root@nano.sfbay/tmp /mnt\fR
 335 Password:
 336 .fi
 337 .in -2
 338 .sp
 339 
 340 .sp
 341 .LP
 342 You can verify that the share is mounted in the following ways:
 343 .RS +4
 344 .TP
 345 .ie t \(bu
 346 .el o
 347 View the file system entry in the \fB/etc/mnttab\fR file.
 348 .sp
 349 .in +2
 350 .nf
 351 # \fBgrep root /etc/mnttab\fR
 352 //root@nano.sfbay/tmp   /mnt    smbfs   dev=4900000     1177097833
 353 .fi
 354 .in -2
 355 .sp
 356 
 357 .RE
 358 .RS +4
 359 .TP
 360 .ie t \(bu
 361 .el o
 362 View the output of the \fBmount\fR command.
 363 .sp
 364 .in +2
 365 .nf
 366 # \fBmount | grep root\fR
 367 /mnt on //root@nano.sfbay/tmp read/write/setuid/devices/dev=4900000 on
 368 Fri Apr 20 13:37:13 2007
 369 .fi
 370 .in -2
 371 .sp
 372 
 373 .RE
 374 .RS +4
 375 .TP
 376 .ie t \(bu
 377 .el o
 378 View the output of the \fBdf /mnt\fR command.
 379 .sp
 380 .in +2
 381 .nf
 382 # \fBdf /mnt\fR
 383 /mnt               (//root@nano.sfbay/tmp): 3635872 blocks       -1 files
 384 .fi
 385 .in -2
 386 .sp
 387 
 388 .RE
 389 .sp
 390 .LP
 391 Obtain information about the mounted share by viewing the output of the \fBdf
 392 -k /mnt\fR command.
 393 
 394 .sp
 395 .in +2
 396 .nf
 397 # \fBdf -k /mnt\fR
 398 Filesystem            kbytes    used   avail capacity  Mounted on
 399 //root@nano.sfbay/tmp
 400                       1882384   64448 1817936     4%    /mnt
 401 .fi
 402 .in -2
 403 .sp
 404 
 405 .LP
 406 \fBExample 3 \fRUnmounting a CIFS Share
 407 .sp
 408 .LP
 409 This example assumes that a CIFS share has been mounted on the \fB/mnt\fR mount
 410 point. The following command line unmounts the share from the mount point.
 411 
 412 .sp
 413 .in +2
 414 .nf
 415 # \fBumount /mnt\fR
 416 .fi
 417 .in -2
 418 .sp
 419 
 420 .SH FILES
 421 .sp
 422 .ne 2
 423 .na
 424 \fB\fB/etc/mnttab\fR\fR
 425 .ad
 426 .sp .6
 427 .RS 4n
 428 Table of mounted file systems.
 429 .RE
 430 
 431 .sp
 432 .ne 2
 433 .na
 434 \fB\fB/etc/dfs/fstypes\fR\fR
 435 .ad
 436 .sp .6
 437 .RS 4n
 438 Default distributed file system type.
 439 .RE
 440 
 441 .sp
 442 .ne 2
 443 .na
 444 \fB\fB/etc/vfstab\fR\fR
 445 .ad
 446 .sp .6
 447 .RS 4n
 448 Table of automatically mounted resources.
 449 .RE
 450 
 451 .sp
 452 .ne 2
 453 .na
 454 \fB\fB$HOME/.nsmbrc\fR\fR
 455 .ad
 456 .sp .6
 457 .RS 4n
 458 User-settable mount point configuration file to store the description for each
 459 connection.
 460 .RE
 461 
 462 .SH ATTRIBUTES
 463 .sp
 464 .LP
 465 See the \fBattributes\fR(5) man page for descriptions of the following
 466 attributes:
 467 .sp
 468 
 469 .sp
 470 .TS
 471 box;
 472 c | c
 473 l | l .
 474 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 475 _
 476 Interface Stability     Committed
 477 .TE
 478 
 479 .SH SEE ALSO
 480 .sp
 481 .LP
 482 \fBsmbutil\fR(1), \fBmount\fR(1M), \fBmountall\fR(1M), \fBsvcadm\fR(1M),
 483 \fBacl\fR(2), \fBfcntl\fR(2), \fBlink\fR(2), \fBmknod\fR(2), \fBmount\fR(2),
 484 \fBsymlink\fR(2), \fBumount\fR(2), \fBmnttab\fR(4), \fBnsmbrc\fR(4),
 485 \fBvfstab\fR(4), \fBattributes\fR(5), \fBpcfs\fR(7FS), \fBsmbfs\fR(7FS)
 486 .SH AUTHORS
 487 .sp
 488 .LP
 489 This manual page contains material originally authored by Boris Popov,
 490 \fBbpATbutya.kz\fR, \fBbpATFreeBSD.org\fR.
 491 .SH NOTES
 492 .sp
 493 .LP
 494 The Solaris CIFS client always attempts to use \fBgethostbyname()\fR to resolve
 495 host names. If the host name cannot be resolved, the CIFS client uses NetBIOS
 496 name resolution (NBNS). By default, the Solaris CIFS client permits the use of
 497 NBNS to enable Solaris CIFS clients in Windows environments to work without
 498 additional configuration.
 499 .sp
 500 .LP
 501 Since NBNS has been exploited in the past, you might want to disable it. To
 502 disable NBNS, set the \fBnbns-enabled\fR service management facility property
 503 to \fBfalse\fR. By default, \fBnbns-enabled\fR is set to \fBtrue\fR.
 504 .sp
 505 .LP
 506 If the directory on which a file system is to be mounted is a symbolic link,
 507 the file system is mounted on the directory to which the symbolic link refers,
 508 rather than being mounted on top of the symbolic link itself.