Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lxc.mount.entry should support all the bdev modules #195

Open
xaionaro opened this issue Apr 1, 2014 · 2 comments
Open

lxc.mount.entry should support all the bdev modules #195

xaionaro opened this issue Apr 1, 2014 · 2 comments
Labels
Feature New feature, not a bug
Milestone

Comments

@xaionaro
Copy link
Contributor

xaionaro commented Apr 1, 2014

Hello.

I've faced with a problem of using squashfs image a rootfs for containers. However, if I'm adding something like:

lxc.mount.entry = /srv/lxc/.storage/sdb1/roots.squashfs/containertype_rootfs.sqsh /srv/lxc/container_name/rootfs squashfs ro,loop 0 0

I'm getting an error:

# lxc-start -n container
lxc-start: Block device required - failed to mount '/srv/lxc/.storage/sdb1/roots.squashfs/containertype_rootfs.sqsh' on '/usr/lib/x86_64-linux-gnu/lxc/./'
lxc-start: failed to setup the mount entries for 'container'
lxc-start: failed to setup the container
lxc-start: invalid sequence number 1. expected 2
lxc-start: failed to spawn 'container'

The problem is that LXC doesn't use intermediate loop-devices to mount squashfs images:

mount(
        "/srv/lxc/.storage/sdb1/roots.squashfs/containertype.sqsh",
        "/usr/lib/x86_64-linux-gnu/lxc/",
        "squashfs",
        MS_RDONLY,
        "loop" 
) = -1 ENOTBLK (Block device required)

Here's the mount() call of "mount"-utility for squashfs image:

mount("/dev/loop0", "/mnt/test", "squashfs", MS_MGC_VAL, NULL) = 0
@stgraber
Copy link
Member

stgraber commented May 1, 2014

We have support for loop devices in the rootfs mounting code but apparently not for extra mount entries...

For the time being, you best bet would be to use a hook and do a manual mount in there.

@stgraber stgraber added this to the later milestone May 1, 2014
@stgraber stgraber changed the title Cannot mount squashfs from file directly lxc.mount.entry should support all the bdev modules May 1, 2014
@alphaonex86
Copy link

Same here, same feature needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature, not a bug
Development

No branches or pull requests

3 participants