Lines Matching full:mount

10 	3) Setting mount states
36 a. shared mount
37 b. slave mount
38 c. private mount
39 d. unbindable mount
42 2a) A shared mount can be replicated to as many mountpoints and all the
47 Let's say /mnt has a mount that is shared::
49 mount --make-shared /mnt
51 Note: mount(8) command now supports the --make-shared flag,
57 # mount --bind /mnt /tmp
59 The above command replicates the mount at /mnt to the mountpoint /tmp
70 Now let's say we mount a device at /tmp/a::
72 # mount /dev/sd0 /tmp/a
80 Note that the mount has propagated to the mount at /mnt as well.
86 2b) A slave mount is like a shared mount except that mount and umount events
89 All slave mounts have a master mount which is a shared.
93 Let's say /mnt has a mount which is shared.
94 # mount --make-shared /mnt
96 Let's bind mount /mnt to /tmp
97 # mount --bind /mnt /tmp
99 the new mount at /tmp becomes a shared mount and it is a replica of
100 the mount at /mnt.
102 Now let's make the mount at /tmp; a slave of /mnt
103 # mount --make-slave /tmp
105 let's mount /dev/sd0 on /mnt/a
106 # mount /dev/sd0 /mnt/a
114 Note the mount event has propagated to the mount at /tmp
116 However let's see what happens if we mount something on the mount at /tmp
118 # mount /dev/sd1 /tmp/b
125 Note how the mount event has not propagated to the mount at
129 2c) A private mount does not forward or receive propagation.
131 This is the mount we are familiar with. Its the default type.
134 2d) A unbindable mount is a unbindable private mount
136 let's say we have a mount at /mnt and we make it unbindable::
138 # mount --make-unbindable /mnt
140 Let's try to bind mount this mount somewhere else::
142 # mount --bind /mnt /tmp
143 mount: wrong fs type, bad option, bad superblock on /mnt,
146 Binding a unbindable mount is a invalid operation.
149 3) Setting mount states
151 The mount command (util-linux package) can be used to set mount
154 mount --make-shared mountpoint
155 mount --make-slave mountpoint
156 mount --make-private mountpoint
157 mount --make-unbindable mountpoint
168 The system administrator can make the mount at /cdrom shared::
170 mount --bind /cdrom /cdrom
171 mount --make-shared /cdrom
174 mount at /cdrom which is a replica of the same mount in the
177 So when a CD is inserted and mounted at /cdrom that mount gets
178 propagated to the other mount at /cdrom in all the other clone
186 To begin with, the administrator can mark the entire mount tree
189 mount --make-rshared /
194 mount --make-rslave /myprivatetree
216 If the entire mount tree is visible at multiple locations, then
223 mount --make-shared /
224 mount --rbind / /view/v1
225 mount --rbind / /view/v2
226 mount --rbind / /view/v3
227 mount --rbind / /view/v4
230 mount appears at /view/v1/usr, /view/v2/usr, /view/v3/usr and
242 bind, rbind, move, mount, umount and clone-namespace operations.
244 Note: the word 'vfsmount' and the noun 'mount' have been used
247 5a) Mount states
249 A given mount can be in one of the following states
258 that leads to mount or unmount actions in other vfsmounts.
265 A 'shared mount' is defined as a vfsmount that belongs to a
270 mount --make-shared /mnt
271 mount --bind /mnt /tmp
273 The mount at /mnt and that at /tmp are both shared and belong
281 A 'slave mount' is defined as a vfsmount that receives
284 A slave mount as the name implies has a master mount from which
285 mount/unmount events are received. Events do not propagate from
286 the slave mount to the master. Only a shared mount can be made
289 mount --make-slave mount
291 A shared mount that is made as a slave is no more shared unless
297 indicates that the mount is a slave of some vfsmount, and
309 mount --make-shared mount
313 (4) Private mount
315 A 'private mount' is defined as vfsmount that does not
318 (5) Unbindable mount
320 A 'unbindable mount' is defined as vfsmount that does not
327 The state diagram below explains the state transition of a mount,
347 * if the shared mount is the only mount in its peer group, making it
351 ** slaving a non-shared mount has no effect on the mount.
354 the state of a mount depending on type of the destination mount. Its
361 mount --bind A/a B/b
363 where 'A' is the source mount, 'a' is the dentry in the mount 'A', 'B'
364 is the destination mount and 'b' is the dentry in the destination mount.
366 The outcome depends on the type of mount of 'A' and 'B'. The table
370 | BIND MOUNT OPERATION |
384 1. 'A' is a shared mount and 'B' is a shared mount. A new mount 'C'
386 mounted on mount 'B' at dentry 'b'. Also new mount 'C1', 'C2', 'C3' ...
393 2. 'A' is a private mount and 'B' is a shared mount. A new mount 'C'
395 mounted on mount 'B' at dentry 'b'. Also new mount 'C1', 'C2', 'C3' ...
401 3. 'A' is a slave mount of mount 'Z' and 'B' is a shared mount. A new
402 mount 'C' which is clone of 'A', is created. Its root dentry is 'a' .
403 'C' is mounted on mount 'B' at dentry 'b'. Also new mounts 'C1', 'C2',
407 propagation tree for 'B'. And finally the mount 'C' and its peer group
408 is made the slave of mount 'Z'. In other words, mount 'C' is in the
411 4. 'A' is a unbindable mount and 'B' is a shared mount. This is a
414 5. 'A' is a private mount and 'B' is a non-shared(private or slave or
415 unbindable) mount. A new mount 'C' which is clone of 'A', is created.
416 Its root dentry is 'a'. 'C' is mounted on mount 'B' at dentry 'b'.
418 6. 'A' is a shared mount and 'B' is a non-shared mount. A new mount 'C'
420 mounted on mount 'B' at dentry 'b'. 'C' is made a member of the
423 7. 'A' is a slave mount of mount 'Z' and 'B' is a non-shared mount. A
424 new mount 'C' which is a clone of 'A' is created. Its root dentry is
425 'a'. 'C' is mounted on mount 'B' at dentry 'b'. Also 'C' is set as a
426 slave mount of 'Z'. In other words 'A' and 'C' are both slave mounts of
427 'Z'. All mount/unmount events on 'Z' propagates to 'A' and 'C'. But
428 mount/unmount on 'A' do not propagate anywhere else. Similarly
429 mount/unmount on 'C' do not propagate anywhere else.
431 8. 'A' is a unbindable mount and 'B' is a non-shared mount. This is a
432 invalid operation. A unbindable mount cannot be bind mounted.
436 rbind is same as bind. Bind replicates the specified mount. Rbind
437 replicates all the mounts in the tree belonging to the specified mount.
438 Rbind mount is bind mount applied to all the mounts in the tree.
441 then the subtree under the unbindable mount is pruned in the new
446 let's say we have the following mount tree::
454 Let's say all the mount except the mount C in the tree are
475 mount --move A B/b
477 where 'A' is the source mount, 'B' is the destination mount and 'b' is
478 the dentry in the destination mount.
480 The outcome depends on the type of the mount of 'A' and 'B'. The table
484 | MOVE MOUNT OPERATION |
496 .. Note:: moving a mount residing under a shared mount is invalid.
500 1. 'A' is a shared mount and 'B' is a shared mount. The mount 'A' is
501 mounted on mount 'B' at dentry 'b'. Also new mounts 'A1', 'A2'...'An'
503 propagation from mount 'B'. A new propagation tree is created in the
509 2. 'A' is a private mount and 'B' is a shared mount. The mount 'A' is
510 mounted on mount 'B' at dentry 'b'. Also new mount 'A1', 'A2'... 'An'
512 propagation from mount 'B'. The mount 'A' becomes a shared mount and a
517 3. 'A' is a slave mount of mount 'Z' and 'B' is a shared mount. The
518 mount 'A' is mounted on mount 'B' at dentry 'b'. Also new mounts 'A1',
520 receive propagation from mount 'B'. A new propagation tree is created
524 'A'. Mount 'A' continues to be the slave mount of 'Z' but it also
527 4. 'A' is a unbindable mount and 'B' is a shared mount. The operation
528 is invalid. Because mounting anything on the shared mount 'B' can
530 propagation from 'B'. And since the mount 'A' is unbindable, cloning
531 it to mount at other mountpoints is not possible.
533 5. 'A' is a private mount and 'B' is a non-shared(private or slave or
534 unbindable) mount. The mount 'A' is mounted on mount 'B' at dentry 'b'.
536 6. 'A' is a shared mount and 'B' is a non-shared mount. The mount 'A'
537 is mounted on mount 'B' at dentry 'b'. Mount 'A' continues to be a
538 shared mount.
540 7. 'A' is a slave mount of mount 'Z' and 'B' is a non-shared mount.
541 The mount 'A' is mounted on mount 'B' at dentry 'b'. Mount 'A'
542 continues to be a slave mount of mount 'Z'.
544 8. 'A' is a unbindable mount and 'B' is a non-shared mount. The mount
545 'A' is mounted on mount 'B' at dentry 'b'. Mount 'A' continues to be a
546 unbindable mount.
548 5e) Mount semantics
552 mount device B/b
554 'B' is the destination mount and 'b' is the dentry in the destination
555 mount.
558 that the source mount is always a private mount.
567 where 'A' is a mount mounted on mount 'B' at dentry 'b'.
569 If mount 'B' is shared, then all most-recently-mounted mounts at dentry
570 'b' on mounts that receive propagation from mount 'B' and does not have
576 let's say 'A1', 'A2', 'A3' are first mounted at dentry 'b' on mount
580 mount 'B1', 'B2' and 'B3' respectively.
585 'B1' propagates to 'B2' and 'B3'. And the most recently mounted mount
586 on 'B2' at dentry 'b' is 'C2', and that of mount 'B3' is 'C3'.
590 If any of 'C2' or 'C3' has some child mounts, then that mount is not
606 If 'A' is a slave mount of 'Z', then 'B' is also the slave mount of
609 If 'A' is a private mount, then 'B' is a private mount too.
611 If 'A' is unbindable mount, then 'B' is a unbindable mount too.
620 mount --bind /mnt /mnt
621 mount --make-shared /mnt
622 mount --bind /mnt /tmp
623 mount --move /tmp /mnt/1
634 mount --make-rshared /
636 mount --rbind / /v/1
645 mount --bind /mnt /mnt
646 mount --make-shared /mnt
648 mount --bind /mnt/1 /tmp
649 mount --make-slave /mnt
650 mount --make-shared /mnt
651 mount --bind /mnt/1/2 /tmp1
652 mount --make-slave /mnt
654 At this point we have the first mount at /tmp and
655 its root dentry is 1. Let's call this mount 'A'
656 And then we have a second mount at /tmp1 with root
657 dentry 2. Let's call this mount 'B'
658 Next we have a third mount at /mnt with root dentry
659 mnt. Let's call this mount 'C'
666 mount --bind /bin /tmp/test
668 The mount is attempted on 'A'
670 will the mount propagate to 'B' and 'C' ?
677 Q1. Why is bind mount needed? How is it different from symbolic links?
678 symbolic links can get stale if the destination mount gets
680 other mount is unmounted or moved.
686 semantics of slave mount using exportfs?
688 Q3 Why is unbindable mount needed?
690 Let's say we want to replicate the mount tree at multiple
695 Having unbindable mount can help prune the unneeded bind
713 mount --make-shared /root
717 mount --rbind /root /tmp/m1
737 mount --rbind /root /tmp/m2
764 mount --rbind /root /tmp/m3
792 mount --bind /root/tmp /root/tmp
794 mount --make-rshared /root
795 mount --make-unbindable /root/tmp
799 mount --rbind /root /tmp/m1
815 mount --rbind /root /tmp/m2
831 mount --rbind /root /tmp/m3
855 links together all the mount to/from which this vfsmount
932 NOTE: The propagation tree is orthogonal to the mount tree.
959 for each mount in the source tree:
961 a) Create the necessary number of mount trees to
963 propagation from the destination mount.
968 mount.
974 Also there should be 'm' new mount trees, where 'm' is
975 the number of mounts to which the destination mount
981 attach each of the mount trees to their corresponding