42
42
.TH MOUNT 8 "2004-12-16" "Linux 2.6" "Linux Programmer's Manual"
44
mount \- mount a file system
44
mount \- mount a filesystem
48
.BI "mount \-a [\-fFnrsvw] [\-t " vfstype "] [\-O " optlist ]
50
.BI "mount [\-fnrsvw] [\-o " options " [,...]] " "device " | " dir"
52
.BI "mount [\-fnrsvw] [\-t " vfstype "] [\-o " options "] " "device dir"
59
.IR option [ \fB,\fPoption ]...]
54
70
All files accessible in a Unix system are arranged in one big
55
71
tree, the file hierarchy, rooted at
57
73
These files can be spread out over several devices. The
59
command serves to attach the file system found on some device
75
command serves to attach the filesystem found on some device
60
76
to the big file tree. Conversely, the
62
78
command will detach it again.
96
112
prints a version string
98
.BI "mount [-l] [-t" " type" ]
99
lists all mounted file systems (of type
114
.BR "mount " [ -l "] [" "-t \fItype\fP" ]
115
lists all mounted filesystems (of type
101
117
The option \-l adds the labels in this listing.
107
.\" In fact since 2.3.99. At first the syntax was mount -t bind.
108
Since Linux 2.4.0 it is possible to remount part of the
109
file hierarchy somewhere else. The call is
112
.B "mount --bind olddir newdir"
117
.B "mount -B olddir newdir"
122
.B "/olddir /newdir none bind"
125
After this call the same contents is accessible in two places.
126
One can also remount a single file (on a single file).
128
This call attaches only (part of) a single filesystem, not possible
129
submounts. The entire file hierarchy including submounts is attached
133
.B "mount --rbind olddir newdir"
138
.B "mount -R olddir newdir"
140
.\" available since Linux 2.4.11.
142
Note that the filesystem mount options will remain the same as those
143
on the original mount point, and cannot be changed by passing the -o
144
option along with --bind/--rbind.
147
.B The move operation.
149
Since Linux 2.5.1 it is possible to atomically move a mounted tree
150
to another place. The call is
153
.B "mount --move olddir newdir"
158
.B "mount -M olddir newdir"
162
.B The shared subtrees operations.
164
Since Linux 2.6.15 it is possible to mark a mount and its submounts as shared,
165
private, slave or unbindable. A shared mount provides ability to create mirrors
166
of that mount such that mounts and umounts within any of the mirrors propagate
167
to the other mirror. A slave mount receives propagation from its master, but
168
any not vice-versa. A private mount carries no propagation abilities. A
169
unbindable mount is a private mount which cannot cloned through a bind
170
operation. Detailed semantics is documented in Documentation/sharedsubtree.txt
171
file in the kernel source tree.
175
.B "mount --make-shared mountpoint"
176
.B "mount --make-slave mountpoint"
177
.B "mount --make-private mountpoint"
178
.B "mount --make-unbindable mountpoint"
182
The following commands allows one to recursively change the type of all the
183
mounts under a given mountpoint.
187
.B "mount --make-rshared mountpoint"
188
.B "mount --make-rslave mountpoint"
189
.B "mount --make-rprivate mountpoint"
190
.B "mount --make-runbindable mountpoint"
196
.B The device indication.
198
Most devices are indicated by a file name (of a block special device), like
200
but there are other possibilities. For example, in the case of an NFS mount,
203
.IR knuth.cwi.nl:/dir .
204
It is possible to indicate a block special device using its
209
(see the \-L and \-U options below).
211
.B The device indication.
213
Most devices are indicated by a file name (of a block special device), like
215
but there are other possibilities. For example, in the case of an NFS mount,
218
.IR knuth.cwi.nl:/dir .
219
It is possible to indicate a block special device using its
224
(see the \-L and \-U options below).
121
.B The device indication.
123
Most devices are indicated by a file name (of a block special device), like
125
but there are other possibilities. For example, in the case of an NFS mount,
128
.IR knuth.cwi.nl:/dir .
129
It is possible to indicate a block special device using its
134
(see the \-L and \-U options below).
136
The recommended setup is to use LABEL=<label> or UUID=<uuid> tags rather than
137
.B /dev/disk/by-{label,uuid}
138
udev symlinks in the /etc/fstab file. The tags are
139
more readable, robust and portable. The mount(8) command internally uses udev
140
symlinks, so use the symlinks in /etc/fstab is not advantage over LABEL=/UUID=.
141
For more details see libblkid(3).
228
file system is not associated with a special device, and when
145
filesystem is not associated with a special device, and when
229
146
mounting it, an arbitrary keyword, such as
231
148
can be used instead of a device specification.
351
273
member of the group of the special file.
279
.\" In fact since 2.3.99. At first the syntax was mount -t bind.
280
Since Linux 2.4.0 it is possible to remount part of the
281
file hierarchy somewhere else. The call is
301
After this call the same contents is accessible in two places.
302
One can also remount a single file (on a single file).
304
This call attaches only (part of) a single filesystem, not possible
305
submounts. The entire file hierarchy including submounts is attached
318
.\" available since Linux 2.4.11.
320
Note that the filesystem mount options will remain the same as those
321
on the original mount point, and cannot be changed by passing the -o
322
option along with --bind/--rbind. The mount options can be
323
changed by a separate remount command, for example:
330
.B mount -o remount,ro
336
.B The move operation.
338
Since Linux 2.5.1 it is possible to atomically move a mounted tree
339
to another place. The call is
351
This will cause the contents which previously appeared under olddir to be
352
accessed under newdir. The physical location of the files is not changed.
355
.B The shared subtrees operations.
357
Since Linux 2.6.15 it is possible to mark a mount and its submounts as shared,
358
private, slave or unbindable. A shared mount provides ability to create mirrors
359
of that mount such that mounts and umounts within any of the mirrors propagate
360
to the other mirror. A slave mount receives propagation from its master, but
361
any not vice-versa. A private mount carries no propagation abilities. A
362
unbindable mount is a private mount which cannot cloned through a bind
363
operation. Detailed semantics is documented in Documentation/sharedsubtree.txt
364
file in the kernel source tree.
368
.BI "mount --make-shared " mountpoint
369
.BI "mount --make-slave " mountpoint
370
.BI "mount --make-private " mountpoint
371
.BI "mount --make-unbindable " mountpoint
375
The following commands allows one to recursively change the type of all the
376
mounts under a given mountpoint.
380
.BI "mount --make-rshared " mountpoint
381
.BI "mount --make-rslave " mountpoint
382
.BI "mount --make-rprivate " mountpoint
383
.BI "mount --make-runbindable " mountpoint
354
388
.SH COMMAND LINE OPTIONS
355
389
The full set of mount options used by an invocation of
357
391
is determined by first extracting the
358
mount options for the file system from the
392
mount options for the filesystem from the
360
394
table, then applying any options specified by the
417
443
.BR xfs_admin (8),
418
444
or for reiserfs using
419
445
.BR reiserfstune (8).
446
.IP "\fB\-n, \-\-no\-mtab\fP"
422
447
Mount without writing in
424
449
This is necessary for example when
426
is on a read-only file system.
451
is on a read-only filesystem.
452
.IP "\fB\-\-no\-canonicalize\fP"
453
Don't canonicalize paths. The mount command canonicalizes all paths
454
(from command line or fstab) and stores canonicalized paths to the
456
file. This option can be used together with the
458
flag for already canonicalized absolut paths.
459
.IP "\fB\-p, \-\-pass\-fd \fInum\fP"
429
460
In case of a loop mount with encryption, read the passphrase from
432
463
instead of from the terminal.
435
465
Tolerate sloppy mount options rather than failing. This will ignore
436
466
mount options not supported by a filesystem type. Not all filesystems
437
467
support this option. This option exists for support of the Linux
438
468
autofs\-based automounter.
441
Mount the file system read-only. A synonym is
469
.IP "\fB\-r, \-\-read\-only\fP"
470
Mount the filesystem read-only. A synonym is
444
473
Note that, depending on the filesystem type, state and kernel behavior, the
446
475
journal if the filesystem is dirty. To prevent this kind of write access, you
447
476
may want to mount ext3 or ext4 filesystem with "ro,noload" mount options or
448
477
set the block device to read-only mode, see command
453
Mount the file system read/write. This is the default. A synonym is
479
.IP "\fB\-w, \-\-rw\fP"
480
Mount the filesystem read/write. This is the default. A synonym is
482
.IP "\fB\-L \fIlabel\fP"
457
483
Mount the partition that has the specified
485
.IP "\fB\-U \fIuuid\fP"
461
486
Mount the partition that has the specified
463
488
These two options require the file
464
489
.I /proc/partitions
465
490
(present since Linux 2.1.116) to exist.
491
.IP "\fB\-t, \-\-types \fIvfstype\fP"
468
492
The argument following the
470
is used to indicate the file system type. The file system types which are
494
is used to indicate the filesystem type. The filesystem types which are
471
495
currently supported include:
534
560
system call, and no detailed knowledge of the filesystem type is required.
535
561
For a few types however (like nfs, nfs4, cifs, smbfs, ncpfs) ad hoc code is
536
necessary. The nfs, nfs4, cifs, smbfs, and ncpfs
562
necessary. The nfs, nfs4, cifs, smbfs, and ncpfs filesystems
537
563
have a separate mount program. In order to make it possible to
538
564
treat all types in a uniform way, mount will execute the program
565
.BI /sbin/mount. TYPE
540
566
(if that exists) when called with type
542
568
Since various versions of the
544
570
program have different calling conventions,
546
572
may have to be a shell script that sets up the desired call.
584
610
More than one type may be specified in a comma separated
585
list. The list of file system types can be prefixed with
611
list. The list of filesystem types can be prefixed with
587
to specify the file system types on which no action should be taken.
613
to specify the filesystem types on which no action should be taken.
588
614
(This can be meaningful with the
592
For example, the command:
616
option.) For example, the command:
594
620
.B "mount \-a \-t nomsdos,ext"
596
mounts all file systems except those of type
623
mounts all filesystems except those of type
628
.IP "\fB\-O, \-\-test-opts \fIopts\fP"
602
629
Used in conjunction with
604
631
to limit the set of filesystems to which the
675
701
in the system kernel. To check the current setting see the options
678
The following options apply to any file system that is being
679
mounted (but not every file system actually honors them - e.g., the
704
The following options apply to any filesystem that is being
705
mounted (but not every filesystem actually honors them - e.g., the
681
707
option today has effect only for ext2, ext3, fat, vfat and ufs):
685
All I/O to the file system should be done asynchronously. (See also the
711
All I/O to the filesystem should be done asynchronously. (See also the
690
Update inode access time for each access. This is the default.
716
Update inode access time for each access. See also the
693
Do not update inode access times on this file system (e.g, for faster
721
Do not update inode access times on this filesystem (e.g, for faster
694
722
access on the news spool to speed up news servers).
890
Mount the file system read-only.
924
Mount the filesystem read-only.
893
Mount the file system read-write.
927
Mount the filesystem read-write.
896
All I/O to the file system should be done synchronously. In case of media with limited number of write cycles
930
All I/O to the filesystem should be done synchronously. In case of media with limited number of write cycles
897
931
(e.g. some flash drives) "sync" may cause life-cycle shortening.
900
Allow an ordinary user to mount the file system.
934
Allow an ordinary user to mount the filesystem.
901
935
The name of the mounting user is written to mtab so that he can unmount
902
the file system again.
936
the filesystem again.
903
937
This option implies the options
904
938
.BR noexec ", " nosuid ", and " nodev
905
939
(unless overridden by subsequent options, as in the option line
906
940
.BR user,exec,dev,suid ).
909
Forbid an ordinary (i.e., non-root) user to mount the file system.
943
Forbid an ordinary (i.e., non-root) user to mount the filesystem.
910
944
This is the default.
913
Allow every user to mount and unmount the file system.
947
Allow every user to mount and unmount the filesystem.
914
948
This option implies the options
915
949
.BR noexec ", " nosuid ", and " nodev
916
950
(unless overridden by subsequent options, as in the option line
917
951
.BR users,exec,dev,suid ).
919
953
.SH "FILESYSTEM SPECIFIC MOUNT OPTIONS"
920
The following options apply only to certain file systems.
921
We sort them by file system. They all follow the
954
The following options apply only to certain filesystems.
955
We sort them by filesystem. They all follow the
1086
1120
.SH "Mount options for ext"
1088
Note that the `ext' file system is obsolete. Don't use it.
1122
Note that the `ext' filesystem is obsolete. Don't use it.
1089
1123
Since Linux version 2.1.21 extfs is no longer part of the kernel source.
1091
1125
.SH "Mount options for ext2"
1092
The `ext2' file system is the standard Linux file system.
1126
The `ext2' filesystem is the standard Linux filesystem.
1093
1127
.\" Due to a kernel bug, it may be mounted with random mount options
1094
1128
.\" (fixed in Linux 2.0.4).
1095
1129
Since Linux 2.5.46, for most mount options the default
1096
1130
is determined by the filesystem superblock. Set them with
1097
1131
.BR tune2fs (8).
1100
1134
Support POSIX Access Control Lists (or not).
1101
1135
.\" requires CONFIG_EXT2_FS_POSIX_ACL
1103
.BR bsddf " / " minixdf
1104
1138
Set the behaviour for the
1106
1140
system call. The
1108
1142
behaviour is to return in the
1110
field the total number of blocks of the file system, while the
1144
field the total number of blocks of the filesystem, while the
1112
1146
behaviour (which is the default) is to subtract the overhead blocks
1113
used by the ext2 file system and not available for file storage. Thus
1147
used by the ext2 filesystem and not available for file storage. Thus
1116
1150
% mount /k -o minixdf; df /k; umount /k
1136
1170
Print debugging info upon each (re)mount.
1138
.BR errors=continue " / " errors=remount-ro " / " errors=panic
1172
.BR errors= { continue | remount-ro | panic }
1139
1173
Define the behaviour when an error is encountered.
1140
(Either ignore errors and just mark the file system erroneous and continue,
1141
or remount the file system read-only, or panic and halt the system.)
1174
(Either ignore errors and just mark the filesystem erroneous and continue,
1175
or remount the filesystem read-only, or panic and halt the system.)
1142
1176
The default is set in the filesystem superblock, and can be
1144
1178
.BR tune2fs (8).
1146
.BR grpid " or " bsdgroups " / " nogrpid " or " sysvgroups
1180
.BR grpid | bsdgroups " and " nogrpid | sysvgroups
1147
1181
These options define what group id a newly created file gets.
1191
1225
The block number here uses 1k units. Thus, if you want to use logical
1192
1226
block 32768 on a filesystem with 4k blocks, use "sb=131072".
1194
.BR user_xattr " / " nouser_xattr
1228
.BR user_xattr | nouser_xattr
1195
1229
Support "user." extended attributes (or not).
1196
1230
.\" requires CONFIG_EXT2_FS_XATTR
1199
1233
.SH "Mount options for ext3"
1200
The `ext3' file system is a version of the ext2 file system which has been
1234
The ext3 filesystem is a version of the ext2 filesystem which has been
1201
1235
enhanced with journalling. It supports the same options as ext2 as
1202
1236
well as the following additions:
1205
.\" Mount the file system in abort mode, as if a fatal error has occurred.
1239
.\" Mount the filesystem in abort mode, as if a fatal error has occurred.
1207
1241
.BR journal=update
1208
Update the ext3 file system's journal to the current format.
1242
Update the ext3 filesystem's journal to the current format.
1210
1244
.BR journal=inum
1211
1245
When a journal already exists, this option is ignored. Otherwise, it
1212
specifies the number of the inode which will represent the ext3 file system's
1246
specifies the number of the inode which will represent the ext3 filesystem's
1213
1247
journal file; ext3 will create a new journal, overwriting the old contents
1214
1248
of the file whose inode number is
1218
Do not load the ext3 file system's journal on mounting.
1252
Do not load the ext3 filesystem's journal on mounting.
1220
.BR data=journal " / " data=ordered " / " data=writeback
1254
.BR data= { journal | ordered | writeback }
1221
1255
Specifies the journalling mode for file data. Metadata is always journaled.
1222
1256
To use modes other than
1224
on the root file system, pass the mode to the kernel as boot parameter, e.g.
1258
on the root filesystem, pass the mode to the kernel as boot parameter, e.g.
1225
1259
.IR rootflags=data=journal .
1229
1263
All data is committed into the journal prior to being written into the
1233
1267
This is the default mode. All data is forced directly out to the main file
1237
1271
Data ordering is not preserved - data may be written into the main
1238
file system after its metadata has been committed to the journal.
1272
filesystem after its metadata has been committed to the journal.
1239
1273
This is rumoured to be the highest-throughput option. It guarantees
1240
internal file system integrity, however it can allow old data to appear
1274
internal filesystem integrity, however it can allow old data to appear
1241
1275
in files after a crash and journal recovery.
1278
.BR barrier=0 " / " barrier=1 "
1279
This enables/disables barriers. barrier=0 disables it, barrier=1 enables it.
1280
Write barriers enforce proper on-disk ordering of journal commits, making
1281
volatile disk write caches safe to use, at some performance penalty. The ext3
1282
filesystem does not enable write barriers by default. Be sure to enable
1283
barriers unless your disks are battery-backed one way or another. Otherwise
1284
you risk filesystem corruption in case of power failure.
1244
1286
.BI commit= nrsec
1245
1287
Sync all data and metadata every
1723
1768
option was previously specified in order to restore normal behavior.
1725
.BR errors=continue " / " errors=remount-ro " / " errors=panic
1770
.BR errors= { continue | remount-ro | panic }
1726
1771
Define the behaviour when an error is encountered.
1727
(Either ignore errors and just mark the file system erroneous and continue,
1728
or remount the file system read-only, or panic and halt the system.)
1772
(Either ignore errors and just mark the filesystem erroneous and continue,
1773
or remount the filesystem read-only, or panic and halt the system.)
1730
.BR noquota " / " quota " / " usrquota " / " grpquota
1775
.BR noquota | quota | usrquota | grpquota
1731
1776
These options are accepted but ignored.
1733
1778
.SH "Mount options for minix"
1826
1871
A hash invented by Yury Yu. Rupasov. It is fast and preserves locality,
1827
1872
mapping lexicographically close file names to close hash values.
1828
1873
This option should not be used, as it causes a high probability of hash
1832
1877
A Davis-Meyer function implemented by Jeremy Fitzhardinge.
1833
1878
It uses hash permuting bits in the name. It gets high randomness
1834
1879
and, therefore, low probability of hash collisions at some CPU cost.
1835
This may be used if EHASHCOLLISION errors are experienced with the r5 hash.
1880
This may be used if EHASHCOLLISION errors are experienced with the r5 hash.
1838
1883
A modified version of the rupasov hash. It is used by default and is
1839
the best choice unless the file system has huge directories and
1840
unusual file-name patterns.
1884
the best choice unless the filesystem has huge directories and
1885
unusual file-name patterns.
1845
1890
to detect which hash function is in use by examining
1846
the file system being mounted, and to write this information into
1891
the filesystem being mounted, and to write this information into
1847
1892
the reiserfs superblock. This is only useful on the first mount of
1848
an old format file system.
1893
an old format filesystem.
1851
1896
.BR hashed_relocation
1852
1897
Tunes the block allocator. This may provide performance improvements
1855
1900
.BR no_unhashed_relocation
1856
1901
Tunes the block allocator. This may provide performance improvements
1901
1946
Enable POSIX Access Control Lists. See the
1950
.BR barrier=none " / " barrier=flush "
1951
This enables/disables the use of write barriers in the journaling code.
1952
barrier=none disables it, barrier=flush enables it. Write barriers enforce
1953
proper on-disk ordering of journal commits, making volatile disk write caches
1954
safe to use, at some performance penalty. The reiserfs filesystem does not
1955
enable write barriers by default. Be sure to enable barriers unless your disks
1956
are battery-backed one way or another. Otherwise you risk filesystem
1957
corruption in case of power failure.
1905
1959
.SH "Mount options for romfs"
1962
.SH "Mount options for squashfs"
1908
1965
.SH "Mount options for smbfs"
1910
1967
.IR nfs ", the " smbfs
1994
2051
on MountPoint, by 'mount -o remount,mpol=Policy:NodeList MountPoint'.
2054
.SH "Mount options for ubifs"
2055
UBIFS is a flash file system which works on top of UBI volumes. Note that
2058
is not supported and is always turned off.
2060
The device name may be specified as
2088
separator may be used instead of
2091
The following mount options are available:
2094
Enable bulk-read. VFS read-ahead is disabled because it slows down the file
2095
system. Bulk-Read is an internal optimization. Some flashes may read faster if
2096
the data are read at one go, rather than at several read requests. For
2097
example, OneNAND can do "read-while-load" if it reads more than one NAND page.
2100
Do not bulk-read. This is the default.
2103
Check data CRC-32 checksums. This is the default.
2105
.BR no_chk_data_crc.
2106
Do not check data CRC-32 checksums. With this option, the filesystem does not
2107
check CRC-32 checksum for data, but it does check it for the internal indexing
2108
information. This option only affects reading, not writing. CRC-32 is always
2109
calculated when writing the data.
2111
.BR compr= { none | lzo | zlib }
2112
Select the default compressor which is used when new files are written. It is
2113
still possible to read compressed files if mounted with the
1997
2117
.SH "Mount options for udf"
1998
2118
udf is the "Universal Disk Format" filesystem defined by the Optical
1999
2119
Storage Technology Association, and is often used for DVD-ROM.
2167
2287
Display the short name as is; store a long name when the short name is not
2168
2288
all upper case.
2173
2292
.SH "Mount options for usbfs"
2175
2294
\fBdevuid=\fP\fIuid\fP and \fBdevgid=\fP\fIgid\fP and \fBdevmode=\fP\fImode\fP
2176
Set the owner and group and mode of the device files in the usbfs file system
2295
Set the owner and group and mode of the device files in the usbfs filesystem
2177
2296
(default: uid=gid=0, mode=0644). The mode is given in octal.
2179
2298
\fBbusuid=\fP\fIuid\fP and \fBbusgid=\fP\fIgid\fP and \fBbusmode=\fP\fImode\fP
2180
2299
Set the owner and group and mode of the bus directories in the usbfs
2181
file system (default: uid=gid=0, mode=0555). The mode is given in octal.
2300
filesystem (default: uid=gid=0, mode=0555). The mode is given in octal.
2183
2302
\fBlistuid=\fP\fIuid\fP and \fBlistgid=\fP\fIgid\fP and \fBlistmode=\fP\fImode\fP
2184
2303
Set the owner and group and mode of the file