0n Tue, Feb 02, 2010 at 12:34:46PM +0900, sf...@users.sourceforge.net 
wrote: 

    >"Wilkinson, Alex":
    >>     >> (generic)
    >>     >> $ mkdir /tmp/empty
    >>     >> # mount -o bind /tmp/empty /mnt/aufs/you/want/to/hide
    >> 
    >> This works great! However, it doesnt look like i can add this to 
fstab(5).
    >> How would one normally get this automagically mounted ? rc.local ?
    >> Is it possible to use AutoFS to automagically do a --bind mount ?
    >
    >If you put the aufs entry in your fstab, try writing
    >
    >/empty /mnt/aufs/you/want/to/hide none bind 0 0
    >
    >after the aufs line.
    >Of course, you need to create /empty dir before you reboot.
    >
    >But if your mount(8) behaves asynchronously, it may not work.

Well it works! But i have a strange permissions issue even though it appears
permissions are correct. Here is my recipie:

1. mount fs over nfs (fstab)

   host-a:/export/foo/data  /mnt/host-a nfs rw,soft,intr     0 0
   host-b:/export           /mnt/host-b nfs rw,soft,intr     0 0

2. rebind individual directories within the aforementioned NFS mounts (fstab)

   /mnt/host-a/ss/matlab /mnt/data/matlab none rw,bind 0 0
   /mnt/host-b/mod/data  /mnt/data/rdl    none rw,bind 0 0

3. Join aforementioned individual directories into a single logical directory

   [/etc/rc.local]
   /bin/mount --rbind /mnt/host-a/ss/matlab     /mnt/data/matlab
   /bin/mount --rbind /mnt/host-b/mod/data/rdl  /mnt/data/rdl

4. IT WORKS! But ... i get permission errors:

   #ls -l
   drwxrwx--- 22 root ss 8192 Jan 29 15:25 matlab/
   drwxrws---  9 root ss 8192 Jan 29 15:58 rdl/

   #cd matlab/
   matlab/: Permission denied.

   #id -a | tr ',' \\n | grep ss
   18010(ss)
   #

Do i have to pass mount(8) an option to interpret perms correctly on a bind
mount ? FWIW root can happily traverse the bind mounts.

   -Alex

IMPORTANT: This email remains the property of the Australian Defence 
Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 
1914.  If you have received this email in error, you are requested to contact 
the sender and delete the email.


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com

Reply via email to