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
152 The mount command (util-linux package) can be used to set mount
155 mount --make-shared mountpoint
156 mount --make-slave mountpoint
157 mount --make-private mountpoint
158 mount --make-unbindable mountpoint
169 The system administrator can make the mount at /cdrom shared::
171 mount --bind /cdrom /cdrom
172 mount --make-shared /cdrom
175 mount at /cdrom which is a replica of the same mount in the
178 So when a CD is inserted and mounted at /cdrom that mount gets
179 propagated to the other mount at /cdrom in all the other clone
187 To begin with, the administrator can mark the entire mount tree
190 mount --make-rshared /
195 mount --make-rslave /myprivatetree
217 If the entire mount tree is visible at multiple locations, then
224 mount --make-shared /
225 mount --rbind / /view/v1
226 mount --rbind / /view/v2
227 mount --rbind / /view/v3
228 mount --rbind / /view/v4
231 mount appears at /view/v1/usr, /view/v2/usr, /view/v3/usr and
243 bind, rbind, move, mount, umount and clone-namespace operations.
245 Note: the word 'vfsmount' and the noun 'mount' have been used
248 5a) Mount states
250 A given mount can be in one of the following states
259 that leads to mount or unmount actions in other vfsmounts.
266 A 'shared mount' is defined as a vfsmount that belongs to a
271 mount --make-shared /mnt
272 mount --bind /mnt /tmp
274 The mount at /mnt and that at /tmp are both shared and belong
282 A 'slave mount' is defined as a vfsmount that receives
285 A slave mount as the name implies has a master mount from which
286 mount/unmount events are received. Events do not propagate from
287 the slave mount to the master. Only a shared mount can be made
290 mount --make-slave mount
292 A shared mount that is made as a slave is no more shared unless
298 indicates that the mount is a slave of some vfsmount, and
310 mount --make-shared mount
314 (4) Private mount
316 A 'private mount' is defined as vfsmount that does not
319 (5) Unbindable mount
321 A 'unbindable mount' is defined as vfsmount that does not
328 The state diagram below explains the state transition of a mount,
348 * if the shared mount is the only mount in its peer group, making it
352 ** slaving a non-shared mount has no effect on the mount.
355 the state of a mount depending on type of the destination mount. Its
362 mount --bind A/a B/b
364 where 'A' is the source mount, 'a' is the dentry in the mount 'A', 'B'
365 is the destination mount and 'b' is the dentry in the destination mount.
367 The outcome depends on the type of mount of 'A' and 'B'. The table
371 | BIND MOUNT OPERATION |
385 1. 'A' is a shared mount and 'B' is a shared mount. A new mount 'C'
387 mounted on mount 'B' at dentry 'b'. Also new mount 'C1', 'C2', 'C3' ...
394 2. 'A' is a private mount and 'B' is a shared mount. A new mount 'C'
396 mounted on mount 'B' at dentry 'b'. Also new mount 'C1', 'C2', 'C3' ...
402 3. 'A' is a slave mount of mount 'Z' and 'B' is a shared mount. A new
403 mount 'C' which is clone of 'A', is created. Its root dentry is 'a' .
404 'C' is mounted on mount 'B' at dentry 'b'. Also new mounts 'C1', 'C2',
408 propagation tree for 'B'. And finally the mount 'C' and its peer group
409 is made the slave of mount 'Z'. In other words, mount 'C' is in the
412 4. 'A' is a unbindable mount and 'B' is a shared mount. This is a
415 5. 'A' is a private mount and 'B' is a non-shared(private or slave or
416 unbindable) mount. A new mount 'C' which is clone of 'A', is created.
417 Its root dentry is 'a'. 'C' is mounted on mount 'B' at dentry 'b'.
419 6. 'A' is a shared mount and 'B' is a non-shared mount. A new mount 'C'
421 mounted on mount 'B' at dentry 'b'. 'C' is made a member of the
424 7. 'A' is a slave mount of mount 'Z' and 'B' is a non-shared mount. A
425 new mount 'C' which is a clone of 'A' is created. Its root dentry is
426 'a'. 'C' is mounted on mount 'B' at dentry 'b'. Also 'C' is set as a
427 slave mount of 'Z'. In other words 'A' and 'C' are both slave mounts of
428 'Z'. All mount/unmount events on 'Z' propagates to 'A' and 'C'. But
429 mount/unmount on 'A' do not propagate anywhere else. Similarly
430 mount/unmount on 'C' do not propagate anywhere else.
432 8. 'A' is a unbindable mount and 'B' is a non-shared mount. This is a
433 invalid operation. A unbindable mount cannot be bind mounted.
437 rbind is same as bind. Bind replicates the specified mount. Rbind
438 replicates all the mounts in the tree belonging to the specified mount.
439 Rbind mount is bind mount applied to all the mounts in the tree.
442 then the subtree under the unbindable mount is pruned in the new
447 let's say we have the following mount tree::
455 Let's say all the mount except the mount C in the tree are
476 mount --move A B/b
478 where 'A' is the source mount, 'B' is the destination mount and 'b' is
479 the dentry in the destination mount.
481 The outcome depends on the type of the mount of 'A' and 'B'. The table
485 | MOVE MOUNT OPERATION |
497 .. Note:: moving a mount residing under a shared mount is invalid.
501 1. 'A' is a shared mount and 'B' is a shared mount. The mount 'A' is
502 mounted on mount 'B' at dentry 'b'. Also new mounts 'A1', 'A2'...'An'
504 propagation from mount 'B'. A new propagation tree is created in the
510 2. 'A' is a private mount and 'B' is a shared mount. The mount 'A' is
511 mounted on mount 'B' at dentry 'b'. Also new mount 'A1', 'A2'... 'An'
513 propagation from mount 'B'. The mount 'A' becomes a shared mount and a
518 3. 'A' is a slave mount of mount 'Z' and 'B' is a shared mount. The
519 mount 'A' is mounted on mount 'B' at dentry 'b'. Also new mounts 'A1',
521 receive propagation from mount 'B'. A new propagation tree is created
525 'A'. Mount 'A' continues to be the slave mount of 'Z' but it also
528 4. 'A' is a unbindable mount and 'B' is a shared mount. The operation
529 is invalid. Because mounting anything on the shared mount 'B' can
531 propagation from 'B'. And since the mount 'A' is unbindable, cloning
532 it to mount at other mountpoints is not possible.
534 5. 'A' is a private mount and 'B' is a non-shared(private or slave or
535 unbindable) mount. The mount 'A' is mounted on mount 'B' at dentry 'b'.
537 6. 'A' is a shared mount and 'B' is a non-shared mount. The mount 'A'
538 is mounted on mount 'B' at dentry 'b'. Mount 'A' continues to be a
539 shared mount.
541 7. 'A' is a slave mount of mount 'Z' and 'B' is a non-shared mount.
542 The mount 'A' is mounted on mount 'B' at dentry 'b'. Mount 'A'
543 continues to be a slave mount of mount 'Z'.
545 8. 'A' is a unbindable mount and 'B' is a non-shared mount. The mount
546 'A' is mounted on mount 'B' at dentry 'b'. Mount 'A' continues to be a
547 unbindable mount.
549 5e) Mount semantics
553 mount device B/b
555 'B' is the destination mount and 'b' is the dentry in the destination
556 mount.
559 that the source mount is always a private mount.
568 where 'A' is a mount mounted on mount 'B' at dentry 'b'.
570 If mount 'B' is shared, then all most-recently-mounted mounts at dentry
571 'b' on mounts that receive propagation from mount 'B' and does not have
577 let's say 'A1', 'A2', 'A3' are first mounted at dentry 'b' on mount
581 mount 'B1', 'B2' and 'B3' respectively.
586 'B1' propagates to 'B2' and 'B3'. And the most recently mounted mount
587 on 'B2' at dentry 'b' is 'C2', and that of mount 'B3' is 'C3'.
591 If any of 'C2' or 'C3' has some child mounts, then that mount is not
607 If 'A' is a slave mount of 'Z', then 'B' is also the slave mount of
610 If 'A' is a private mount, then 'B' is a private mount too.
612 If 'A' is unbindable mount, then 'B' is a unbindable mount too.
622 mount --bind /mnt /mnt
623 mount --make-shared /mnt
624 mount --bind /mnt /tmp
625 mount --move /tmp /mnt/1
636 mount --make-rshared /
638 mount --rbind / /v/1
647 mount --bind /mnt /mnt
648 mount --make-shared /mnt
650 mount --bind /mnt/1 /tmp
651 mount --make-slave /mnt
652 mount --make-shared /mnt
653 mount --bind /mnt/1/2 /tmp1
654 mount --make-slave /mnt
656 At this point we have the first mount at /tmp and
657 its root dentry is 1. Let's call this mount 'A'
658 And then we have a second mount at /tmp1 with root
659 dentry 2. Let's call this mount 'B'
660 Next we have a third mount at /mnt with root dentry
661 mnt. Let's call this mount 'C'
668 mount --bind /bin /tmp/test
670 The mount is attempted on 'A'
672 will the mount propagate to 'B' and 'C' ?
680 Q1. Why is bind mount needed? How is it different from symbolic links?
681 symbolic links can get stale if the destination mount gets
683 other mount is unmounted or moved.
689 semantics of slave mount using exportfs?
691 Q3 Why is unbindable mount needed?
693 Let's say we want to replicate the mount tree at multiple
698 Having unbindable mount can help prune the unneeded bind
716 mount --make-shared /root
720 mount --rbind /root /tmp/m1
740 mount --rbind /root /tmp/m2
767 mount --rbind /root /tmp/m3
795 mount --bind /root/tmp /root/tmp
797 mount --make-rshared /root
798 mount --make-unbindable /root/tmp
802 mount --rbind /root /tmp/m1
818 mount --rbind /root /tmp/m2
834 mount --rbind /root /tmp/m3
859 links together all the mount to/from which this vfsmount
936 NOTE: The propagation tree is orthogonal to the mount tree.
963 for each mount in the source tree:
965 a) Create the necessary number of mount trees to
967 propagation from the destination mount.
972 mount.
978 Also there should be 'm' new mount trees, where 'm' is
979 the number of mounts to which the destination mount
985 attach each of the mount trees to their corresponding