]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/mount.2
signal.7: improve description in NAME section
[thirdparty/man-pages.git] / man2 / mount.2
CommitLineData
fea681da
MK
1.\" Hey Emacs! This file is -*- nroff -*- source.
2.\"
3.\" Copyright (C) 1993 Rickard E. Faith <faith@cs.unc.edu>
6883b3e7 4.\" and Copyright (C) 1994 Andries E. Brouwer <aeb@cwi.nl>
c11b1abf 5.\" and Copyright (C) 2002, 2005 Michael Kerrisk <mtk.manpages@gmail.com>
fea681da
MK
6.\"
7.\" Permission is granted to make and distribute verbatim copies of this
8.\" manual provided the copyright notice and this permission notice are
9.\" preserved on all copies.
10.\"
11.\" Permission is granted to copy and distribute modified versions of this
12.\" manual under the conditions for verbatim copying, provided that the
13.\" entire resulting derived work is distributed under the terms of a
14.\" permission notice identical to this one.
c13182ef 15.\"
fea681da
MK
16.\" Since the Linux kernel and libraries are constantly changing, this
17.\" manual page may be incorrect or out-of-date. The author(s) assume no
18.\" responsibility for errors or omissions, or for damages resulting from
19.\" the use of the information contained herein. The author(s) may not
20.\" have taken the same level of care in the production of this manual,
21.\" which is licensed free of charge, as they might when working
22.\" professionally.
c13182ef 23.\"
fea681da
MK
24.\" Formatted or processed versions of this manual, if unaccompanied by
25.\" the source, must acknowledge the copyright and authors of this work.
26.\"
27.\" Modified 1996-11-04 by Eric S. Raymond <esr@thyrsus.com>
c11b1abf 28.\" Modified 2001-10-13 by Michael Kerrisk <mtk.manpages@gmail.com>
d9bfdb9c 29.\" Added note on historical behavior of MS_NOSUID
c11b1abf 30.\" Modified 2002-05-16 by Michael Kerrisk <mtk.manpages@gmail.com>
fea681da
MK
31.\" Extensive changes and additions
32.\" Modified 2002-05-27 by aeb
c11b1abf 33.\" Modified 2002-06-11 by Michael Kerrisk <mtk.manpages@gmail.com>
fea681da 34.\" Enhanced descriptions of MS_MOVE, MS_BIND, and MS_REMOUNT
c11b1abf 35.\" Modified 2004-06-17 by Michael Kerrisk <mtk.manpages@gmail.com>
8df37e4d 36.\" 2005-05-18, mtk, Added MNT_EXPIRE, plus a few other tidy-ups.
fea681da 37.\"
f1b0cf26 38.TH MOUNT 2 2008-10-02 "Linux" "Linux Programmer's Manual"
fea681da 39.SH NAME
24d01c53 40mount, umount, umount2 \- mount and unmount file systems
fea681da 41.SH SYNOPSIS
7998dde2 42.nf
fea681da
MK
43.B "#include <sys/mount.h>"
44.sp
45.BI "int mount(const char *" source ", const char *" target ,
7998dde2
MK
46.BI " const char *" filesystemtype ", unsigned long " mountflags ,
47.BI " const void *" data );
fea681da
MK
48.sp
49.BI "int umount(const char *" target );
50.sp
51.BI "int umount2(const char *" target ", int " flags );
7998dde2 52.fi
fea681da 53.SH DESCRIPTION
275515f2 54.\" FIXME . This page could be better structured
e511ffb6 55.BR mount ()
24d01c53 56attaches the file system specified by
fea681da
MK
57.I source
58(which is often a device name, but can also be a directory name
59or a dummy) to the directory specified by
60.IR target .
61
ae050d9a 62.BR umount ()
c13182ef 63and
ae050d9a 64.BR umount2 ()
24d01c53 65remove the attachment of the (topmost) file system mounted on
fea681da
MK
66.IR target .
67
68Appropriate privilege (Linux: the
69.B CAP_SYS_ADMIN
24d01c53 70capability) is required to mount and unmount file systems.
fea681da 71
24d01c53 72Since Linux 2.4 a single file system can be visible at
fea681da
MK
73multiple mount points, and multiple mounts can be stacked
74on the same mount point.
75.\" Multiple mounts on same mount point: since 2.3.99pre7.
76
77Values for the
0daa9e92 78.I filesystemtype
fea681da
MK
79argument supported by the kernel are listed in
80.I /proc/filesystems
81(like "minix", "ext2", "msdos", "proc", "nfs", "iso9660" etc.).
82Further types may become available when the appropriate modules
83are loaded.
84
85The
0daa9e92 86.I mountflags
fea681da
MK
87argument may have the magic number 0xC0ED (\fBMS_MGC_VAL\fP)
88in the top 16 bits (this was required in kernel versions prior to 2.4, but
89is no longer required and ignored if specified),
c84371c6
MK
90and various mount flags (as defined in \fI<linux/fs.h>\fP for libc4 and libc5
91and in \fI<sys/mount.h>\fP for glibc2) in the low order 16 bits:
cdab486d
MK
92.\" FIXME 2.6.15 added flags for "shared sub-tree" functionality:
93.\" MS_UNBINDABLE, MS_PRIVATE, MS_SHARED, MS_SLAVE
92057f4d 94.\" These need to be documented on this page.
3736a895
MK
95.\" See:
96.\" Documentation/filesystems/sharedsubtree.txt
b75101c3 97.\"
3736a895 98.\" http://lwn.net/Articles/159077/
b75101c3 99.\"
3736a895
MK
100.\" http://myweb.sudhaa.com:2022/~ram/sharedsubtree/paper/sharedsubtree.1.pdf
101.\" Shared-Subtree Concept, Implementation, and Applications in Linux
102.\" Al Viro viro@ftp.linux.org.uk
103.\" Ram Pai linuxram@us.ibm.com
b75101c3 104.\"
3736a895
MK
105.\" http://foss.in/2005/slides/sharedsubtree1.pdf
106.\" Shared Subtree Concept and Implementation in the Linux Kernel
107.\" Ram Pai
108.\"
fea681da 109.TP
599e5da7 110.BR MS_BIND " (Linux 2.4 onwards)"
fea681da
MK
111.\" since 2.4.0-test9
112Perform a bind mount, making a file or a directory subtree visible at
113another point within a file system.
114Bind mounts may cross file system boundaries and span
115.BR chroot (2)
116jails.
117The
33fc4771
MK
118.IR filesystemtype
119and
120.IR data
fea681da 121arguments are ignored.
33fc4771
MK
122Up until Linux 2.6.26,
123.I mountflags
124was also ignored
fea681da 125.\" with the exception of the "hidden" MS_REC mountflags bit