Re: [Vserver] Can't bind-mount host->guest

From: Herbert Poetzl <herbert_at_13thfloor.at>
Date: Sun 30 Oct 2005 - 13:35:40 GMT
Message-ID: <20051030133540.GA18178@MAIL.13thfloor.at>

On Sun, Oct 30, 2005 at 10:27:40AM +0100, Bruno wrote:
> On Sunday 30 October 2005 00:11, Herbert Poetzl wrote:
> > On Sun, Oct 30, 2005 at 02:53:17AM +0900, Jun OKAJIMA wrote:
> > > Hello.
> > >
> > > I also have same question.
> > > How to do a mount to vserver namespace?
> > > I suppose that current vserver gets per-ctx namespace and this requires
> > > special mount command. If so, what is the command?.
> > >
> > > For example, assume the vserver I am using is 100,
> > >
> > > [Host]# mount -o bind /home/okajima /vserver/100/home/okajima
> > > [Host]# ls -la /vserver/100/home/okajima
> > > [ something come. This is okay.]
> > > [Vserver]# ls -la /home/okajima
> > > [ nothing comes This is NOT okay.]
> > > [Vserver]# mount -o bind /bin /mnt
> > > [Vserver]$ ls -la /mnt
> > > [ Nothing comes.]
> > > [Vserver]$ cat /proc/mounts
> > > [ /bin->/mnt stuff is not printed.]
> > > [Host]# zcat /boot/initrd.gz > /vserver/100/diskimage
> > > [Vserver]# mount -o loop diskimage /mnt
> > > [Vserver]$ ls -la /mnt
> > > [ Nothing comes.]
> > >
> > >
> > > Tell me the command to do a bind mount!.
> >
> > vnamespace --enter <xid> -- mount --bind /host/path /vservers/guest/path
> >
> > HTH,
> > Herbert
> >
> For my test-case this command does NOT work:
>
> I try to bind-mount something that was mounted on host AFTER guest was
> started, an thus is not visible at all in guest namespace.
>
> Steps to reproduce:
>
> Start host
> Start guest
> On host:
> mount /mnt/cdrom
> vnamespace --enter guest -- mount --bind /mnt/cdrom /vservers/guest/mnt/cdrom

in this case you want to do:

  vnamespace --enter guest -- mount /mnt/cdrom
  vnamespace --enter guest -- mount --bind /mnt/cdrom /vservers/guest/mnt/cdrom

or much simpler:

  vnamespace --enter guest -- mount /dev/cdrom /vservers/guest/mnt/cdrom

> From guest /mnt/cdrom is still as empty as it was before, on host /mnt/cdrom
> shows the CDROM contents...

> From what it looks like I assume that the mount only operates in a single
> namespace, not binding from host namespace to guest namespace.

yep, that's true for now ...

HTH,
Herbert

> Bruno
>
> _______________________________________________
> Vserver mailing list
> Vserver@list.linux-vserver.org
> http://list.linux-vserver.org/mailman/listinfo/vserver
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Sun Oct 30 13:36:01 2005

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Sun 30 Oct 2005 - 13:36:06 GMT by hypermail 2.1.8