[FS#960] x86: squashfs: overlay too small (108KB)

LEDE Bugs lede-bugs at lists.infradead.org
Mon Aug 14 05:50:47 PDT 2017

The following task has a new comment added:

FS#960 - x86: squashfs: overlay too small (108KB)
User who did this - Charlemagne Lasse (charlemagnelasse)


root@(none):/# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.3M      2.3M         0 100% /rom
tmpfs                    58.5M     40.0K     58.5M   0% /tmp
/dev/loop0              101.0K      8.0K     86.0K   9% /overlay
overlayfs:/overlay      101.0K      8.0K     86.0K   9% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@(none):/# grep /sys/block/loop0/loop/*
root@(none):/# grep '' /sys/block/loop0/loop/*
root@(none):/# grep '' /sys/block/loop0//*
/sys/block/loop0//inflight:       0        0
/sys/block/loop0//stat:      24        0      271        0      148        0      160        0        0        0        0
root@(none):/# grep ''  /sys/block/sda/sda2/*
/sys/block/sda/sda2/inflight:       0        0
/sys/block/sda/sda2/stat:      51     1873     4063        0       10       70      160        0        0        0        0


Tried to mount it on an Debian system using:

sudo kpartx -av lede-17.01.2-x86-generic-combined-squashfs.img         
add map loop1p1 (254:3): 0 32768 linear 7:1 512
device-mapper: resume ioctl on loop1p2 failed: Invalid argument
create/reload failed on loop1p2

It looks like the image is smaller than the allocated blocks in the partition table. I therefore had to:

sudo truncate -s 4G lede-17.01.2-x86-generic-combined-squashfs.img
sudo kpartx -av lede-17.01.2-x86-generic-combined-squashfs.img
sudo losetup --offset=2359296 /dev/loop7 /dev/mapper/loop1p2
sudo mount /dev/loop7 /mnt

This gave me an error:

mount: wrong fs type, bad option, bad superblock on /dev/loop7,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

I know now that the image will be initialized during booting. I have tested now whether it works after my "truncate" call. And yes, it works now. The problem which must be fixed is the too small file which is smaller than the images in the partition table.


More information can be found at the following URL:

More information about the lede-bugs mailing list