I am trying to mount a squashfs file during initramfs. I have included loop and squashfs modules.

Currently using mount /foo.squashfs /mountpoint
or mount -t squashfs -o loop /foo.squashfs /mountpoint
results with Error: block device required.

However, first setting up loop device manually with losetup /dev/loop0 /foo.squashfs then mounting with mount /dev/loop0 /mountpoint is sucessful.

I suspect I am missing a kernel module, but I am not sure.

  • 1
    Just go with the successful method. busybox can be weird sometimes. If in doubt, check lsmod before and after successful mount. Maybe strace it. – frostschutz Jan 9 '19 at 17:25
  • Currently I solved the problem by copying the 'mount' executable from the linux environment. – Kaarel Pärtel Jan 11 '19 at 6:14

The reason ended up being, that the environment, on which I was building the initramfs. did not have busybox installed. Update-initramfs defaulted to using klibc, which did not have many features, including automatic loop mounting.

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.