[Lxc-users] bind (re)mount possible?

Serge Hallyn serge.hallyn at ubuntu.com
Thu Oct 24 20:11:32 UTC 2013


Quoting Ulli Horlacher (framstag at rus.uni-stuttgart.de):
> I have a container running with:
> 
> root at vms2:/lxc# egrep 'fstab|lxc.cap.drop' fex.cfg 
> lxc.mount = /lxc/fex.fstab
> lxc.cap.drop = mac_override
> lxc.cap.drop = sys_module
> lxc.cap.drop = sys_boot
> lxc.cap.drop = sys_admin
> lxc.cap.drop = sys_time
> 
> root at vms2:/lxc# grep /sw fex.fstab
> /nfs/rusnas/sw          /lxc/fex/nfs/sw         none bind,ro 0 0
> 
> The problem is: "ro" for /lxc/fex/nfs/sw is wrong, it should be "rw".
> Can I change it without restarting the whole container?
> On a normal partition I would execute:
> mount -o remount,rw /lxc/fex/nfs/sw
> 
> Is this possible with bind mounts for containers, too?
> 
> Because of lxc.cap.drop = sys_admin I cannot execute (re)mount commands
> inside the container. 

If your kernel is new enough (check whether /proc/self/ns/mnt exists)
you could lxc-attach into the container with the -e flag to keep
elevated privileges, and do the remount.




More information about the lxc-users mailing list