Lines Matching refs:mount
7 3) Setting mount states
33 a. shared mount
34 b. slave mount
35 c. private mount
36 d. unbindable mount
39 2a) A shared mount can be replicated to as many mountpoints and all the
44 Let's say /mnt has a mount that is shared.
45 mount --make-shared /mnt
47 Note: mount(8) command now supports the --make-shared flag,
51 # mount --bind /mnt /tmp
52 The above command replicates the mount at /mnt to the mountpoint /tmp
61 Now let's say we mount a device at /tmp/a
62 # mount /dev/sd0 /tmp/a
70 Note that the mount has propagated to the mount at /mnt as well.
76 2b) A slave mount is like a shared mount except that mount and umount events
79 All slave mounts have a master mount which is a shared.
83 Let's say /mnt has a mount which is shared.
84 # mount --make-shared /mnt
86 Let's bind mount /mnt to /tmp
87 # mount --bind /mnt /tmp
89 the new mount at /tmp becomes a shared mount and it is a replica of
90 the mount at /mnt.
92 Now let's make the mount at /tmp; a slave of /mnt
93 # mount --make-slave /tmp
95 let's mount /dev/sd0 on /mnt/a
96 # mount /dev/sd0 /mnt/a
104 Note the mount event has propagated to the mount at /tmp
106 However let's see what happens if we mount something on the mount at /tmp
108 # mount /dev/sd1 /tmp/b
115 Note how the mount event has not propagated to the mount at
119 2c) A private mount does not forward or receive propagation.
121 This is the mount we are familiar with. Its the default type.
124 2d) A unbindable mount is a unbindable private mount
126 let's say we have a mount at /mnt and we make is unbindable
128 # mount --make-unbindable /mnt
130 Let's try to bind mount this mount somewhere else.
131 # mount --bind /mnt /tmp
132 mount: wrong fs type, bad option, bad superblock on /mnt,
135 Binding a unbindable mount is a invalid operation.
138 3) Setting mount states
140 The mount command (util-linux package) can be used to set mount
143 mount --make-shared mountpoint
144 mount --make-slave mountpoint
145 mount --make-private mountpoint
146 mount --make-unbindable mountpoint
157 The system administrator can make the mount at /cdrom shared
158 mount --bind /cdrom /cdrom
159 mount --make-shared /cdrom
162 mount at /cdrom which is a replica of the same mount in the
165 So when a CD is inserted and mounted at /cdrom that mount gets
166 propagated to the other mount at /cdrom in all the other clone
174 To begin with, the administrator can mark the entire mount tree
177 mount --make-rshared /
182 mount --make-rslave /myprivatetree
204 If the entire mount tree is visible at multiple locations, then
211 mount --make-shared /
212 mount --rbind / /view/v1
213 mount --rbind / /view/v2
214 mount --rbind / /view/v3
215 mount --rbind / /view/v4
218 mount appears at /view/v1/usr, /view/v2/usr, /view/v3/usr and
230 bind, rbind, move, mount, umount and clone-namespace operations.
232 Note: the word 'vfsmount' and the noun 'mount' have been used
237 A given mount can be in one of the following states
245 that leads to mount or unmount actions in other vfsmounts.
252 A 'shared mount' is defined as a vfsmount that belongs to a
256 mount --make-shared /mnt
257 mount --bind /mnt /tmp
259 The mount at /mnt and that at /tmp are both shared and belong
267 A 'slave mount' is defined as a vfsmount that receives
270 A slave mount as the name implies has a master mount from which
271 mount/unmount events are received. Events do not propagate from
272 the slave mount to the master. Only a shared mount can be made
275 mount --make-slave mount
277 A shared mount that is made as a slave is no more shared unless
283 indicates that the mount is a slave of some vfsmount, and
294 mount --make-shared mount
297 (4) Private mount
299 A 'private mount' is defined as vfsmount that does not
302 (5) Unbindable mount
304 A 'unbindable mount' is defined as vfsmount that does not
310 The state diagram below explains the state transition of a mount,
329 * if the shared mount is the only mount in its peer group, making it
333 ** slaving a non-shared mount has no effect on the mount.
336 the state of a mount depending on type of the destination mount. Its
343 mount --bind A/a B/b
345 where 'A' is the source mount, 'a' is the dentry in the mount 'A', 'B'
346 is the destination mount and 'b' is the dentry in the destination mount.
348 The outcome depends on the type of mount of 'A' and 'B'. The table
365 1. 'A' is a shared mount and 'B' is a shared mount. A new mount 'C'
367 mounted on mount 'B' at dentry 'b'. Also new mount 'C1', 'C2', 'C3' ...
374 2. 'A' is a private mount and 'B' is a shared mount. A new mount 'C'
376 mounted on mount 'B' at dentry 'b'. Also new mount 'C1', 'C2', 'C3' ...
382 3. 'A' is a slave mount of mount 'Z' and 'B' is a shared mount. A new
383 mount 'C' which is clone of 'A', is created. Its root dentry is 'a' .
384 'C' is mounted on mount 'B' at dentry 'b'. Also new mounts 'C1', 'C2',
388 propagation tree for 'B'. And finally the mount 'C' and its peer group
389 is made the slave of mount 'Z'. In other words, mount 'C' is in the
392 4. 'A' is a unbindable mount and 'B' is a shared mount. This is a
395 5. 'A' is a private mount and 'B' is a non-shared(private or slave or
396 unbindable) mount. A new mount 'C' which is clone of 'A', is created.
397 Its root dentry is 'a'. 'C' is mounted on mount 'B' at dentry 'b'.
399 6. 'A' is a shared mount and 'B' is a non-shared mount. A new mount 'C'
401 mounted on mount 'B' at dentry 'b'. 'C' is made a member of the
404 7. 'A' is a slave mount of mount 'Z' and 'B' is a non-shared mount. A
405 new mount 'C' which is a clone of 'A' is created. Its root dentry is
406 'a'. 'C' is mounted on mount 'B' at dentry 'b'. Also 'C' is set as a
407 slave mount of 'Z'. In other words 'A' and 'C' are both slave mounts of
408 'Z'. All mount/unmount events on 'Z' propagates to 'A' and 'C'. But
409 mount/unmount on 'A' do not propagate anywhere else. Similarly
410 mount/unmount on 'C' do not propagate anywhere else.
412 8. 'A' is a unbindable mount and 'B' is a non-shared mount. This is a
413 invalid operation. A unbindable mount cannot be bind mounted.
417 rbind is same as bind. Bind replicates the specified mount. Rbind
418 replicates all the mounts in the tree belonging to the specified mount.
419 Rbind mount is bind mount applied to all the mounts in the tree.
422 then the subtree under the unbindable mount is pruned in the new
425 eg: let's say we have the following mount tree.
433 Let's say all the mount except the mount C in the tree are
454 mount --move A B/b
456 where 'A' is the source mount, 'B' is the destination mount and 'b' is
457 the dentry in the destination mount.
459 The outcome depends on the type of the mount of 'A' and 'B'. The table
473 NOTE: moving a mount residing under a shared mount is invalid.
477 1. 'A' is a shared mount and 'B' is a shared mount. The mount 'A' is
478 mounted on mount 'B' at dentry 'b'. Also new mounts 'A1', 'A2'...'An'
480 propagation from mount 'B'. A new propagation tree is created in the
486 2. 'A' is a private mount and 'B' is a shared mount. The mount 'A' is
487 mounted on mount 'B' at dentry 'b'. Also new mount 'A1', 'A2'... 'An'
489 propagation from mount 'B'. The mount 'A' becomes a shared mount and a
494 3. 'A' is a slave mount of mount 'Z' and 'B' is a shared mount. The
495 mount 'A' is mounted on mount 'B' at dentry 'b'. Also new mounts 'A1',
497 receive propagation from mount 'B'. A new propagation tree is created
501 'A'. Mount 'A' continues to be the slave mount of 'Z' but it also
504 4. 'A' is a unbindable mount and 'B' is a shared mount. The operation
505 is invalid. Because mounting anything on the shared mount 'B' can
507 propagation from 'B'. And since the mount 'A' is unbindable, cloning
508 it to mount at other mountpoints is not possible.
510 5. 'A' is a private mount and 'B' is a non-shared(private or slave or
511 unbindable) mount. The mount 'A' is mounted on mount 'B' at dentry 'b'.
513 6. 'A' is a shared mount and 'B' is a non-shared mount. The mount 'A'
514 is mounted on mount 'B' at dentry 'b'. Mount 'A' continues to be a
515 shared mount.
517 7. 'A' is a slave mount of mount 'Z' and 'B' is a non-shared mount.
518 The mount 'A' is mounted on mount 'B' at dentry 'b'. Mount 'A'
519 continues to be a slave mount of mount 'Z'.
521 8. 'A' is a unbindable mount and 'B' is a non-shared mount. The mount
522 'A' is mounted on mount 'B' at dentry 'b'. Mount 'A' continues to be a
523 unbindable mount.
529 mount device B/b
531 'B' is the destination mount and 'b' is the dentry in the destination
532 mount.
535 that the source mount is always a private mount.
544 where 'A' is a mount mounted on mount 'B' at dentry 'b'.
546 If mount 'B' is shared, then all most-recently-mounted mounts at dentry
547 'b' on mounts that receive propagation from mount 'B' and does not have
553 let's say 'A1', 'A2', 'A3' are first mounted at dentry 'b' on mount
557 mount 'B1', 'B2' and 'B3' respectively.
562 'B1' propagates to 'B2' and 'B3'. And the most recently mounted mount
563 on 'B2' at dentry 'b' is 'C2', and that of mount 'B3' is 'C3'.
567 If any of 'C2' or 'C3' has some child mounts, then that mount is not
583 If 'A' is a slave mount of 'Z', then 'B' is also the slave mount of
586 If 'A' is a private mount, then 'B' is a private mount too.
588 If 'A' is unbindable mount, then 'B' is a unbindable mount too.
595 mount --bind /mnt /mnt
596 mount --make-shared /mnt
597 mount --bind /mnt /tmp
598 mount --move /tmp /mnt/1
607 mount --make-rshared /
609 mount --rbind / /v/1
616 mount --bind /mnt /mnt
617 mount --make-shared /mnt
619 mount --bind /mnt/1 /tmp
620 mount --make-slave /mnt
621 mount --make-shared /mnt
622 mount --bind /mnt/1/2 /tmp1
623 mount --make-slave /mnt
625 At this point we have the first mount at /tmp and
626 its root dentry is 1. Let's call this mount 'A'
627 And then we have a second mount at /tmp1 with root
628 dentry 2. Let's call this mount 'B'
629 Next we have a third mount at /mnt with root dentry
630 mnt. Let's call this mount 'C'
637 mount --bind /bin /tmp/test
639 The mount is attempted on 'A'
641 will the mount propagate to 'B' and 'C' ?
648 Q1. Why is bind mount needed? How is it different from symbolic links?
649 symbolic links can get stale if the destination mount gets
651 other mount is unmounted or moved.
657 semantics of slave mount using exportfs?
659 Q3 Why is unbindable mount needed?
661 Let's say we want to replicate the mount tree at multiple
666 Having unbindable mount can help prune the unneeded bind
680 mount --make-shared /root
684 mount --rbind /root /tmp/m1
702 mount --rbind /root /tmp/m2
728 mount --rbind /root /tmp/m3
752 mount --bind /root/tmp /root/tmp
754 mount --make-rshared /root
755 mount --make-unbindable /root/tmp
759 mount --rbind /root /tmp/m1
773 mount --rbind /root /tmp/m2
788 mount --rbind /root /tmp/m3
810 ->mnt_share links together all the mount to/from which this vfsmount
878 NOTE: The propagation tree is orthogonal to the mount tree.
905 for each mount in the source tree:
906 a) Create the necessary number of mount trees to
908 propagation from the destination mount.
913 mount.
919 Also there should be 'm' new mount trees, where 'm' is
920 the number of mounts to which the destination mount
926 attach each of the mount trees to their corresponding