version 1, including all changes.
.
| Rev |
Author |
# |
Line |
| 1 |
perry |
1 |
MOUNT |
| |
|
2 |
!!!MOUNT |
| |
|
3 |
NAME |
| |
|
4 |
SYNOPSIS |
| |
|
5 |
DESCRIPTION |
| |
|
6 |
RETURN VALUE |
| |
|
7 |
ERRORS |
| |
|
8 |
CONFORMING TO |
| |
|
9 |
HISTORY |
| |
|
10 |
SEE ALSO |
| |
|
11 |
---- |
| |
|
12 |
!!NAME |
| |
|
13 |
|
| |
|
14 |
|
| |
|
15 |
mount, umount - mount and unmount filesystems. |
| |
|
16 |
!!SYNOPSIS |
| |
|
17 |
|
| |
|
18 |
|
| |
|
19 |
__#include __ |
| |
|
20 |
|
| |
|
21 |
|
| |
|
22 |
__int mount(const char *__''specialfile''__, const |
| |
|
23 |
char *__ ''dir'' __, const char *__ |
| |
|
24 |
''filesystemtype''__, unsigned long__ |
| |
|
25 |
''mountflags'' __, const void *__ |
| |
|
26 |
''data''__);__ |
| |
|
27 |
|
| |
|
28 |
|
| |
|
29 |
__int umount(const char |
| |
|
30 |
*__''dir''__);__ |
| |
|
31 |
!!DESCRIPTION |
| |
|
32 |
|
| |
|
33 |
|
| |
|
34 |
__mount__ attaches the filesystem specified by |
| |
|
35 |
''specialfile'' (which is often a device name) to the |
| |
|
36 |
directory specified by ''dir''. |
| |
|
37 |
|
| |
|
38 |
|
| |
|
39 |
__umount__ removes the attachment of the (topmost) |
| |
|
40 |
filesystem mounted on ''dir''. |
| |
|
41 |
|
| |
|
42 |
|
| |
|
43 |
Only the super-user may mount and unmount |
| |
|
44 |
filesystems. |
| |
|
45 |
|
| |
|
46 |
|
| |
|
47 |
The ''filesystemtype'' argument may take one of the |
| |
|
48 |
values listed in /proc/filesystems (like |
| |
|
49 |
'' |
| |
|
50 |
|
| |
|
51 |
|
| |
|
52 |
The ''mountflags'' argument may have the magic number |
| |
|
53 |
0xC0ED in the top 16 bits, and various mount flags (as |
| |
|
54 |
defined in |
| |
|
55 |
'' |
| |
|
56 |
|
| |
|
57 |
|
| |
|
58 |
#define MS_RDONLY 1 /* mount read-only */ |
| |
|
59 |
#define MS_NOSUID 2 /* ignore suid and sgid bits */ |
| |
|
60 |
#define MS_NODEV 4 /* no access to device special files */ |
| |
|
61 |
#define MS_NOEXEC 8 /* no program execution */ |
| |
|
62 |
#define MS_SYNCHRONOUS 16 /* writes are synced at once */ |
| |
|
63 |
#define MS_REMOUNT 32 /* alter flags of a mounted fs */ |
| |
|
64 |
#define MS_MANDLOCK 64 /* allow mandatory locks */ |
| |
|
65 |
#define MS_NOATIME 1024 /* do not update access times */ |
| |
|
66 |
#define MS_NODIRATIME 2048 /* do not update dir access times */ |
| |
|
67 |
#define MS_BIND 4096 /* bind subtree elsewhere */ |
| |
|
68 |
The ''data'' argument is interpreted by the different file systems. |
| |
|
69 |
!!RETURN VALUE |
| |
|
70 |
|
| |
|
71 |
|
| |
|
72 |
On success, zero is returned. On error, -1 is returned, and |
| |
|
73 |
''errno'' is set appropriately. |
| |
|
74 |
!!ERRORS |
| |
|
75 |
|
| |
|
76 |
|
| |
|
77 |
The error values given below result from filesystem type |
| |
|
78 |
independent errors. Each filesystem type may have its own |
| |
|
79 |
special errors and its own special behavior. See the kernel |
| |
|
80 |
source code for details. |
| |
|
81 |
|
| |
|
82 |
|
| |
|
83 |
__EPERM__ |
| |
|
84 |
|
| |
|
85 |
|
| |
|
86 |
The user is not the super-user. |
| |
|
87 |
|
| |
|
88 |
|
| |
|
89 |
__ENODEV__ |
| |
|
90 |
|
| |
|
91 |
|
| |
|
92 |
''Filesystemtype'' not configured in the |
| |
|
93 |
kernel. |
| |
|
94 |
|
| |
|
95 |
|
| |
|
96 |
__ENOTBLK__ |
| |
|
97 |
|
| |
|
98 |
|
| |
|
99 |
''Specialfile'' is not a block device (if a device was |
| |
|
100 |
required). |
| |
|
101 |
|
| |
|
102 |
|
| |
|
103 |
__EBUSY__ |
| |
|
104 |
|
| |
|
105 |
|
| |
|
106 |
''Specialfile'' is already mounted. Or, it cannot be |
| |
|
107 |
remounted read-only, because it still holds files open for |
| |
|
108 |
writing. Or, it cannot be mounted on ''dir'' because |
| |
|
109 |
''dir'' is still busy (it is the working directory of |
| |
|
110 |
some task, the mount point of another device, has open |
| |
|
111 |
files, etc.). |
| |
|
112 |
|
| |
|
113 |
|
| |
|
114 |
__EINVAL__ |
| |
|
115 |
|
| |
|
116 |
|
| |
|
117 |
''Specialfile'' had an invalid superblock. Or, a remount |
| |
|
118 |
was attempted, while ''specialfile'' was not already |
| |
|
119 |
mounted on ''dir''. Or, an umount was attempted, while |
| |
|
120 |
''dir'' was not a mount point. |
| |
|
121 |
|
| |
|
122 |
|
| |
|
123 |
__EFAULT__ |
| |
|
124 |
|
| |
|
125 |
|
| |
|
126 |
One of the pointer arguments points outside the user address |
| |
|
127 |
space. |
| |
|
128 |
|
| |
|
129 |
|
| |
|
130 |
__ENOMEM__ |
| |
|
131 |
|
| |
|
132 |
|
| |
|
133 |
The kernel could not allocate a free page to copy filenames |
| |
|
134 |
or data into. |
| |
|
135 |
|
| |
|
136 |
|
| |
|
137 |
__ENAMETOOLONG__ |
| |
|
138 |
|
| |
|
139 |
|
| |
|
140 |
A pathname was longer than MAXPATHLEN. |
| |
|
141 |
|
| |
|
142 |
|
| |
|
143 |
__ENOENT__ |
| |
|
144 |
|
| |
|
145 |
|
| |
|
146 |
A pathname was empty or had a nonexistent |
| |
|
147 |
component. |
| |
|
148 |
|
| |
|
149 |
|
| |
|
150 |
__ENOTDIR__ |
| |
|
151 |
|
| |
|
152 |
|
| |
|
153 |
The second argument, or a prefix of the first argument, is |
| |
|
154 |
not a directory. |
| |
|
155 |
|
| |
|
156 |
|
| |
|
157 |
__EACCES__ |
| |
|
158 |
|
| |
|
159 |
|
| |
|
160 |
A component of a path was not searchable. |
| |
|
161 |
Or, mounting a read-only filesystem was attempted without |
| |
|
162 |
giving the MS_RDONLY flag. |
| |
|
163 |
Or, the block device ''Specialfile'' is located on a |
| |
|
164 |
filesystem mounted with the MS_NODEV option. |
| |
|
165 |
|
| |
|
166 |
|
| |
|
167 |
__ENXIO__ |
| |
|
168 |
|
| |
|
169 |
|
| |
|
170 |
The major number of the block device ''specialfile'' is |
| |
|
171 |
out of range. |
| |
|
172 |
|
| |
|
173 |
|
| |
|
174 |
__EMFILE__ |
| |
|
175 |
|
| |
|
176 |
|
| |
|
177 |
(In case no block device is required:) Table of dummy |
| |
|
178 |
devices is full. |
| |
|
179 |
!!CONFORMING TO |
| |
|
180 |
|
| |
|
181 |
|
| |
|
182 |
These functions are Linux-specific and should not be used in |
| |
|
183 |
programs intended to be portable. |
| |
|
184 |
!!HISTORY |
| |
|
185 |
|
| |
|
186 |
|
| |
|
187 |
The original __umount__ function was called as |
| |
|
188 |
''umount(device)'' and would return ENOTBLK when called |
| |
|
189 |
with something other than a block device. In Linux 0.98p4 a |
| |
|
190 |
call ''umount(dir)'' was added, in order to support |
| |
|
191 |
anonymous devices. In Linux 2.3.99-pre7 the call |
| |
|
192 |
''umount(device)'' was removed, leaving only |
| |
|
193 |
''umount(dir)'' (since now devices can be mounted in more |
| |
|
194 |
than one place, so specifying the device does not |
| |
|
195 |
suffice). |
| |
|
196 |
|
| |
|
197 |
|
| |
|
198 |
The original MS_SYNC flag was renamed MS_SYNCHRONOUS in |
| |
|
199 |
1.1.69 when a different MS_SYNC was added to |
| |
|
200 |
!!SEE ALSO |
| |
|
201 |
|
| |
|
202 |
|
| |
|
203 |
mount(8), umount(8) |
| |
|
204 |
---- |