mount - mount a file system
mount [-lhV]
mount -a [-fFnrsvw] [-t vfstype] [-O optlist]
mount [-fnrsvw] [-o options [,...]] device | dir
mount [-fnrsvw] [-t vfstype] [-o options] device dir
All files accessible in a Unix system are arranged in one bigtree, the file hierarchy, rooted at/. These files can be spread out over several devices. Themount command serves to attach the file system found on some deviceto the big file tree. Conversely, theumount(8)command will detach it again.
The standard form of themount command, is
mount -t type device dir This tells the kernel to attach the file system found ondevice (which is of typetype) at the directorydir. The previous contents (if any) and owner and mode ofdir become invisible, and as long as this file system remains mounted,the pathnamedir refers to the root of the file system ondevice.
Three forms of invocation do not actually mount anything:
mount -h prints a help message;
mount -V prints a version string; and justmount [-l] [-t type] lists all mounted file systems (of typetype). The option -l adds the (ext2, ext3 and XFS) labels in this listing.See below.
Since Linux 2.4.0 it is possible to remount part of thefile hierarchy somewhere else. The call is
mount --bind olddir newdir After this call the same contents is accessible in two places.One can also remount a single file (on a single file).
This call attaches only (part of) a single filesystem, not possiblesubmounts. The entire file hierarchy including submounts is attacheda second place using
mount --rbind olddir newdir
Note that the filesystem mount options will remain the same as thoseon the original mount point, and cannot be changed by passing the -ooption along with --bind/--rbind.
Since Linux 2.5.1 it is possible to atomically move a mounted treeto another place. The call is
mount --move olddir newdir
Since Linux 2.6.15 it is possible to mark a mount and its submounts as shared,private, slave or unbindable. A shared mount provides ability to create mirrorsof that mount such that mounts and umounts within any of the mirrors propagateto the other mirror. A slave mount receives propagation from its master, butany not vice-versa. A private mount carries no propagation abilities. Aunbindable mount is a private mount which cannot cloned through a bindoperation. Detailed semantics is documented in Documentation/sharedsubtree.txtfile in the kernel source tree.
mount --make-shared mountpoint
mount --make-slave mountpoint
mount --make-private mountpoint
mount --make-unbindable mountpoint
The following commands allows one to recursively change the type of all themounts under a given mountpoint.
mount --make-rshared mountpoint
mount --make-rslave mountpoint
mount --make-rprivate mountpoint
"mount --make-runbindable mountpoint"
Theproc file system is not associated with a special device, and whenmounting it, an arbitrary keyword, such asproc can be used instead of a device specification.(The customary choicenone is less fortunate: the error message none busy fromumount can be confusing.)
Most devices are indicated by a file name (of a block special device), like/dev/sda1, but there are other possibilities. For example, in the case of an NFS mount,device may look likeknuth.cwi.nl:/dir. It is possible to indicate a block special device using itsvolume label or UUID (see the -L and -U options below).
The file/etc/fstab (seefstab(5)),may contain lines describing what devices are usuallymounted where, using which options. This file is used in three ways:
(i) The command
mount -a [-t type] [-O optlist] (usually given in a bootscript) causes all file systems mentioned infstab (of the proper type and/or having or not having the proper options)to be mounted as indicated, except for those whose line contains thenoauto keyword. Adding the-F option will make mount fork, so that thefilesystems are mounted simultaneously.
(ii) When mounting a file system mentioned infstab, it suffices to give only the device, or only the mount point.
(iii) Normally, only the superuser can mount file systems.However, whenfstab contains theuser option on a line, anybody can mount the corresponding system.
Thus, given a line
/dev/cdrom /cd iso9660 ro,user,noauto,unhide any user can mount the iso9660 file system found on his CDROMusing the command
mount /dev/cdrom or
mount /cd For more details, seefstab(5).Only the user that mounted a filesystem can unmount it again.If any user should be able to unmount, then useusers instead ofuser in thefstab line.Theowner option is similar to theuser option, with the restriction that the user must be the ownerof the special file. This may be useful e.g. for/dev/fd if a login script makes the console user owner of this device.Thegroup option is similar, with the restriction that the user must bemember of the group of the special file.
The programsmount andumount maintain a list of currently mounted file systems in the file/etc/mtab. If no arguments are given tomount, this list is printed.
When theproc filesystem is mounted (say at/proc), the files/etc/mtab and/proc/mounts have very similar contents. The former has somewhatmore information, such as the mount options used,but is not necessarily up-to-date (cf. the-n option below). It is possible to replace/etc/mtab by a symbolic link to/proc/mounts, and especially when you have very large numbers of mountsthings will be much faster with that symlink,but some information is lost that way, and in particularworking with the loop device will be less convenient,and using the "user" option will fail.
The full set of options used by an invocation ofmount is determined by first extracting theoptions for the file system from thefstab table, then applying any options specified by the-o argument, and finally applying a-r or -w option, when present.
Options available for themount command:
Tag | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-V | Output version. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-h | Print a help message. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-v | Verbose mode. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-a | Mount all filesystems (of the given types) mentioned infstab. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-F | (Used in conjunction with-a.) Fork off a new incarnation of mount for each device.This will do the mounts on different devices or different NFS serversin parallel.This has the advantage that it is faster; also NFS timeouts go inparallel. A disadvantage is that the mounts are done in undefined order.Thus, you cannot use this option if you want to mount both/usr and/usr/spool. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-f | Causes everything to be done except for the actual system call; if its notobvious, this fakes mounting the file system. This option is useful inconjunction with the-v flag to determine what themount command is trying to do. It can also be used to add entries for devicesthat were mounted earlier with the -n option. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-i | Dont call the /sbin/mount.<filesystem> helper even if it exists. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-l | Add the ext2, ext3 and XFS labels in the mount output. Mount must havepermission to read the disk device (e.g. be suid root) for this to work.One can set such a label for ext2 or ext3 using thee2label(8)utility, or for XFS usingxfs_admin(8),or for reiserfs usingreiserfstune(8). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-n | Mount without writing in/etc/mtab. This is necessary for example when/etc is on a read-only file system. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-p num | In case of a loop mount with encryption, read the passphrase fromfile descriptornum instead of from the terminal. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-s | Tolerate sloppy mount options rather than failing. This will ignoremount options not supported by a filesystem type. Not all filesystemssupport this option. This option exists for support of the Linuxautofs-based automounter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-r | Mount the file system read-only. A synonym is-o ro. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-w | Mount the file system read/write. This is the default. A synonym is-o rw. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-L label | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Mount the partition that has the specifiedlabel. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-U uuid | Mount the partition that has the specifieduuid. These two options require the file/proc/partitions (present since Linux 2.1.116) to exist. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-t vfstype | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The argument following the-t is used to indicate the file system type. The file system types which arecurrently supported include:adfs, affs, autofs, cifs, coda, coherent, cramfs, debugfs, devpts, efs, ext, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, nfs4, ntfs, proc, qnx4, ramfs, reiserfs, romfs, smbfs, sysv, tmpfs, udf, ufs, umsdos, usbfs, vfat, xenix, xfs, xiafs. Note that coherent, sysv and xenix are equivalent and thatxenix andcoherent will be removed at some point in the future usesysv instead. Since kernel version 2.1.21 the typesext andxiafs do not exist anymore. Earlier,usbfs was known asusbdevfs. For most types all themount program has to do is issue a simplemount(2)system call, and no detailed knowledge of the filesystem type is required.For a few types however (like nfs, nfs4, cifs, smbfs, ncpfs) ad hoc code isnecessary. The nfs ad hoc code is built in, but cifs, smbfs, and ncpfshave a separate mount program. In order to make it possible totreat all types in a uniform way, mount will execute the program/sbin/mount.TYPE (if that exists) when called with typeTYPE. Since various versions of thesmbmount program have different calling conventions,/sbin/mount.smbfs may have to be a shell script that sets up the desired call. If no-t option is given, or if theauto type is specified, mount will try to guess the desired type.If mount was compiled with the blkid library, the guessing is doneby this library. Otherwise, mount guesses itself by probing thesuperblock; if that does not turn up anything that looks familiar,mount will try to read the file/etc/filesystems, or, if that does not exist,/proc/filesystems. All of the filesystem types listed there will be tried,except for those that are labeled "nodev" (e.g.,devpts, proc, nfs, andnfs4). If/etc/filesystems ends in a line with a single * only, mount will read/proc/filesystems afterwards. Theauto type may be useful for user-mounted floppies.Creating a file/etc/filesystems can be useful to change the probe order (e.g., to try vfat before msdosor ext3 before ext2) or if you use a kernel module autoloader.Warning: the probing uses a heuristic (the presence of appropriate magic),and could recognize the wrong filesystem type, possibly with catastrophicconsequences. If your data is valuable, dont askmount to guess. More than one type may be specified in a comma separatedlist. The list of file system types can be prefixed withno to specify the file system types on which no action should be taken.(This can be meaningful with the-a option.) For example, the command:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-O | Used in conjunction with-a, to limit the set of filesystems to which the-a is applied. Like-t in this regard except that it is useless except in the context of-a. For example, the command:
It is different from-t in that each option is matched exactly; a leadingno at the beginning of one option does not negate the rest. The-t and-O options are cumulative in effect; that is, the command
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-o | Options are specified with a-o flag followed by a comma separated string of options.Some of these options are only useful when they appear in the/etc/fstab file. The following options apply to any file system that is beingmounted (but not every file system actually honors them - e.g., thesync option today has effect only for ext2, ext3, fat, vfat and ufs):
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
--bind | Remount a subtree somewhere else (so that its contents are availablein both places). See above. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
--move | Move a subtree to some other place. See above. |
The following options apply only to certain file systems.We sort them by file system. They all follow the-o flag.
What options are supported depends a bit on the running kernel.More info may be found in the kernel source subdirectoryDocumentation/filesystems.
Tag | Description |
---|---|
uid=value and gid=value | |
Set the owner and group of the files in the file system (default: uid=gid=0). | |
ownmask=value and othmask=value | |
Set the permission mask for ADFS owner permissions and other permissions,respectively (default: 0700 and 0077, respectively).See also/usr/src/linux/Documentation/filesystems/adfs.txt. |
Tag | Description |
---|---|
uid=value and gid=value | |
Set the owner and group of the root of the file system (default: uid=gid=0,but with optionuid orgid without specified value, the uid and gid of the current process are taken). | |
setuid=value and setgid=value | |
Set the owner and group of all files. | |
mode=value | |
Set the mode of all files tovalue & 0777 disregarding the original permissions.Add search permission to directories that have read permission.The value is given in octal. | |
protect | |
Do not allow any changes to the protection bits on the file system. | |
usemp | Set uid and gid of the root of the file system to the uid and gidof the mount point upon the first sync or umount, and thenclear this option. Strange... |
verbose | |
Print an informational message for each successful mount. | |
prefix=string | |
Prefix used before volume name, when following a link. | |
volume=string | |
Prefix (of length at most 30) used before / when following a symbolic link. | |
reserved=value | |
(Default: 2.) Number of unused blocks at the start of the device. | |
root=value | |
Give explicitly the location of the root block. | |
bs=value | |
Give blocksize. Allowed values are 512, 1024, 2048, 4096. | |
grpquota / noquota / quota / usrquota | |
These options are accepted but ignored.(However, quota utilities may react to such strings in/etc/fstab.) |
See the options section of themount.cifs(8)man page (cifs-mount package must be installed).
Just likenfs or smbfs implementation expects a binary argumentto the mount system call. This argument is constructed bymount.cifs(8)and the current version ofmount (2.12) does not know anything about cifs.
None.
The debugfs file system is a pseudo file system, traditionally mounted on/sys/kernel/debug. There are no mount options.
The devpts file system is a pseudo file system, traditionally mounted on/dev/pts. In order to acquire a pseudo terminal, a process opens/dev/ptmx; the number of the pseudo terminal is then made available to the processand the pseudo terminal slave can be accessed as/dev/pts/<number>.
Tag | Description |
---|---|
uid=value and gid=value | |
This sets the owner or the group of newly created PTYs tothe specified values. When nothing is specified, they willbe set to the UID and GID of the creating process.For example, if there is a tty group with GID 5, thengid=5 will cause newly created PTYs to belong to the tty group. | |
mode=value | |
Set the mode of newly created PTYs to the specified value.The default is 0600.A value ofmode=620 andgid=5 makes "mesg y" the default on newly created PTYs. |
None.Note that the ext file system is obsolete. Dont use it.Since Linux version 2.1.21 extfs is no longer part of the kernel source.
The ext2 file system is the standard Linux file system.Since Linux 2.5.46, for most mount options the defaultis determined by the filesystem superblock. Set them withtune2fs(8).
Tag | Description |
---|---|
acl / noacl | |
Support POSIX Access Control Lists (or not). | |
bsddf / minixdf | |
Set the behaviour for thestatfs system call. Theminixdf behaviour is to return in thef_blocks field the total number of blocks of the file system, while thebsddf behaviour (which is the default) is to subtract the overhead blocksused by the ext2 file system and not available for file storage. Thus |
% mount /k -o minixdf; df /k; umount /kFilesystem 1024-blocks Used Available Capacity Mounted on/dev/sda6 2630655 86954 2412169 3% /k% mount /k -o bsddf; df /k; umount /kFilesystem 1024-blocks Used Available Capacity Mounted on/dev/sda6 2543714 13 2412169 0% /k
(Note that this example shows that one can add command line optionsto the options given in/etc/fstab.)
Tag | Description |
---|---|
check=none / nocheck | |
No checking is done at mount time. This is the default. This is fast.It is wise to invokee2fsck(8)every now and then, e.g. at boot time. | |
debug | Print debugging info upon each (re)mount. |
errors=continue / errors=remount-ro / errors=panic | |
Define the behaviour when an error is encountered.(Either ignore errors and just mark the file system erroneous and continue,or remount the file system read-only, or panic and halt the system.)The default is set in the filesystem superblock, and can bechanged usingtune2fs(8). | |
grpid or bsdgroups / nogrpid or sysvgroups | |
These options define what group id a newly created file gets.Whengrpid is set, it takes the group id of the directory in which it is created;otherwise (the default) it takes the fsgid of the current process, unlessthe directory has the setgid bit set, in which case it takes the gidfrom the parent directory, and also gets the setgid bit setif it is a directory itself. | |
grpquota / noquota / quota / usrquota | |
These options are accepted but ignored. | |
nobh | Do not attach buffer_heads to file pagecache. (Since 2.5.49.) |
nouid32 | |
Disables 32-bit UIDs and GIDs. This is for interoperability with olderkernels which only store and expect 16-bit values. | |
oldalloc or orlov | |
Use old allocator or Orlov allocator for new inodes. Orlov is default. | |
resgid=n and resuid=n | |
The ext2 file system reserves a certain percentage of the availablespace (by default 5%, seemke2fs(8)andtune2fs(8)).These options determine who can use the reserved blocks.(Roughly: whoever has the specified uid, or belongs to the specified group.) | |
sb=n | Instead of block 1, use blockn as superblock. This could be useful when the filesystem has been damaged.(Earlier, copies of the superblock would be made every 8192 blocks: inblock 1, 8193, 16385, ... (and one got thousands of copies ona big filesystem). Since version 1.08,mke2fs has a -s (sparse superblock) option to reduce the number of backupsuperblocks, and since version 1.15 this is the default. Notethat this may mean that ext2 filesystems created by a recentmke2fs cannot be mounted r/w under Linux 2.0.*.)The block number here uses 1k units. Thus, if you want to use logicalblock 32768 on a filesystem with 4k blocks, use "sb=131072". |
user_xattr / nouser_xattr | |
Support "user." extended attributes (or not). |
The ext3 file system is a version of the ext2 file system which has beenenhanced with journalling. It supports the same options as ext2 aswell as the following additions:
Tag | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
journal=update | |||||||||||||||
Update the ext3 file systems journal to the current format. | |||||||||||||||
journal=inum | |||||||||||||||
When a journal already exists, this option is ignored. Otherwise, itspecifies the number of the inode which will represent the ext3 file systemsjournal file; ext3 will create a new journal, overwriting the old contentsof the file whose inode number isinum. | |||||||||||||||
noload | Do not load the ext3 file systems journal on mounting. | ||||||||||||||
data=journal / data=ordered / data=writeback | |||||||||||||||
Specifies the journalling mode for file data. Metadata is always journaled.To use modes other thanordered on the root file system, pass the mode to the kernel as boot parameter, e.g.rootflags=data=journal.
| |||||||||||||||
commit=nrsec | |||||||||||||||
Sync all data and metadata everynrsec seconds. The default value is 5 seconds. Zero means default. |
(Note:fat is not a separate filesystem, but a common part of themsdos, umsdos andvfat filesystems.)
Tag | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
blocksize=512 / blocksize=1024 / blocksize=2048 | |||||||||||||||
Set blocksize (default 512). | |||||||||||||||
uid=value and gid=value | |||||||||||||||
Set the owner and group of all files.(Default: the uid and gid of the current process.) | |||||||||||||||
umask=value | |||||||||||||||
Set the umask (the bitmask of the permissions that arenot present). The default is the umask of the current process.The value is given in octal. | |||||||||||||||
dmask=value | |||||||||||||||
Set the umask applied to directories only.The default is the umask of the current process.The value is given in octal. | |||||||||||||||
fmask=value | |||||||||||||||
Set the umask applied to regular files only.The default is the umask of the current process.The value is given in octal. | |||||||||||||||
check=value | |||||||||||||||
Three different levels of pickyness can be chosen:
| |||||||||||||||
codepage=value | |||||||||||||||
Sets the codepage for converting to shortname characters on FATand VFAT filesystems. By default, codepage 437 is used. | |||||||||||||||
conv=b[inary] / conv=t[ext] / conv=a[uto] | |||||||||||||||
Thefat file system can perform CRLF<-->NL (MS-DOS text format to UNIX textformat) conversion in the kernel. The following conversion modes areavailable:
For file systems mounted in binary mode, a conversion tool(fromdos/todos) is available. | |||||||||||||||
cvf_format=module | |||||||||||||||
Forces the driver to use the CVF (Compressed Volume File) modulecvf_module instead of auto-detection. If the kernel supports kmod, thecvf_format=xxx option also controls on-demand CVF module loading. | |||||||||||||||
cvf_option=option | |||||||||||||||
Option passed to the CVF module. | |||||||||||||||
debug | Turn on thedebug flag. A version string and a list of file system parameters will beprinted (these data are also printed if the parameters appear to beinconsistent). | ||||||||||||||
fat=12 / fat=16 / fat=32 | |||||||||||||||
Specify a 12, 16 or 32 bit fat. This overridesthe automatic FAT type detection routine. Use with caution! | |||||||||||||||
iocharset=value | |||||||||||||||
Character set to use for converting between 8 bit charactersand 16 bit Unicode characters. The default is iso8859-1.Long filenames are stored on disk in Unicode format. | |||||||||||||||
quiet | Turn on thequiet flag. Attempts to chown or chmod files do not return errors,although they fail. Use with caution! | ||||||||||||||
sys_immutable, showexec, dots, nodots, dotsOK=[yes|no] | |||||||||||||||
Various misguided attempts to force Unix or DOS conventionsonto a FAT file system. |
Tag | Description |
---|---|
creator=cccc, type=cccc | |
Set the creator/type values as shown by the MacOS finderused for creating new files. Default values: ????. | |
uid=n, gid=n | |
Set the owner and group of all files.(Default: the uid and gid of the current process.) | |
dir_umask=n, file_umask=n, umask=n | |
Set the umask used for all directories, all regular files, or allfiles and directories. Defaults to the umask of the current process. | |
session=n | |
Select the CDROM session to mount.Defaults to leaving that decision to the CDROM driver.This option will fail with anything but a CDROM as underlying device. | |
part=n | |
Select partition number n from the device.Only makes sense for CDROMS.Defaults to not parsing the partition table at all. | |
quiet | Dont complain about invalid mount options. |
Tag | Description |
---|---|
uid=value and gid=value | |
Set the owner and group of all files. (Default: the uid and gidof the current process.) | |
umask=value | |
Set the umask (the bitmask of the permissions that arenot present). The default is the umask of the current process.The value is given in octal. | |
case=lower / case=asis | |
Convert all files names to lower case, or leave them.(Default:case=lower.) | |
conv=binary / conv=text / conv=auto | |
Forconv=text, delete some random CRs (in particular, all followed by NL)when reading a file.Forconv=auto, choose more or less at random betweenconv=binary and conv=text. Forconv=binary, just read what is in the file. This is the default. | |
nocheck | |
Do not abort mounting when certain consistency checks fail. |
ISO 9660 is a standard describing a filesystem structure to be usedon CD-ROMs. (This filesystem type is also seen on some DVDs. See also theudf filesystem.)
Normaliso9660 filenames appear in a 8.3 format (i.e., DOS-like restrictions on filenamelength), and in addition all characters are in upper case. Also there isno field for file ownership, protection, number of links, provision forblock/character devices, etc.
Rock Ridge is an extension to iso9660 that provides all of these unix likefeatures. Basically there are extensions to each directory record thatsupply all of the additional information, and when Rock Ridge is in use,the filesystem is indistinguishable from a normal UNIX file system (exceptthat it is read-only, of course).
Tag | Description |
---|---|
norock | Disable the use of Rock Ridge extensions, even if available. Cf.map. |
nojoliet | |
Disable the use of Microsoft Joliet extensions, even if available. Cf.map. | |
check=r[elaxed] / check=s[trict] | |
Withcheck=relaxed, a filename is first converted to lower case before doing the lookup.This is probably only meaningful together withnorock andmap=normal. (Default:check=strict.) | |
uid=value and gid=value | |
Give all files in the file system the indicated user or group id,possibly overriding the information found in the Rock Ridge extensions.(Default:uid=0,gid=0.) | |
map=n[ormal] / map=o[ff] / map=a[corn] | |
For non-Rock Ridge volumes, normal name translation maps upperto lower case ASCII, drops a trailing ;1, and converts ; to ..Withmap=off no name translation is done. Seenorock. (Default:map=normal.) map=acorn is likemap=normal but also apply Acorn extensions if present. | |
mode=value | |
For non-Rock Ridge volumes, give all files the indicated mode.(Default: read permission for everybody.)Since Linux 2.1.37 one no longer needs to specify the mode indecimal. (Octal is indicated by a leading 0.) | |
unhide | Also show hidden and associated files.(If the ordinary files and the associated or hidden files havethe same filenames, this may make the ordinary files inaccessible.) |
block=[512|1024|2048] | |
Set the block size to the indicated value.(Default:block=1024.) | |
conv=a[uto] / conv=b[inary] / conv=m[text] / conv=t[ext] | |
(Default:conv=binary.) Since Linux 1.3.54 this option has no effect anymore.(And non-binary settings used to be very dangerous,possibly leading to silent data corruption.) | |
cruft | If the high byte of the file length contains other garbage,set this mount option to ignore the high order bits of the file length.This implies that a file cannot be larger than 16MB. |
session=x | |
Select number of session on multisession CD. (Since 2.3.4.) | |
sbsector=xxx | |
Session begins from sector xxx. (Since 2.3.4.) | |
The following options are the same as for vfat and specifying them only makessense when using discs encoded using Microsofts Joliet extensions. | |
iocharset=value | |
Character set to use for converting 16 bit Unicode characters on CDto 8 bit characters. The default is iso8859-1. | |
utf8 | Convert 16 bit Unicode characters on CD to UTF-8. |
Tag | Description |
---|---|
iocharset=name | |
Character set to use for converting from Unicode to ASCII. The default isto do no conversion. Useiocharset=utf8 for UTF8 translations. This requires CONFIG_NLS_UTF8 to be set inthe kernel.config file. | |
resize=value | |
Resize the volume tovalue blocks. JFS only supports growing a volume, not shrinking it. This optionis only valid during a remount, when the volume is mounted read-write. Theresize keyword with no value will grow the volume to the full size of the partition. | |
nointegrity | |
Do not write to the journal. The primary use of this option is to allowfor higher performance when restoring a volume from backup media. Theintegrity of the volume is not guaranteed if the system abnormally abends. | |
integrity | |
Default. Commit metadata changes to the journal. Use this option to remounta volume where thenointegrity option was previously specified in order to restore normal behavior. | |
errors=continue / errors=remount-ro / errors=panic | |
Define the behaviour when an error is encountered.(Either ignore errors and just mark the file system erroneous and continue,or remount the file system read-only, or panic and halt the system.) | |
noquota / quota / usrquota / grpquota | |
These options are accepted but ignored. |
None.
See mount options for fat.If themsdos file system detects an inconsistency, it reports an error and sets the filesystem read-only. The file system can be made writeable again by remountingit.
Just likenfs, the ncpfs implementation expects a binary argument (astruct ncp_mount_data) to the mount system call. This argument is constructed byncpmount(8)and the current version ofmount (2.12) does not know anything about ncpfs.
Instead of a textual option string, parsed by the kernel, thenfs file system expects a binary argument of typestruct nfs_mount_data. The programmount itself parses the following options of the form tag=value,and puts them in the structure mentioned:rsize=n, wsize=n, timeo=n, retrans=n, acregmin=n, acregmax=n, acdirmin=n, acdirmax=n, actimeo=n, retry=n, port=n, mountport=n, mounthost=name, mountprog=n, mountvers=n, nfsprog=n, nfsvers=n, namlen=n. The optionaddr=n is accepted but ignored.Also the following Boolean options, possibly preceded byno are recognized:bg, fg, soft, hard, intr, posix, cto, ac, tcp, udp, lock. For details, seenfs(5).
Especially useful options include
Tag | Description |
---|---|
rsize=32768,wsize=32768 | |
This causes the NFS client to try to negotiate a buffer sizeup to the size specified.A large buffer size does improve performance, but both theserver and client have to support it.In the case where one of these does not support the size specified,the size negotiated will be the largest that both support. | |
intr | This will allow NFS operations (on hard mounts) to beinterrupted while waiting for a response from the server. |
nolock | Do not use locking. Do not start lockd. |
Instead of a textual option string, parsed by the kernel, thenfs4 file system expects a binary argument of typestruct nfs4_mount_data. The programmount itself parses the following options of the form tag=value,and puts them in the structure mentioned:rsize=n, wsize=n, timeo=n, retrans=n, acregmin=n, acregmax=n, acdirmin=n, acdirmax=n, actimeo=n, retry=n, port=n, proto=n, clientaddr=n, sec=n. The optionaddr=n is accepted but ignored.Also the following Boolean options, possibly preceded byno are recognized:bg, fg, soft, hard, intr, cto, ac, For details, seenfs(5).
Especially useful options include
Tag | Description |
---|---|
rsize=32768,wsize=32768 | |
This causes the NFS4 client to try to negotiate a buffer sizeup to the size specified.A large buffer size does improve performance, but both theserver and client have to support it.In the case where one of these does not support the size specified,the size negotiated will be the largest that both support. | |
intr | This will allow NFS4 operations (on hard mounts) to beinterrupted while waiting for a response from the server. |
Tag | Description |
---|---|
iocharset=name | |
Character set to use when returning file names.Unlike VFAT, NTFS suppresses names that containunconvertible characters. Deprecated. | |
nls=name | |
New name for the option earlier callediocharset. | |
utf8 | Use UTF-8 for converting file names. |
uni_xlate=[0|1|2] | |
For 0 (or no or false), do not use escape sequencesfor unknown Unicode characters.For 1 (or yes or true) or 2, use vfat-style 4-byte escape sequencesstarting with ":". Here 2 give a little-endian encodingand 1 a byteswapped bigendian encoding. | |
posix=[0|1] | |
If enabled (posix=1), the file system distinguishes betweenupper and lower case. The 8.3 alias names are presented ashard links instead of being suppressed. | |
uid=value, gid=value and umask=value | |
Set the file permission on the filesystem.The umask value is given in octal.By default, the files are owned by root and not readable by somebody else. |
Tag | Description |
---|---|
uid=value and gid=value | |
These options are recognized, but have no effect as far as I can see. |
Ramfs is a memory based filesystem. Mount it and you have it. Unmount itand it is gone. Present since Linux 2.3.99pre4.There are no mount options.
Reiserfs is a journaling filesystem.The reiserfs mount options are more fully described athttp://www.namesys.com/mount-options.html.
Tag | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
conv | Instructs version 3.6 reiserfs software to mount a version 3.5 file system,using the 3.6 format for newly created objects. This file system will nolonger be compatible with reiserfs 3.5 tools. | ||||||||||||
hash=rupasov / hash=tea / hash=r5 / hash=detect | |||||||||||||
Choose which hash function reiserfs will use to find files within directories.
| |||||||||||||
hashed_relocation | |||||||||||||
Tunes the block allocator. This may provide performance improvementsin some situations. | |||||||||||||
no_unhashed_relocation | |||||||||||||
Tunes the block allocator. This may provide performance improvementsin some situations. | |||||||||||||
noborder | |||||||||||||
Disable the border allocator algorithm invented by Yury Yu. Rupasov.This may provide performance improvements in some situations. | |||||||||||||
nolog | Disable journalling. This will provide slight performance improvements insome situations at the cost of losing reiserfss fast recovery from crashes.Even with this option turned on, reiserfs still performs all journallingoperations, save for actual writes into its journalling area. Implementationofnolog is a work in progress. | ||||||||||||
notail | By default, reiserfs stores small files and file tails directly into itstree. This confuses some utilities such asLILO(8). This option is used to disable packing of files into the tree. | ||||||||||||
replayonly | |||||||||||||
Replay the transactions which are in the journal, but do not actuallymount the file system. Mainly used byreiserfsck. | |||||||||||||
resize=number | |||||||||||||
A remount option which permits online expansion of reiserfs partitions.Instructs reiserfs to assume that the device hasnumber blocks.This option is designed for use with devices which are under logicalvolume management (LVM).There is a specialresizer utility which can be obtained fromftp://ftp.namesys.com/pub/reiserfsprogs. |
None.
Just likenfs, the smbfs implementation expects a binary argument (astruct smb_mount_data) to the mount system call. This argument is constructed bysmbmount(8)and the current version ofmount (2.12) does not know anything about smbfs.
None.
The following parameters accept a suffixk, m org for Ki, Mi, Gi (binary kilo, mega and giga) and can be changed on remount.
Tag | Description |
---|---|
size=nbytes | |
Override default maximum size of the filesystem.The size is given in bytes, and rounded down to entire pages.The default is half of the memory. | |
nr_blocks= | |
Set number of blocks. | |
nr_inodes= | |
Set number of inodes. | |
mode= | Set initial permissions of the root directory. |
udf is the "Universal Disk Format" filesystem defined by the OpticalStorage Technology Association, and is often used for DVD-ROM.See alsoiso9660.
Tag | Description |
---|---|
gid= | Set the default group. |
umask= | Set the default umask.The value is given in octal. |
uid= | Set the default user. |
unhide | Show otherwise hidden files. |
undelete | |
Show deleted files in lists. | |
nostrict | |
Unset strict conformance. | |
iocharset | |
Set the NLS character set. | |
bs= | Set the block size. (May not work unless 2048.) |
novrs | Skip volume sequence recognition. |
session= | |
Set the CDROM session counting from 0. Default: last session. | |
anchor= | |
Override standard anchor location. Default: 256. | |
volume= | |
Override the VolumeDesc location. (unused) | |
partition= | |
Override the PartitionDesc location. (unused) | |
lastblock= | |
Set the last block of the filesystem. | |
fileset= | |
Override the fileset block location. (unused) | |
rootdir= | |
Override the root directory location. (unused) |
Tag | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ufstype=value | |||||||||||||||||||||||||
UFS is a file system widely used in different operating systems.The problem are differences among implementations. Features of someimplementations are undocumented, so its hard to recognize thetype of ufs automatically.Thats why the user must specify the type of ufs by mount option.Possible values are:
| |||||||||||||||||||||||||
onerror=value | |||||||||||||||||||||||||
Set behaviour on error:
|
See mount options for msdos.ThedotsOK option is explicitly killed byumsdos.
First of all, the mount options forfat are recognized.ThedotsOK option is explicitly killed byvfat. Furthermore, there are
Tag | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
uni_xlate | |||||||||||
Translate unhandled Unicode characters to special escaped sequences.This lets you backup and restore filenames that are created with anyUnicode characters. Without this option, a ? is used when notranslation is possible. The escape character is : because it isotherwise illegal on the vfat filesystem. The escape sequencethat gets used, where u is the unicode character,is: :, (u & 0x3f), ((u>>6) & 0x3f), (u>>12). | |||||||||||
posix | Allow two files with names that only differ in case. | ||||||||||
nonumtail | |||||||||||
First try to make a short name without sequence number,before tryingname~num.ext. | |||||||||||
utf8 | UTF8 is the filesystem safe 8-bit encoding of Unicode that is usedby the console. It can be be enabled for the filesystem with this option.If uni_xlate gets set, UTF8 gets disabled. | ||||||||||
shortname=[lower|win95|winnt|mixed] | |||||||||||
Defines the behaviour for creation and display of filenames which fit into8.3 characters. If a long name for a file exists, it will always bepreferred display. There are four modes:
The default is "lower". |
Tag | Description |
---|---|
devuid=uid and devgid=gid and devmode=mode | |
Set the owner and group and mode of the device files in the usbfs file system(default: uid=gid=0, mode=0644). The mode is given in octal. | |
busuid=uid and busgid=gid and busmode=mode | |
Set the owner and group and mode of the bus directories in the usbfsfile system (default: uid=gid=0, mode=0555). The mode is given in octal. | |
listuid=uid and listgid=gid and listmode=mode | |
Set the owner and group and mode of the filedevices (default: uid=gid=0, mode=0444). The mode is given in octal. |
None.
Tag | Description |
---|---|
biosize=size | |
Sets the preferred buffered I/O size (default size is 64K).size must be expressed as the logarithm (base2) of the desired I/O size.Valid values for this option are 14 through 16, inclusive(i.e. 16K, 32K, and 64K bytes).On machines with a 4K pagesize, 13 (8K bytes) is also a validsize. The preferred buffered I/O size can also be altered on an individualfile basis using theioctl(2)system call. | |
dmapi / xdsm | |
Enable the DMAPI (Data Management API) event callouts. | |
logbufs=value | |
Set the number of in-memory log buffers.Valid numbers range from 2-8 inclusive.The default value is 8 buffers for filesystems with a blocksize of 64K,4 buffers for filesystems with a blocksize of 32K,3 buffers for filesystems with a blocksize of 16K,and 2 buffers for all other configurations.Increasing the number of buffers may increase performance onsome workloads at the cost of the memory used for theadditional log buffers and their associated control structures. | |
logbsize=value | |
Set the size of each in-memory log buffer.Valid sizes are 16384 (16K) and 32768 (32K).The default value for machines with more than 32MB of memory is 32768,machines with less memory use 16384 by default. | |
logdev=device and rtdev=device | |
Use an external log (metadata journal) and/or real-time device.An XFS filesystem has up to three parts: a data section, a log section,and a real-time section.The real-time section is optional, and the log section can be separatefrom the data section or contained within it.Refer toxfs(5). | |
noalign | |
Data allocations will not be aligned at stripe unit boundaries. | |
noatime | |
Access timestamps are not updated when a file is read. | |
norecovery | |
The filesystem will be mounted without running log recovery.If the filesystem was not cleanly unmounted, it is likely tobe inconsistent when mounted innorecovery mode.Some files or directories may not be accessible because of this.Filesystems mountednorecovery must be mounted read-only or the mount will fail. | |
nouuid | Ignore the filesystem uuid. This avoids errors for duplicate uuids. |
osyncisdsync | |
Make writes to files opened with the O_SYNC flag set behaveas if the O_DSYNC flag had been used instead.This can result in better performance without compromisingdata safety.However if this option is in effect, timestamp updates fromO_SYNC writes can be lost if the system crashes. | |
quota / usrquota / uqnoenforce | |
User disk quota accounting enabled, and limits (optionally) enforced. | |
grpquota / gqnoenforce | |
Group disk quota accounting enabled and limits (optionally) enforced. | |
sunit=value and swidth=value | |
Used to specify the stripe unit and width for a RAID device or a stripevolume.value must be specified in 512-byte block units.If this option is not specified and the filesystem was made on a stripevolume or the stripe width or unit were specified for the RAID device atmkfs time, then the mount system call will restore the value from thesuperblock.For filesystems that are made directly on RAID devices, these options can beused to override the information in the superblock if the underlying disklayout changes after the filesystem has been created.Theswidth option is required if thesunit option has been specified,and must be a multiple of thesunit value. |
None. Although nothing is wrong with xiafs, it is not used much,and is not maintained. Probably one shouldnt use it.Since Linux version 2.1.21 xiafs is no longer part of the kernel source.
One further possible type is a mount via the loop device. For example,the command
mount /tmp/fdimage /mnt -t msdos -o loop=/dev/loop3,blocksize=1024
will set up the loop device/dev/loop3 to correspond to the file/tmp/fdimage, and then mount this device on/mnt.
This type of mount knows about three options, namelyloop, offset and encryption, that are really options tolosetup(8).(These options can be used in addition to those specificto the filesystem type.)
If no explicit loop device is mentioned(but just an option -o loop is given), thenmount will try to find some unused loop device and use that.If you are not so unwise as to make/etc/mtab a symbolic link to/proc/mounts then any loop device allocated bymount will be freed byumount. You can also free a loop device by hand, using losetup -d, seelosetup(8).
mount has the following return codes (the bits can be ORed):
Tag | Description |
---|---|
0 | success |
1 | incorrect invocation or permissions |
2 | system error (out of memory, cannot fork, no more loop devices) |
4 | internalmount bug or missingnfs support inmount |
8 | user interrupt |
16 | problems writing or locking /etc/mtab |
32 | mount failure |
64 | some mount succeeded |
Tag | Description |
---|---|
/etc/fstab | file system table |
/etc/mtab | table of mounted file systems |
/etc/mtab~ | lock file |
/etc/mtab.tmp | temporary file |
/etc/filesystems | a list of filesystem types to try |
mount (2)
umount (2)
(Video) mount | umount | fdisk | mkfs | Linux Commands mount, umount, fdisk & mkfs | Full Detailsumount (8)
swapon (8)
e2label (8)
xfs_admin (8)
mountd (8)
nfsd (8)
mke2fs (8)
tune2fs (8)
losetup (8)
It is possible for a corrupted file system to cause a crash.
Some Linux file systems dont support-o sync and -o dirsync (the ext2, ext3, fat and vfat file systemsdo support synchronous updates (a la BSD) when mounted with thesync option).
The-o remount may not be able to change mount parameters (allext2fs-specific parameters, exceptsb, are changeable with a remount, for example, but you cant changegid orumask for thefatfs).
Mount by label or uuid will work only if your devices have the names listed in/proc/partitions. In particular, it may well fail if the kernel was compiled with devfsbut devfs is not mounted.
It is possible that files/etc/mtab and/proc/mounts dont match. The first file is based only on the mount command options, but thecontent of the second file also depends on the kernel and others settings (e.g.remote NFS server. In particular case the mount command may reports unreliableinformation about a NFS mount point and the /proc/mounts file usually containsmore reliable information.)
Checking files on NFS filesystem referenced by file descriptors (i.e. thefcntl andioctl families of functions) may lead to inconsistent result due to the lack ofconsistency check in kernel even if noac is used.
Amount command existed in Version 5 AT&T UNIX.
Advertisements
FAQs
How to use mount in Unix? ›
The mount command serves to attach the file system found on some device to the big file tree. Conversely, the umount(8) command will detach it again. mount -t type device dir This tells the kernel to attach the file system found on device (which is of type type) at the directory dir.
Description. The mt command gives subcommands to a streaming tape device. If you do not specify the -f flag with the TapeName parameter, the TAPE environment variable is used. If the environment variable does not exist, the mt command uses the /dev/rmt0.
How to mount a file in Linux? ›- This command is only necessary if the /mnt/floppy directory doesn't already exist: mkdir /mnt/floppy.
- Use mount with the -t flag (short for “type”) to specify MSDOS as the file system: mount -t msdos /dev/fd0 /mnt/floppy.
- Identify the USB drive using the lsblk command. ...
- Create a directory to mount the USB drive into. ...
- Mount the USB drive to the /media/pendrive directory using the mount command. ...
- Check the drive has been mounted by re-running lsblk.
The mount command instructs the operating system that a file system is ready to use, and associates it with a particular point in the overall file system hierarchy (its mount point) and sets options relating to its access.
- Open a terminal with root privileges.
- Run the following command: mount <NAS Ethernet Interface IP>:/share/<Shared Folder Name> <Directory to Mount> Tip: ...
- Specify your NAS username and password.
The mount command allows users to mount, i.e., attach additional child file systems to a particular mount point on the currently accessible file system. The command passes the mount instructions to the kernel, which completes the operation.
How do I find my mount command? ›The findmnt command is a simple command-line utility used to display a list of currently mounted file systems or search for a file system in /etc/fstab, /etc/mtab or /proc/self/mountinfo. 1. To display a list of currently mounted file systems, run the following at a shell prompt.
- Open File Explorer.
- Browse to the folder with the ISO image.
- Select the . iso file.
- Click the Disk Image Tools tab.
- Click the Mount button.
How do I mount any file? ›
Double click the file or right click it and select "Mount" from the context menu. It is the default context menu command. The disk image will be mounted in a virtual drive in the This PC folder.
- Step 1: Create Mount Point. Create a mount point directory in the mnt folder where the remote file system will be mounted: sudo mkdir /mnt/<folder name>
- Step 2: Mount the Remote File System Using SSHFS. ...
- Step 3: Check Mounted File System. ...
- Step 4: Unmount a Remote File System on Linux.
Mount points in Unix, Linux and macOS
The mount command is used to make a device or file system accessible to the system, and then to connect its root directory to a mount point on the local file system.
The purpose of mounting is to protect fragile or coated materials during preparation and to obtain perfect edge retention. Mounting is used when the protection of layers is imperative, and also it enables a safer and more convenient handling of small, sharp, or irregularly shaped specimens, for example.
Where is mount in Linux? ›The Files /etc/fstab, /etc/mtab And /proc/mounts.
A mounted folder is an association between a volume and a directory on another volume. When a mounted folder is created, users and applications can access the target volume either by using the path to the mounted folder or by using the volume's drive letter.
How do I mount a local folder? ›- In Disk Manager, right-click the partition or volume that has the folder in which you want to mount the drive.
- Click Change Drive Letter and Paths and then click Add.
- Click Mount in the following empty NTFS folder.
By default, Linux OS does not automount any other partition at startup other than the root and the home partition. You can mount other partitions very easily later, but you might want to enable some kind of automount feature on startup.
What is the correct syntax of mount command? ›Use the TSO MOUNT command to make a connection between a mount point on your local file system and one or more files on a remote AIX, UNIX, , or other file system. The MOUNT command can only be used by a z/OS superuser.
Using the mount Command
One way we can determine if a directory is mounted is by running the mount command and filtering the output. The above line will exit with 0 (success) if /mnt/backup is a mount point. Otherwise, it'll return -1 (error).
Which command is used to mount? ›
mount command is used to mount the filesystem found on a device to big tree structure(Linux filesystem) rooted at '/'. Conversely, another command umount can be used to detach these devices from the Tree. These commands tells the Kernel to attach the filesystem found at device to the dir.
The command findmnt lists all mount points. To do this the findmnt reads files /etc/fstab, /etc/fstab. d, /etc/mtab or /proc/self/mountinfo.
How do I list and mount devices in Linux? ›- Listing from /proc using cat command. To list mount points you can read contents of the file /proc/mounts. ...
- Using Mount Command. You can use mount command to list mount points. ...
- Using df command. You can use df command to list mount points. ...
- Using findmnt. Findmnt is a powerful tool to find mounted filesystems.
Mounting a filesystem simply means making the particular filesystem accessible at a certain point in the Linux directory tree. When mounting a filesystem it does not matter if the filesystem is a hard disk partition, CD-ROM, floppy, or USB storage device.
What mount file means? ›In computers, to mount is to make a group of files in a file system structure accessible to a user or user group. In some usages, it means to make a device physically accessible.
- Create partitions using fdisk or Disk Utility. ...
- Format the partitions using mkfs or Disk Utility.
- Mount the partitions using the mount command or automate it using the /etc/fstab file.
fstab (after file systems table) is a system file commonly found in the directory /etc on Unix and Unix-like computer systems. In Linux, it is part of the util-linux package.
Mount the ISO File in Windows 11, 10, or 8.1
Download the ISO image, then open File Explorer and right-click on the file. From the pop-up menu, select the Mount command. This will open a virtual drive that is visible in File Explorer, from which you can install the software.
- In the console, go to Classic Infrastructure. > Storage > File Storage.
- Scroll to the File share that you want to mount, and click Actions. . ...
- Filter the available host list by selecting the device type, subnet, or IP address. ...
- Select one or more hosts from the list and click Save.
- Click /var Mount Configuration.
- Specify the hard disk information for the /var directory: Select disk: Select the hard disk where you want to place /var. File system type: Specify the type of file system.
- Click OK.
How mount NFS UNIX? ›
- Become superuser or assume an equivalent role.
- Create a mount point for the file system to be mounted, if necessary. # mkdir /mount-point. ...
- Ensure that the resource (file or directory) is available from a server. ...
- Mount the NFS file system.
To display only the mount point where the filesystem with label "/boot" or “/” is mounted, use the following command. # findmnt -n --raw --evaluate --output=target LABEL=/boot OR # findmnt -n --raw --evaluate --output=target LABEL=/