summaryrefslogtreecommitdiffstats
path: root/mount/mount.8
blob: a47091dde4279b8f620c6d49e9ec1520a5626f34 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
.\" Copyright (c) 1980, 1989, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" 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 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.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, 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 OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)mount.8	6.17 (Berkeley) 8/5/91
.\"
.\" When you change this file, please add an update notice to the ones below:
.\"
.\" Sun Dec 27 12:10:38 1992: Updated by faith@cs.unc.edu
.\" Thu Jan 14 21:15:06 1993: Updated by faith@cs.unc.edu
.\" Mon Feb  1 21:18:21 1993: Updated by faith@cs.unc.edu
.\" Sat Mar  6 20:46:29 1993: Updated by faith@cs.unc.edu
.\" Sat Oct  9 08:56:26 1993: Updated by faith@cs.unc.edu
.\"          based on changes by Stephen Tweedie (sct@dcs.ed.ac.uk)
.\" Sat Oct  9 08:59:46 1993: Converted to man format by faith@cs.unc.edu
.\" Sat Nov 27 20:04:28 1993: File-system specific options documented by Rik
.\"          Faith (faith@cs.unc.edu), using extensive additions taken from
.\"          documentation written by Werner Almesberger
.\"          (almesber@nessie.cs.id.ethz.ch), and email written by Eric
.\"          Youngdale (eric@tantalus.nrl.navy.mil) and Remy Card
.\"          (Remy.Card@masi.ibp.fr).
.\" Sun Apr 24 19:25:59 1994: Updated per information supplied by Remy Card.
.\" Thu Jul 14 07:44:36 1994: Updated absence of -t
.\" option. (faith@cs.unc.edu)
.\" Thu Jul 14 07:49:14 1994: Updated list of valid filesystems.
.\" Wed Feb  8 09:25:48 1995: Updated man pages for Mike Grupenhoff's changes.
.\"
.TH MOUNT 8 "8 February 1995" "Linux 1.1" "Linux Programmer's Manual"
.SH NAME
mount, umount \- mount and dismount file systems
.SH SYNOPSIS
.BI "mount [\-afrwuvn] [\-t " vfstype ]
.br
.BI "mount [\-frwuvn] [\-o " remount " [,...]] " "special " | " node"
.br
.BI "mount [\-frwun] [\-t " vfstype "] [\-o " options "] " "special node"
.br
.BI "umount [\-an] [\-t " vfstype ]
.br
.BI "umount " "special " | " node"
.\" " for hilit19
.SH DESCRIPTION
The
.B mount
command calls the
.BR mount (2)
system call to prepare and graft a
.I special
device on to the file system tree at the point
.IR node .
If either
.IR special " or " node
are not provided, the appropriate information is taken from the
.BR fstab (5)
file.  The special keyword
.I none
can be used instead of a path or
.I node
specification.  This is useful when mounting the
.I proc
file system.

The system maintains a list of currently mounted file systems.  If no
arguments are given to
.BR mount ,
this list is printed.

