etc/vserver-mount

VServerはLinuxカーネルのネームスペースを拡張して実装されているようで、VServerのゲスト内にパーティションをマウントする際には特別な方法が必要です。

 Vserver FAQ より。

I want to (re)mount a partition in a running guest ... but the guest has no rights (capability) to (re)mount?
A: I'll explain. I take as example your /tmp partition within the guest is too small, what will be likely the case if you stay with the 16MB default (vserver build mounts /tmp as 16 MB tmpfs!).

# vnamespace -e XID mount -t tmpfs -o remount,size=256m,mode=1777 none /var/lib/vservers/<guest>/tmp/

(if there's a problem, try expanding the symlinks in the mount path)
Be warned that the guest will not recognize the change, as the /etc/mtab file is not updated when you mount like this. To permanently change the mount, edit /etc/vserver/<guest>/fstab on the host.

今回は CIFS をマウントしたかったので以下のようにしました。

vnamespace -e tpod mount -t cifs -o credential=/var/lib/vservers/tpod/srv/tpod/conf/credentials \
//cifs.hostname/tpod /var/lib/vservers/tpod/srv/tpod/files/

因みに何回も実行すると ホストマシン上でマウント情報がどんどん溜まっていきます(上記コマンドを5回実行すると、5行のレコードができる)。これらはアンマウントすれば消えてくれます。マウント情報が残りひとつになったら実際にアンマウントされます。

vnamespace -e tpod umount /var/lib/vservers/tpod/srv/tpod/files/

マウント情報が重複しても実害は無いようですが、念のため。