[Lxc-users] Container shutdown remounts the lxc partition read-only... again

Serge Hallyn serge.hallyn at ubuntu.com
Fri Jun 21 14:27:44 UTC 2013


Quoting Leonid Isaev (lisaev at umail.iu.edu):
> Hi,
> 
> 	I have recently installed vanilla lxc-0.9.0 under archlinux and
> encountered the old "fs is remounted ro" issue which is supposed to be fixed
> since https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/942325 ... The (also
> archlinux) containers' rootfs are located on a separate partition mounted at
> /var/lib/lxc
> ----------
> $ mount | grep lxc
> /dev/sda3 on /var/lib/lxc type ext4(rw,nosuid,nodev,relatime,data=ordered)
> ----------
> The rootfs.hold file is open, according to strace run against lxc-start, e.g.:
> ----------
> $ grep hold /var/log/lxc.strace.log
> open("/var/lib/lxc/arch-LXC-test/rootfs.hold", O_RDWR|O_CREAT, 0600) = 13
> ----------
> 
> Nevertheless, whenever I shutdown the container via lxc-stop, the /var/lib/lxc
> partition is marked ro... What can I do to determine what's going wrong?

what fs type are you using for /var/lib/lxc?

I'd try: create a loopback fs with that fstype, mount it under /mnt2,
then run:

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>

cat > holdopen.c << EOF
int main(int argc, char *argv[]) {
	FILE *f = fopen(argv[1], "w");
	fprintf(f, "1022\n");
	fflush(f);
	lockf(fileno(f), F_TLOCK, 0);
	sleep(999);
}
EOF

make holdopen
./holdopen /mnt2/xxx
mount -o remount,ro /mnt2/xxx

and see if it succeeds.




More information about the lxc-users mailing list