Is squashfs+x86_64 image broken?

from another thread here Upgarde OVA file to latest image - #6 by bobafetthotmail
someone told me that "The squashfs+x86_64 image has been broken for quite some time. "
and cite the wiki article about x86 targets as a source
https://openwrt.org/docs/guide-user/installation/openwrt_x86#download_disk_images
I see this statement

combined-squashfs.img.gz - Broken in OpenWrt 19.07 since the data partition is too small to save anything and too problematic to expand.

I've been using this Alix board for years on snapshot with squashfs images and I didn't notice any breakage like that. And by that I mean that I have used the "snapshot" that became 17.xx then 18.xx and then 19.xx stable.

I see this warning was added by @vgaetera

That said, on the same spare PC I used to test the upgrade in the other thread above I've flashed the 19.07.7 squashfs image now.

connecting over ssh I get this

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.7, r11306-c4a6851c72
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.0M      3.0M         0 100% /rom
tmpfs                   950.0M    252.0K    949.8M   0% /tmp
/dev/loop0              251.1M     15.3M    165.9M   8% /overlay
overlayfs:/overlay      251.1M     15.3M    165.9M   8% /
/dev/sda1                15.7M      3.8M     11.6M  25% /boot
/dev/sda1                15.7M      3.8M     11.6M  25% /boot
tmpfs                   512.0K         0    512.0K   0% /dev

which is what I expected, overlay (the r/w partition is there and is 250MB.

Settings are saved and I can install packages if I want.

I mean OK, it's not using the whole drive but thats quite a lot of space for OpenWrt.

Doing some searching in the forum I get that people having problems with partition being too small are using OpenWrt in a VM X86_64 combined-squashfs.img.gz missing 230MB data partition? and [Solved] Squashfs installation in x86_64 VM?
and that's a different issue. The Squashfs image generates the rw partition on first boot, not during the image build.

This means that the *.img file does NOT contain the rw partition and has no space for it, this does not matter for a physical system where you are flashing it on a drive that will have its own size, so in 99.99% of the cases there will be free space.

If you just load it like that in a VM, the virtual drive will be just as big as the /boot partition and the read-only squashfs partition and it will not have space for the rw partition.

The solution is
-import the OpenWrt image
-use the VM management tools to increase the size of the virtual drive so that it grows from 10MB or whatever to 512MB or 1GB and the virtual disk actually has enough space to fit the rw partition
-boot the OpenWrt VM

This was also mentioned in the older thread [Solved] Squashfs installation in x86_64 VM? - #5 by slh

I've also answered in the other more recent thread about this and I hope the guy confirms that this was the actual problem.

1 Like

The statement is wrong. The image simply isn't padded. You either need to write it to a larger blockdev or enlarge it if you want to use it as VM disk.

For qemu I usually do this:

gunzip openwrt-19.07.7-x86-64-combined-squashfs.img.gz
truncate -s 300M openwrt-19.07.7-x86-64-combined-squashfs.img
qemu-system-x86_64 -hda openwrt-19.07.7-x86-64-combined-squashfs.img ...
2 Likes

Updated the page:
https://openwrt.org/docs/guide-user/installation/openwrt_x86#download_disk_images

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.