Re: [Vserver] Remount Filesystem + Add Interface from the outside

From: Herbert Poetzl <herbert_at_13thfloor.at>
Date: Mon 07 Aug 2006 - 19:20:09 BST
Message-ID: <20060807182008.GA24592@MAIL.13thfloor.at>

On Mon, Aug 07, 2006 at 01:27:31PM +0200, Oliver Heinz wrote:
> Am Montag, 7. August 2006 12:25 schrieb Oliver Welter:
> > Hi Oliver,
> >
> > try "vnamespace -e <xid> mount...."
> >
>
> this gives me
>
> mount: can't find /srv/vservers/service/tmp in /etc/fstab or /etc/mtab

well, mount tries to get the options from /etc/mtab
and the devices from /etc/fstab, so, you have two
or three options here:

 1) --bind mount some filesystem with exec permission
    over the guest /tmp for the time you need it executable

 2) chroot into the guest and do the remount there

 3) copy over the fstab/mtab to the host, modify it
    accordingly and rerun the remount

of course all that is supposed to happen _inside_ the
guest namespace ...

> > xid is the context id that you can obtain by vserver-stat
> >
> > Take care that the adressing of mountpoints is a bit tricky because it
> > is inside the namespace but not in the chroot - so you have e.g.
> > /vserver/foo/tmp
>
>
> I tried secure-mount, because you can specify fstab and mtab there.
> An it does work ... well not really ;-)
>
> root@gobi:/srv/vservers/service# vnamespace -e
> service /usr/local/lib/util-vserver/secure-mount --chroot -o
> remount,exec --mtab=/etc/mtab --fstab=/etc/fstab -t tmpfs none /tmp
> root@gobi:/srv/vservers/service# vserver service enter
> service:/# mount
> ...
> none on /tmp type tmpfs (remount,exec)
>
> you see the "remount" in the options, that's not what I intended...
>
> now I remount with noexec again:
>
> root@gobi:/srv/vservers/service# vnamespace -e
> service /usr/local/lib/util-vserver/secure-mount --chroot -o
> remount,noexec --mtab=/etc/mtab --fstab=/etc/fstab -t tmpfs none /tmp
> root@gobi:/srv/vservers/service# vserver service enter
> service:/# mount
> ...
> none on /tmp type tmpfs (remount,exec)
> none on /tmp type tmpfs (remount,noexec)
>
> somethings going wrong here :-(

secure-mount is an internal tool of util-vserver which
does the mounts for the guests, probably you can use
it to your purpose too, but I'm not sure it was designed
to handle remounts at all (I'd say it wasn't :)

HTH,
Herbert

> Thanks so far, any ideas?
>
>
> Oliver
> _______________________________________________
> 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 Mon Aug 7 19:22:32 2006

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Mon 07 Aug 2006 - 19:22:38 BST by hypermail 2.1.8