1 --- util-linux-2.13-pre6/mount/mount.8.subtree 2006-06-12 09:18:26.000000000 +0200
2 +++ util-linux-2.13-pre6/mount/mount.8 2006-06-12 09:19:43.000000000 +0200
4 .B "mount --move olddir newdir"
7 +Since Linux 2.6.15 it is possible to mark a mount and its submounts as shared,
8 +private, slave or unbindable. A shared mount provides ability to create mirrors
9 +of that mount such that mounts and umounts within any of the mirrors propagate
10 +to the other mirror. A slave mount receives propagation from its master, but
11 +any not vice-versa. A private mount carries no propagation abilities. A
12 +unbindable mount is a private mount which cannot cloned through a bind
13 +operation. Detailed semantics is documented in Documentation/sharedsubtree.txt
14 +file in the kernel source tree.
17 +.B "mount --make-shared mountpoint"
19 +.B "mount --make-slave mountpoint"
21 +.B "mount --make-private mountpoint"
23 +.B "mount --make-unbindable mountpoint"
27 +The following commands allows one to recursively change the type of all the
28 +mounts under a given mountpoint.
31 +.B "mount --make-rshared mountpoint"
33 +.B "mount --make-rslave mountpoint"
35 +.B "mount --make-rprivate mountpoint"
38 +"mount --make-runbindable mountpoint"
44 file system is not associated with a special device, and when
45 --- util-linux-2.13-pre6/mount/mount_constants.h.subtree 2002-11-01 01:24:36.000000000 +0100
46 +++ util-linux-2.13-pre6/mount/mount_constants.h 2006-06-12 09:19:43.000000000 +0200
49 #define MS_VERBOSE 0x8000 /* 32768 */
51 +#ifndef MS_UNBINDABLE
52 +#define MS_UNBINDABLE (1<<17) /* 131072 unbindable*/
55 +#define MS_PRIVATE (1<<18) /* 262144 Private*/
58 +#define MS_SLAVE (1<<19) /* 524288 Slave*/
61 +#define MS_SHARED (1<<20) /* 1048576 Shared*/
64 * Magic mount flag number. Had to be or-ed to the flag values.
66 --- util-linux-2.13-pre6/mount/mount.c.subtree 2006-06-12 09:18:26.000000000 +0200
67 +++ util-linux-2.13-pre6/mount/mount.c 2006-06-12 09:19:43.000000000 +0200
69 /* Add volumelabel in a listing of mounted devices (-l). */
70 static int list_with_volumelabel = 0;
72 -/* Nonzero for mount {--bind|--replace|--before|--after|--over|--move} */
73 +/* Nonzero for mount {--bind|--replace|--before|--after|--over|--move|
74 + * make-shared|make-private|make-unbindable|make-slave}
76 static int mounttype = 0;
78 /* True if ruid != euid. */
80 #define MS_USER 0x20000000
81 #define MS_OWNER 0x10000000
82 #define MS_GROUP 0x08000000
83 -#define MS_CRYPT 0x00040000
84 -#define MS_COMMENT 0x00020000
85 +#define MS_CRYPT 0x04000000
86 +#define MS_COMMENT 0x02000000
87 #define MS_LOOP 0x00010000
89 /* Options that we keep the mount system call from seeing. */
90 #define MS_NOSYS (MS_NOAUTO|MS_USERS|MS_USER|MS_COMMENT|MS_LOOP)
92 /* Options that we keep from appearing in the options field in the mtab. */
93 #define MS_NOMTAB (MS_REMOUNT|MS_NOAUTO|MS_USERS|MS_USER)
95 +#define MS_PROPAGATION (MS_SHARED|MS_SLAVE|MS_UNBINDABLE|MS_PRIVATE)
97 /* Options that we make ordinary users have by default. */
98 #define MS_SECURE (MS_NOEXEC|MS_NOSUID|MS_NODEV)
103 *flags &= ~MS_RDONLY;
105 + if (mounttype & MS_PROPAGATION)
106 + *flags &= ~MS_BIND;
110 @@ -916,13 +923,15 @@
111 opt_encryption = tmp;
114 - update_mtab_entry(loop ? loopfile : crypt ? realdev : spec,
115 + if (!(mounttype & MS_PROPAGATION)) {
116 + update_mtab_entry(loop ? loopfile : crypt ? realdev : spec,
118 types ? types : "unknown",
119 fix_opts_string (flags & ~MS_NOMTAB, extra_opts, user),
125 block_signals (SIG_UNBLOCK);
127 @@ -1461,6 +1470,14 @@
128 { "move", 0, 0, 133 },
129 { "guess-fstype", 1, 0, 134 },
130 { "rbind", 0, 0, 135 },
131 + { "make-shared", 0, 0, 136 },
132 + { "make-slave", 0, 0, 137 },
133 + { "make-private", 0, 0, 138 },
134 + { "make-unbindable", 0, 0, 139 },
135 + { "make-rshared", 0, 0, 140 },
136 + { "make-rslave", 0, 0, 141 },
137 + { "make-rprivate", 0, 0, 142 },
138 + { "make-runbindable", 0, 0, 143 },
139 { "internal-only", 0, 0, 'i' },
142 @@ -1487,6 +1504,17 @@
143 " mount --bind olddir newdir\n"
144 "or move a subtree:\n"
145 " mount --move olddir newdir\n"
146 + "One can change the type of mount containing the directory dir:\n"
147 + " mount --make-shared dir\n"
148 + " mount --make-slave dir\n"
149 + " mount --make-private dir\n"
150 + " mount --make-unbindable dir\n"
151 + "One can change the type of all the mounts in a mount subtree\n"
152 + "containing the directory dir:\n"
153 + " mount --make-rshared dir\n"
154 + " mount --make-rslave dir\n"
155 + " mount --make-rprivate dir\n"
156 + " mount --make-runbindable dir\n"
157 "A device can be given by name, say /dev/hda1 or /dev/cdrom,\n"
158 "or by label, using -L label or by uuid, using -U uuid .\n"
159 "Other options: [-nfFrsvw] [-o options] [-p passwdfd].\n"
160 @@ -1638,6 +1666,39 @@
162 mounttype = (MS_BIND | MS_REC);
166 + mounttype = MS_SHARED;
170 + mounttype = MS_SLAVE;
174 + mounttype = MS_PRIVATE;
178 + mounttype = MS_UNBINDABLE;
182 + mounttype = (MS_SHARED | MS_REC);
186 + mounttype = (MS_SLAVE | MS_REC);
190 + mounttype = (MS_PRIVATE | MS_REC);
194 + mounttype = (MS_UNBINDABLE | MS_REC);
199 usage (stderr, EX_USAGE);