Lines Matching refs:mount
10 3) Setting mount states
37 a) A **shared mount** can be replicated to as many mountpoints and all the
42 Let's say /mnt has a mount that is shared::
44 # mount --make-shared /mnt
47 mount(8) command now supports the --make-shared flag,
53 # mount --bind /mnt /tmp
55 The above command replicates the mount at /mnt to the mountpoint /tmp
66 Now let's say we mount a device at /tmp/a::
68 # mount /dev/sd0 /tmp/a
76 Note that the mount has propagated to the mount at /mnt as well.
82 b) A **slave mount** is like a shared mount except that mount and umount events
85 All slave mounts have a master mount which is a shared.
89 Let's say /mnt has a mount which is shared::
91 # mount --make-shared /mnt
93 Let's bind mount /mnt to /tmp::
95 # mount --bind /mnt /tmp
97 the new mount at /tmp becomes a shared mount and it is a replica of
98 the mount at /mnt.
100 Now let's make the mount at /tmp; a slave of /mnt::
102 # mount --make-slave /tmp
104 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
119 # mount /dev/sd1 /tmp/b
126 Note how the mount event has not propagated to the mount at
130 c) A **private mount** does not forward or receive propagation.
132 This is the mount we are familiar with. Its the default type.
135 d) An **unbindable mount** is, as the name suggests, an unbindable private
136 mount.
138 let's say we have a mount at /mnt and we make it unbindable::
140 # mount --make-unbindable /mnt
142 Let's try to bind mount this mount somewhere else::
144 # mount --bind /mnt /tmp mount: wrong fs type, bad option, bad
147 Binding a unbindable mount is a invalid operation.
150 3) Setting mount states
153 The mount command (util-linux package) can be used to set mount
156 mount --make-shared mountpoint
157 mount --make-slave mountpoint
158 mount --make-private mountpoint
159 mount --make-unbindable mountpoint
170 The system administrator can make the mount at /cdrom shared::
172 mount --bind /cdrom /cdrom
173 mount --make-shared /cdrom
176 mount at /cdrom which is a replica of the same mount in the
179 So when a CD is inserted and mounted at /cdrom that mount gets
180 propagated to the other mount at /cdrom in all the other clone
188 To begin with, the administrator can mark the entire mount tree
191 mount --make-rshared /
196 mount --make-rslave /myprivatetree
218 If the entire mount tree is visible at multiple locations, then
225 mount --make-shared /
226 mount --rbind / /view/v1
227 mount --rbind / /view/v2
228 mount --rbind / /view/v3
229 mount --rbind / /view/v4
232 mount appears at /view/v1/usr, /view/v2/usr, /view/v3/usr and
244 bind, rbind, move, mount, umount and clone-namespace operations.
247 the word 'vfsmount' and the noun 'mount' have been used
253 that leads to mount or unmount actions in other vfsmounts.
258 A given mount can be in one of the following states:
262 A **shared mount** is defined as a vfsmount that belongs to a
267 mount --make-shared /mnt
268 mount --bind /mnt /tmp
270 The mount at /mnt and that at /tmp are both shared and belong
278 A **slave mount** is defined as a vfsmount that receives
281 A slave mount as the name implies has a master mount from which
282 mount/unmount events are received. Events do not propagate from
283 the slave mount to the master. Only a shared mount can be made
286 mount --make-slave mount
288 A shared mount that is made as a slave is no more shared unless
294 indicates that the mount is a slave of some vfsmount, and
306 mount --make-shared mount
310 (4) Private mount
312 A **private mount** is defined as vfsmount that does not
315 (5) Unbindable mount
317 A **unbindable mount** is defined as vfsmount that does not
324 The state diagram below explains the state transition of a mount,
344 * if the shared mount is the only mount in its peer group, making it
348 ** slaving a non-shared mount has no effect on the mount.
351 the state of a mount depending on type of the destination mount. Its
358 mount --bind A/a B/b
360 where 'A' is the source mount, 'a' is the dentry in the mount 'A', 'B'
361 is the destination mount and 'b' is the dentry in the destination mount.
363 The outcome depends on the type of mount of 'A' and 'B'. The table
381 1. 'A' is a shared mount and 'B' is a shared mount. A new mount 'C'
383 mounted on mount 'B' at dentry 'b'. Also new mount 'C1', 'C2', 'C3' ...
390 2. 'A' is a private mount and 'B' is a shared mount. A new mount 'C'
392 mounted on mount 'B' at dentry 'b'. Also new mount 'C1', 'C2', 'C3' ...
398 3. 'A' is a slave mount of mount 'Z' and 'B' is a shared mount. A new
399 mount 'C' which is clone of 'A', is created. Its root dentry is 'a' .
400 'C' is mounted on mount 'B' at dentry 'b'. Also new mounts 'C1', 'C2',
404 propagation tree for 'B'. And finally the mount 'C' and its peer group
405 is made the slave of mount 'Z'. In other words, mount 'C' is in the
408 4. 'A' is a unbindable mount and 'B' is a shared mount. This is a
411 5. 'A' is a private mount and 'B' is a non-shared(private or slave or
412 unbindable) mount. A new mount 'C' which is clone of 'A', is created.
413 Its root dentry is 'a'. 'C' is mounted on mount 'B' at dentry 'b'.
415 6. 'A' is a shared mount and 'B' is a non-shared mount. A new mount 'C'
417 mounted on mount 'B' at dentry 'b'. 'C' is made a member of the
420 7. 'A' is a slave mount of mount 'Z' and 'B' is a non-shared mount. A
421 new mount 'C' which is a clone of 'A' is created. Its root dentry is
422 'a'. 'C' is mounted on mount 'B' at dentry 'b'. Also 'C' is set as a
423 slave mount of 'Z'. In other words 'A' and 'C' are both slave mounts of
424 'Z'. All mount/unmount events on 'Z' propagates to 'A' and 'C'. But
425 mount/unmount on 'A' do not propagate anywhere else. Similarly
426 mount/unmount on 'C' do not propagate anywhere else.
428 8. 'A' is a unbindable mount and 'B' is a non-shared mount. This is a
429 invalid operation. A unbindable mount cannot be bind mounted.
433 rbind is same as bind. Bind replicates the specified mount. Rbind
434 replicates all the mounts in the tree belonging to the specified mount.
435 Rbind mount is bind mount applied to all the mounts in the tree.
438 then the subtree under the unbindable mount is pruned in the new
443 let's say we have the following mount tree::
451 Let's say all the mount except the mount C in the tree are
472 mount --move A B/b
474 where 'A' is the source mount, 'B' is the destination mount and 'b' is
475 the dentry in the destination mount.
477 The outcome depends on the type of the mount of 'A' and 'B'. The table
493 .. Note:: moving a mount residing under a shared mount is invalid.
497 1. 'A' is a shared mount and 'B' is a shared mount. The mount 'A' is
498 mounted on mount 'B' at dentry 'b'. Also new mounts 'A1', 'A2'...'An'
500 propagation from mount 'B'. A new propagation tree is created in the
506 2. 'A' is a private mount and 'B' is a shared mount. The mount 'A' is
507 mounted on mount 'B' at dentry 'b'. Also new mount 'A1', 'A2'... 'An'
509 propagation from mount 'B'. The mount 'A' becomes a shared mount and a
514 3. 'A' is a slave mount of mount 'Z' and 'B' is a shared mount. The
515 mount 'A' is mounted on mount 'B' at dentry 'b'. Also new mounts 'A1',
517 receive propagation from mount 'B'. A new propagation tree is created
521 'A'. Mount 'A' continues to be the slave mount of 'Z' but it also
524 4. 'A' is a unbindable mount and 'B' is a shared mount. The operation
525 is invalid. Because mounting anything on the shared mount 'B' can
527 propagation from 'B'. And since the mount 'A' is unbindable, cloning
528 it to mount at other mountpoints is not possible.
530 5. 'A' is a private mount and 'B' is a non-shared(private or slave or
531 unbindable) mount. The mount 'A' is mounted on mount 'B' at dentry 'b'.
533 6. 'A' is a shared mount and 'B' is a non-shared mount. The mount 'A'
534 is mounted on mount 'B' at dentry 'b'. Mount 'A' continues to be a
535 shared mount.
537 7. 'A' is a slave mount of mount 'Z' and 'B' is a non-shared mount.
538 The mount 'A' is mounted on mount 'B' at dentry 'b'. Mount 'A'
539 continues to be a slave mount of mount 'Z'.
541 8. 'A' is a unbindable mount and 'B' is a non-shared mount. The mount
542 'A' is mounted on mount 'B' at dentry 'b'. Mount 'A' continues to be a
543 unbindable mount.
549 mount device B/b
551 'B' is the destination mount and 'b' is the dentry in the destination
552 mount.
555 that the source mount is always a private mount.
564 where 'A' is a mount mounted on mount 'B' at dentry 'b'.
566 If mount 'B' is shared, then all most-recently-mounted mounts at dentry
567 'b' on mounts that receive propagation from mount 'B' and does not have
573 let's say 'A1', 'A2', 'A3' are first mounted at dentry 'b' on mount
577 mount 'B1', 'B2' and 'B3' respectively.
582 'B1' propagates to 'B2' and 'B3'. And the most recently mounted mount
583 on 'B2' at dentry 'b' is 'C2', and that of mount 'B3' is 'C3'.
587 If any of 'C2' or 'C3' has some child mounts, then that mount is not
603 If 'A' is a slave mount of 'Z', then 'B' is also the slave mount of
606 If 'A' is a private mount, then 'B' is a private mount too.
608 If 'A' is unbindable mount, then 'B' is a unbindable mount too.
618 mount --bind /mnt /mnt
619 mount --make-shared /mnt
620 mount --bind /mnt /tmp
621 mount --move /tmp /mnt/1
632 mount --make-rshared /
634 mount --rbind / /v/1
643 mount --bind /mnt /mnt
644 mount --make-shared /mnt
646 mount --bind /mnt/1 /tmp
647 mount --make-slave /mnt
648 mount --make-shared /mnt
649 mount --bind /mnt/1/2 /tmp1
650 mount --make-slave /mnt
652 At this point we have the first mount at /tmp and
653 its root dentry is 1. Let's call this mount 'A'
654 And then we have a second mount at /tmp1 with root
655 dentry 2. Let's call this mount 'B'
656 Next we have a third mount at /mnt with root dentry
657 mnt. Let's call this mount 'C'
664 mount --bind /bin /tmp/test
666 The mount is attempted on 'A'
668 will the mount propagate to 'B' and 'C' ?
676 1. 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 3. 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
765 mount --rbind /root /tmp/m3
793 mount --bind /root/tmp /root/tmp
795 mount --make-rshared /root
796 mount --make-unbindable /root/tmp
800 mount --rbind /root /tmp/m1
816 mount --rbind /root /tmp/m2
832 mount --rbind /root /tmp/m3
852 Links together all the mount to/from which this vfsmount
933 NOTE: The propagation tree is orthogonal to the mount tree.
956 For each mount in the source tree:
958 a) Create the necessary number of mount trees to
960 propagation from the destination mount.
965 mount.
971 Also there should be 'm' new mount trees, where 'm' is
972 the number of mounts to which the destination mount
979 Attach each of the mount trees to their corresponding