Options available for the
.B mount
command:
.TP
.B \-f
Causes everything to be done except for the actual system call; if it's not
obvious, this ``fakes'' mounting the file system.  This option is useful in
conjunction with the
.B \-v
flag to determine what the
.B mount
command is trying to do.
.TP
.B \-o
Options are specified with a
.B \-o
flag followed by a comma separated string of options.
.B N.B.,
many of these options are only useful when they appear in the
.I /etc/fstab
file.  The following options apply to any file system that is being
mounted:
.RS
.TP
.B async
All I/O to the file system should be done asynchronously.
.TP
.B auto
Can be mounted with the
.B \-a
option.
.TP
.B defaults
Use default options:
.BR rw ", " suid ", " dev ", " exec ", " auto ", " nouser ", and " async.
.TP
.B dev
Interpret character or block special devices on the file system.
.TP
.B exec
Permit execution of binaries.
.TP
.B noauto
Can only be mounted explicitly (i.e., the
.B \-a
option will not cause the file system to be mounted).
.TP
.B nodev
Do not interpret character or block special devices on the file
system.  This options is useful for a server that has file systems
containing special devices for architectures other than its own.
.TP
.B noexec
Do not allow execution of any binaries on the mounted file system.
This options is useful for a server that has file systems containing
binaries for architectures other than its own.
.TP
.B nosuid
Do not allow set-user-identifier or set-group-identifier bits to take
effect.
.TP
.B nouser
Forbid an ordinary (i.e., non-root) user to mount the file system.
.TP
.B remount
Attempt to remount an already-mounted file system.  This is commonly
used to change the mount flags for a file system, especially to make a
readonly file system writeable.
.TP
.B ro
Mount the file system read-only.
.TP
.B rw
Mount the file system read-write.
.TP
.B suid
Allow set-user-identifier or set-group-identifier bits to take
effect.
.TP
.B sync
All I/O to the file system should be done synchronously.
.TP
.B user
Allow an ordinary user to mount the file system.  Ordinary users always
have the following options activated:
.BR noexec ", " nosuid ", and " nodev
(unless overridden by the superuser by using, for example, the following
option line:
.BR user,exec,dev,suid .
.PP
The following options apply only to certain file systems:
.TP
.BI case= value
For the
.I hpfs
file system, specify case as
.I lower
or
.IR asis .
.TP
.BI check= value
Tells the
.I ext2
file sysem kernel code to do some more checks while the file system is
mounted.  Currently (0.99.15), the following values can be specified with
this option:
.RS
.TP
.I none
no extra check is performed by the kernel code
.TP
.I normal
The inodes and blocks bitmaps are checked when the file system is mounted
(this is the default)
.TP
.I strict
In addition to the
.I normal
checks, block deallocation checks that the block to free is in the data
zone.
.RE
.TP
.BI check= value
For the
.I msdos
file system, three different levels of pickyness can be chosen:
.RS
.TP
.I relaxed
Upper and lower case are accepted and equivalent, long name parts are
truncated (e.g. verlongname.foobar becomes verylong.foo), leading and
embedded spaces are accepted in each name part (name and extension).
.TP
.I normal
Like "relaxed", but many special characters (*, ?, <, spaces, etc.) are
rejected.  This is the default.
.TP
.I strict
Like "normal", but names may not contain long parts and special characters
that are sometimes used on Linux, but are not accepted by MS-DOS are
rejected. (+, =, spaces, etc.)
.RE
.TP
.BI conv= value
For the
.IR msdos ,
.IR hpfs ,
and
.I iso9660
file systems, specify file conversion as
.IR binary ", " text ", or " auto .
The
.I iso9660
file system also allows
.I value
to be
.IR mtext .

The
.I msdos
file system can perform CRLF<-->NL (MS-DOS text format to UNIX text
format) conversion in the kernel. The following conversion modes are
available:
.RS
.TP
.I binary
no translation is performed.  This is the default.
.TP
.I text
CRLF<-->NL translation is performed on all files.
.TP
.I auto
CRLF<-->NL translation is performed on all files that don't have a
"well-known binary" extension. The list of known extensions can be found at
the beginning of
.I fs/msdos/misc.c
(as of 09913r, the list is: exe, com, bin, app, sys, drv, ovl, ovr, obj,
lib, dll, pif, arc, zip, lha, lzh, zoo, tar, z, arj, tz, taz, tzp, tpz,
gif, bmp, tif, gl, jpg, pcx, tfm, vf, gf, pk, pxl, dvi).
.PP
Programs that do computed lseeks won't like in-kernel text conversion.

For file systems mounted in
.B binary
mode, a conversion tool (fromdos/todos) is available.
.RE
.TP
.BI block= value
For the
.I iso9660
file system, set the blocksize.
.TP
.B bsdgroups
See
.B grpid
.TP
.B cruft
For the
.I iso9660
file system, set the
.I cruft
flag to 'y'.  This option is available because there are buggy premastering
programs out there that leave junk in the top byte of the file size.  This
option clears the top byte, but restricts files to 16Mb maximum in the
process.
.TP
.B debug
For the
.I msdos
file system, turn on the
.I debug
flag.  A version string and a list of file system parameters will be
printed (these data are also printed if the parameters appear to be
inconsistent).
.TP
.B debug
For the
.I ext2fs
file system, causes the kernel code to display the file system parameters
when the file system is mounted.
.TP
.BI errors= value
For the
.I ext2fs
file system, specifies the error behavior:
.RS
.TP
.B continue
No special action is taken on errors (except marking the file system as
erroneous).  This is the default.
.TP
.B remount
.TP
.B ro
The file system is remounted read only, and subsequent writes are refused.
.TP
.B panic
When an error is detected, the system panics.
.RE
.TP
.BI fat= value
For the
.I msdos
file system, specify either a 12 bit fat or a 16 bit fat.  This overrides
the automatic FAT type detection routine.  Use with caution!
.TP
.BI gid= value
For the
.I msdos
and
.I hpfs
file systems, give every file a gid equal to
.IR value .
.TP
B grpid
Causes the
.I ext2fs
to use the BSD behavior when creating files: file are created with the
group id of their parent directory.
.TP
.BI map= value
For the
.I iso9660
file system, specify mapping as
.IR off " or " normal .
In general, non-Rock Ridge discs have all of the filenames in upper case,
and all of the filenames have a ";1" appended.  The map option strips the
";1" and makes the name lower case.  C.f.
.BR norock .
.TP
.B nocheck
For the
.IR ext2fs ,
turns of checking (see
.BR check=none ).
.TP
.B nogrpid
Causes the
.I ext2fs
to use the System V behaviour when creating files: files are created with
the group id of the creating process, unless the setgid bit is set on the
parent directory.  This is the default for all Linux file systems.
.TP
.B norock
Normal
.I iso9600
filenames appear in a 8.3 format (i.e., DOS-like restrictions on filename
length), and in addition all characters are in upper case.  Also there is
no field for file ownership, protection, number of links, provision for
block/character devices, etc.

Rock Ridge is an extension to iso9660 that provides all of these unix like
features.  Basically there are extensions to each directory record that
supply all of the additional information, and when Rock Ridge is in use,
the filesystem is indistinguishable from a normal UNIX file system (except
that it is read-only, of course).

The
.B norock
switch disables the use of Rock Ridge extensions, even if available.  C.f.
.BR map .
.TP
.B quiet
For the
.I msdos
file system, turn on the
.I quiet
flag.  Attempts to chown or chmod files do not yield errors, although they
fail. Use with caution!
.TP
.BI sb= value
For the
.I ext2
file system, use an alternate superblock located at block
.IR value .
.I value
is numbered in 1024 bytes blocks.  An
.I ext2
file system usually has backups of the super block at blocks 1, 8193, 16385
and so on.
.TP
.BI sysvgroups
See
.B nogrpid
.TP
.BI uid= value
For the
.I msdos
and
.I hpfs
file systems, give every file a uid equal to
.IR value .
.TP
.BI umask= value
For the
.I msdos
and
.I hpfs
file systems, give every file a umask of
.IR value .
The radix defaults to octal.
.PP
The full set of options applied is determined by first extracting the
options for the file system from the
.B fstab
table, then applying any options specified by the
.B \-o
argument, and finally applying the
.BR \-r " or " \-w
option.

If the
.I msdos
file system detects an inconsistency, it reports an error and sets the file
system read-only. The file system can be made writeable again by remounting
it.
.RE
.TP
.B \-r
The file system object is to be mounted read-only.
.TP
.BI \-t " vfstype"
The argument following the
.B \-t
is used to indicate the file system type.  The file system types which are
currently supported are listed in
.IR linux/fs/filesystems.c :
.IR minux ", " ext ", " ext2 ", " xiafs ", " msdos ", " hpfs ,
.IR proc ", " nfs ", " iso9660 ", " sysv ", " xenix ", " coherent .
Note that that last three are equivalent and that "xenix" and "coherent"
will be removed at some point in the future \(em use "sysv" instead.

The type
.I minix
is the default.  If no
.B \-t
option is given, the superblock is probed for the filesystem type (minix,
ext, ext2, xia are supported).  If this probe fails and
.I /proc/filesystems
exists, then all of the filesystems listed will be tried,
.I except
for those that are labeled "nodev" (e.g., "proc" and "nfs").

For example, the
.B mount
command:
.RS

.RS
mount -a -t nomsdos,ext
.RE

mounts all file systems except those of type
.I msdos
and
.IR ext .
.RE
.TP
.B \-v
Verbose mode.
.TP
.B \-w
The file system object is to be read and write.
.TP
.B \-n
Mount without writing in
.IR /etc/mtab .
.PP
.B Umount
removes the
.I special
device grafted at point
.I node
from file system tree.

Options for the
.B umount
command:
.TP
.B \-a
All of the file systems described in
.I /etc/mtab
are unmounted.
.TP
.BI \-t " vfstype"
Is used to indicate the actions should only be taken on file systems of the
specified type.  More than one type may be specified in a comma separated
list.  The list of file system types can be prefixed with ``no'' to specify
the file system types on which no action should be taken.  (See example
above for the
.B mount
command.)

.SH FILES
.I /etc/fstab
file system table
.br
.I /etc/mtab~
lock file
.br
.I /etc/mtab.tmp
temporary file
.SH "SEE ALSO"
.BR mount "(2), " umount "(2), " fstab "(5), " swapon (8)
.SH BUGS
It is possible for a corrupted file system to cause a crash.
.PP
Some Linux file systems don't support
.BI \-o " synchronous"
(the ext2fs
.I does
support synchronous updates (a la BSD) when mounted with the
.B sync
option).
.PP
The
.BI \-o " remount"
may not be able to change mount parameters (all
.I ext2fs
parameters, except
.BR  sb ,
are changeable with a remount, for example, but you can't change
.B gid
or
.B umask
for the
.IR dosfs ).
.SH HISTORY
A
.B mount
command appeared in Version 6 AT&T UNIX.
.SH "AUTHORS AND CONTRIBUTORS"
.na
The Linux
.B mount
command has a long and continuing history.  Major releases are noted below,
with the name of the primary modifier noted:
.sp
0.97.3: Doug Quale (quale@saavik.cs.wisc.edu).
.br
0.98.5: H. J. Lu (hlu@eecs.wsu.edu).
.br
0.99.2: Rick Sladkey (jrs@world.std.com).
.br
0.99.6: Rick Sladkey (jrs@world.std.com).
.br
0.99.10: Stephen Tweedie (sct@dcs.ed.ac.uk).
.br
0.99.14: Rick Sladkey (jrs@world.std.com).
.sp
(File-system specific information added to man page on 27 November 1993 by
Rik Faith with lots of information
.I and text
from the following file system authors: Werner Almesberger, Eric Youngdale,
and Remy Card.)