SCIENTIFIC-LINUX-USERS Archives

April 2014

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Date:
Fri, 4 Apr 2014 09:14:29 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (31 lines)
On Fri, Apr 4, 2014 at 7:10 AM, David Sommerseth
<[log in to unmask]> wrote:
>
> Bind mounts are "special". It basically mounts an already mounted
> directory yet another place. Say you have this scheme:
>
> /dev/sda4 -> /mnt/mydata
> /dev/sdb2 -> /mnt/friendsdata
>
> If you add a 'friends' directory in /mnt/mydata ... giving you
> /mnt/mydata/friends, and the do bind mount:
>
> mount -o bind /mnt/friendsdata /mnt/mydata/friends
>
> This results in that you have access to the same data in both
> /mnt/friendsdata and /mnt/mydata/friends ... But all data is read and
> written from/to /dev/sdb2. It's just that you have "loaned" an already
> mounted directory into your /mnt/mydata directory.
>
> These bind mounts are kind of a "I want what you have"-mount.
>
> Bind mounts are particularly handy when you work with chroots and wants
> to grant access to certain files outside the chroot, where symlink is
> impossible. With bind mounts, you can also the same with files; not
> just directories.

For the sake of completeness - and also in anticipation of SL7's
symlinking of "/etc/mtab" to "/proc/self/mounts":

http://karelzak.blogspot.ch/2011/04/bind-mounts-mtab-and-read-only.html

ATOM RSS1 RSS2