lkml.org 
[lkml]   [2007]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: RFC: permit link(2) to work across --bind mounts ?
    On Sat, 29 Dec 2007, Jan Engelhardt wrote:

    >
    > On Dec 28 2007 18:53, dean gaudet wrote:
    > >p.s. in retrospect i probably could have arranged it more like this:
    > >
    > > mount /dev/md1 $tmpmntpoint
    > > mount --bind $tmpmntpoint/var /var
    > > mount --bind $tmpmntpoint/home /home
    > > umount $tmpmntpoint
    > >
    > >except i can't easily specify that in fstab... and neither of the bind
    > >mounts would show up in df(1). seems like it wouldn't be hard to support
    > >this type of subtree mount though. mount(8) could support a single
    > >subtree mount using this technique but the second subtree mount attempt
    > >would fail because you can't temporarily remount the device because the
    > >mount point is gone.
    >
    > Why is it gone?
    >
    > mount /dev/md1 /tmpmnt
    > mount --bind /tmpmnt/var /var
    > mount --bind /tmpmnt/home /home
    >
    > Is perfectly fine, and /tmpmnt is still alive and mounted. Additionally,
    > you can
    >
    > umount /tmpmnt
    >
    > now, which leaves only /var and /home.

    i was trying to come up with a userland-only change in mount(8) which
    would behave like so:

    # mount --subtree var /dev/md1 /var
    internally mount does:
    - mount /dev/md1 /tmpmnt
    - mount --bind /tmpmnt/var /var
    - umount /tmpmnt

    # mount --subtree home /dev/md1 /home
    internally mount does:
    - mount /dev/md1 /tmpmnt
    - mount --bind /tmpmnt/home /home
    - umount /tmpmnt

    but that second mount would fail because /dev/md1 is already mounted
    (but the mount point is gone)...

    it certainly works if i issue the commands individually as i described
    -- but a change within mount(8) would have the benefit of working with
    /etc/fstab too.

    -dean


    \
     
     \ /
      Last update: 2007-12-29 07:05    [W:2.702 / U:0.172 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site