OpenWrt Forum Archive

Topic: is squashfs in OpenWRT "different" or not standard?

The content of this topic has been archived on 22 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have a router with a USB stick attached, with some data on it.

I wanted to save some space, and as I won't edit some of the files, I created a squashfs image (in a file).

However, mounting this squashfs image fails:

# mount -t squashfs -o loop unattended.sqfs unattended
mount: Mounting /home/samba/unattended.sqfs on /home/samba/unattended failed: Invalid argument


dmesg gives me this output:

SQUASHFS error: lzma returned unexpected result 0x1
SQUASHFS error: Unable to read cache block [53c:18]
SQUASHFS error: Unable to read inode [53c:18]
SQUASHFS error: Root inode create failed


I tried creating the image on a x86 machine, and on a router itself; mounting fails in both cases.

I noticed that the image is mounted properly only if I disable the compression completly:

mksquashfs samba/ smb.sqfs -noI -noD -noF

However, id rather have compression enabled.

Any ideas?

It seems that OpenWRT's squashfs is patched with lzma and it won't mount normal squashfs images.

To make a squashfs image that will work under OpenWRT one needs a patched mksquashfs - one can be found here: http://wl500g.dyndns.org/lzma/mksquashfs-lzma

even with patched_kernel_squashfs-lzma ,mounting loopback could get into trouble if
the squashfs_image was created with "nopad,noappend" as showned in target/linux/image/squashfs.mk.
So the universal way is to :
dd if=image.squashfs of=/dev/mtdblock0
mount -tsquashfs /dev/mtdblock0 /mnt

The discussion might have continued from here.