分页: 1 / 1

才发现mount的新用法

发表于 : 2009-04-16 20:02
bigsun
msn mouny
The bind mounts.
Since Linux 2.4.0 it is possible to remount part of the file
hierarchy somewhere else. The call is
mount --bind olddir newdir
or fstab entry is:
/olddir /newdir none bind

After this call the same contents is accessible in two places.
One can also remount a single file (on a single file).

This call attaches only (part of) a single filesystem, not pos‐
sible submounts. The entire file hierarchy including submounts
is attached a second place using
mount --rbind olddir newdir

Note that the filesystem mount options will remain the same as
those on the original mount point, and cannot be changed by
passing the -o option along with --bind/--rbind.
The move operation.
Since Linux 2.5.1 it is possible to atomically move a mounted
tree to another place. The call is
mount --move olddir newdir
The shared subtrees operations.
Since Linux 2.6.15 it is possible to mark a mount and its sub‐
mounts as shared, private, slave or unbindable. A shared mount
provides ability to create mirrors of that mount such that
mounts and umounts within any of the mirrors propagate to the
other mirror. A slave mount receives propagation from its mas‐
ter, but any not vice-versa. A private mount carries no propa‐
gation abilities. A unbindable mount is a private mount which
cannot cloned through a bind operation. Detailed semantics is
documented in Documentation/sharedsubtree.txt file in the kernel
source tree.

mount --make-shared mountpoint
mount --make-slave mountpoint
mount --make-private mountpoint
mount --make-unbindable mountpoint

The following commands allows one to recursively change the type
of all the mounts under a given mountpoint.

mount --make-rshared mountpoint
mount --make-rslave mountpoint
mount --make-rprivate mountpoint
mount --make-runbindable mountpoint

Re: 才发现mount的新用法

发表于 : 2009-04-16 20:53
photor
火星 :em09

Re: 才发现mount的新用法

发表于 : 2009-04-16 20:55
hubert_star
就比如你要修复grub时,去chroot之前,就要bind /dev这些内核映射出来的目录,就是这个道理

Re: 才发现mount的新用法

发表于 : 2009-04-16 21:08
lerosua
呵呵 :em11