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