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:
David Sommerseth <[log in to unmask]>
Reply To:
Date:
Fri, 4 Apr 2014 13:10:23 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (52 lines)
> On 04/03/2014 08:52 PM, Patrick J. LoPresti wrote:> You can use a bind
> mount to make an ext4 directory appear in the VFAT tree.
>>
>> Do "man mount" and search for "bind", and/or search the web for "bind
> mount".
>>
>>   - Pat
> 
> Hi Pat,
> 
> Thank you!
> 
> From man page, it sounds like I am writing to the
> two different locations at the same time:
> 
>      "After this call the same contents is accessible in
>      two places"
> 
> Is this just a play on words?


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.

I hope this clarified a bit.


--
kind regards,

David Sommerseth

ATOM RSS1 RSS2