Subject: Re: [vserver] mounting partitions
From: Herbert Poetzl <herbert@13thfloor.at>
Date: Tue, 23 Dec 2008 18:00:21 +0100

On Sat, Dec 20, 2008 at 09:46:30AM +0100, Shams Fantar wrote:
> Gilles Sadowski wrote:
>> Hi.

>>> I've one guest server (gserver1), and the root server.

>>> On the root server, there is a partition /backup (/dev/hda2) 
>>> of 59 Gb. I would like to mount /backup in the guest server 
>>> gserver1, so, I do :

>>> vnamespace --enter gserver1 -- mount -t ext3 /dev/hda2
>>> /etc/vservers/gserver1/vdir/backup

>> That looks strange...

>> If you want to access that partition within the vserver, 
>> you should probably add a line like this

>>  /dev/hda2  /backup   ext3    defaults   0     0

>> to the "/etc/vserver/gserver1/fstab" config file (on the host).
>> When you start the vserver, the mount will be taken care 
>> of automatically.

>> Best,
>> Gilles

> This doesn't seem to be a good solution because, apprently, 
> I can't mount the hda2 partition, gserver1 doesn't see it. 

it is the correct solution, note that you add it
to the guest configs fstab, not to the guests fstab
so, util-vserver will do the mount on the host but
in the guest namespace

even better would be to use a bind mount entry in
the config, because it seems to be already mounted
on the host anyway

> So, the best solution would be to put the line of fstab in 
> the root server, but, anyway, we still come back to the problem...

you can do that, but you need to tell util-vserver
that you do not want this path/filesystem cleaned
up when creating a new namespace

best,
Herbert

> Thanks,