6253 F_GETLK doesn't always return lock owner
[illumos-gate.git] / usr / src / man / man1m / mount_smbfs.1m
blob7ac485228400fc6fa2faf7901fdd7e43f29e66ba
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
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
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
30 .LP
31 .nf
32 \fB/sbin/umount\fR [\fB-F smbfs\fR] [\fIgeneric-options\fR] \fImount-point\fR
33 .fi
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
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.
104 .RS +4
106 .ie t \(bu
107 .el o
108 \fIserver\fR is the DNS or NetBIOS name of the remote computer.
110 .RS +4
112 .ie t \(bu
113 .el o
114 \fIshare\fR is the resource name on the remote server.
116 .RS +4
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.
123 .RS +4
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.
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.
138 .ne 2
140 \fB\fImount-point\fR\fR
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.
149 .SH OPTIONS
152 See the \fBmount\fR(1M) man page for the list of supported
153 \fIgeneric-options\fR.
155 .ne 2
157 \fB\fB-o\fR \fIname\fR\fB=\fR\fIvalue\fR or\fR
161 \fB\fB-o\fR \fIname\fR\fR
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:
169 .ne 2
171 \fB\fBdirperms=\fR\fIoctaltriplet\fR\fR
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.
180 Note that these permissions have no relation to the rights granted by the CIFS
181 server.
185 .ne 2
187 \fB\fBfileperms=\fR\fIoctaltriplet\fR\fR
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.
194 Note that these permissions have no relation to the rights granted by the CIFS
195 server.
199 .ne 2
201 \fB\fBgid=\fR\fIgroupid\fR\fR
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.
210 .ne 2
212 \fB\fBintr\fR|\fBnointr\fR\fR
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.
223 .ne 2
225 \fB\fBnoprompt\fR\fR
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.
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.
238 .ne 2
240 \fB\fBretry_count=\fR\fInumber\fR\fR
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.
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.
252 .ne 2
254 \fB\fBtimeout=\fR\fIseconds\fR\fR
256 .sp .6
257 .RS 4n
258 Specifies the CIFS request timeout. By default, the timeout is 15 seconds.
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.
265 .ne 2
267 \fB\fBuid=\fR\fIuserid\fR\fR
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.
276 .ne 2
278 \fB\fBxattr\fR|\fBnoxattr\fR\fR
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.
292 .ne 2
294 \fB\fB-O\fR\fR
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."
304 .SH EXAMPLES
306 \fBExample 1 \fRMounting an SMBFS Share
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.
315 .in +2
317 # \fBmount -F smbfs "//SALES;root@nano.sfbay/tmp" /mnt\fR
318 Password:
320 .in -2
324 \fBExample 2 \fRVerifying That an SMBFS File System Is Mounted
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.
332 .in +2
334 # \fBmount -F smbfs //root@nano.sfbay/tmp /mnt\fR
335 Password:
337 .in -2
342 You can verify that the share is mounted in the following ways:
343 .RS +4
345 .ie t \(bu
346 .el o
347 View the file system entry in the \fB/etc/mnttab\fR file.
349 .in +2
351 # \fBgrep root /etc/mnttab\fR
352 //root@nano.sfbay/tmp   /mnt    smbfs   dev=4900000     1177097833
354 .in -2
358 .RS +4
360 .ie t \(bu
361 .el o
362 View the output of the \fBmount\fR command.
364 .in +2
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
370 .in -2
374 .RS +4
376 .ie t \(bu
377 .el o
378 View the output of the \fBdf /mnt\fR command.
380 .in +2
382 # \fBdf /mnt\fR
383 /mnt               (//root@nano.sfbay/tmp): 3635872 blocks       -1 files
385 .in -2
391 Obtain information about the mounted share by viewing the output of the \fBdf
392 -k /mnt\fR command.
395 .in +2
397 # \fBdf -k /mnt\fR
398 Filesystem            kbytes    used   avail capacity  Mounted on
399 //root@nano.sfbay/tmp
400                       1882384   64448 1817936     4%    /mnt
402 .in -2
406 \fBExample 3 \fRUnmounting a CIFS Share
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.
413 .in +2
415 # \fBumount /mnt\fR
417 .in -2
420 .SH FILES
422 .ne 2
424 \fB\fB/etc/mnttab\fR\fR
426 .sp .6
427 .RS 4n
428 Table of mounted file systems.
432 .ne 2
434 \fB\fB/etc/dfs/fstypes\fR\fR
436 .sp .6
437 .RS 4n
438 Default distributed file system type.
442 .ne 2
444 \fB\fB/etc/vfstab\fR\fR
446 .sp .6
447 .RS 4n
448 Table of automatically mounted resources.
452 .ne 2
454 \fB\fB$HOME/.nsmbrc\fR\fR
456 .sp .6
457 .RS 4n
458 User-settable mount point configuration file to store the description for each
459 connection.
462 .SH ATTRIBUTES
465 See the \fBattributes\fR(5) man page for descriptions of the following
466 attributes:
471 box;
472 c | c
473 l | l .
474 ATTRIBUTE TYPE  ATTRIBUTE VALUE
476 Interface Stability     Committed
479 .SH SEE ALSO
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
489 This manual page contains material originally authored by Boris Popov,
490 \fBbpATbutya.kz\fR, \fBbpATFreeBSD.org\fR.
491 .SH NOTES
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.
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.
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.