I am trying to use read-only overlayfs(no workdir and upperdir) inside custom initrd.

This works fine in completely booted OS:

mkdir /tmp/ovl1 /tmp/ovl2 /tmp/merged
mount -t overlay none -o lowerdir=/tmp/ovl1:/tmp/ovl2 /tmp/merged

This also works if I use busybox sh as shell, which has built-in mount command.

Inside initrd shell directories are successfully created, and mount command gives this error:

mount: mounting none on /tmp/merged failed: No such device

Here is output of mount command inside initrd:

rootfs on / type rootfs (...
sysfs on /sys type sysfs (...
proc on /proc type proc (...
udev on /dev type devtmpfs (...
devpts on /dev/pts type devpts (...
tmpfs on /run type tmpfs (...

I got no idea how to debug this one :(

P.S. Now I use AUFS and it works fine, but it was rejected from mainline kernel and it's recommended to switch to overlayfs.


I was sure, that module is statically compiled in kernel, but I was wrong: CONFIG_OVERLAY_FS=m. After adding the overlay module to initrd everything works fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.