Skip to content
Advertisement

lxc-clone not working with overlayfs in centos 7

I have created a container say base and I am trying to create a clone of the base container with backing store as overlayfs. But it always fails with the following error,

lxc_container: bdev.c: overlayfs_mount: 2237 No such device - overlayfs: error mounting /var/lib/lxc/base/rootfs onto /usr/lib64/lxc/rootfs options upperdir=/var/lib/lxc/s0/delta0,lowerdir=/var/lib/lxc/base/rootfs,workdir=/var/lib/lxc/s0/olwork
clone failed

Any way to resolve this issue?

Thanks,

Vishnu Ganth

Advertisement

Answer

It sounds as if they overlay filesystem is not available in your kernel. First, check if it is listed in /proc/filesystems:

# grep overlay /proc/filesystems
nodev   overlay

If it’s not there, it may be available as a loadable kernel module. You can load it using modprobe:

# modprobe overlay

If this resolves your issue, you’ll want to configure your system to automatically load this module when it boots. On a systemd-based system, you can create /etc/modules-load.d/overlay.conf with the content:

overlay

And you’re done. For non-systemd based distributions, consult the appropriate documentation.

Update

The name of the overlay filesystem changed from overlayfs to overlay at some point. Support for this was added in commit 38b3491, which was made after the release of lxc 1.0.7. It looks like this change should be available in LXC releases 1.1.1 and later.

The lxc package on CentOS comes from the EPEL repository. You should probably open a bug report against the package (here) reporting the problem; it should be reasonably easy for the package maintainer to fix this for EPEL7.

Advertisement