X86_64 combined-squashfs.img.gz missing 230MB data partition?

I'm following the wiki and trying to install the X86_64 image (openwrt-19.07.7-x86-64-combined-squashfs.img.gz) on Proxmox VE. While I have succeeded to boot openwrt the 'free disk space' shown in 600KB only.

The wiki states:

combined-squashfs.img.gz This disk image uses the traditional OpenWrt layout, a squashfs read-only root filesystem and a read-write partition where settings and packages you install are stored. Due to how this image is assembled, you will have only 230-ish MB of space to store additional packages and configuration, and Extroot does not work.

However upon first boot - there is no free space left other than 600KB. After installing 'block mount' and running "block info" command

/dev/sda1 is /boot (16MB size)
/dev/sda2 is /rom (16MB size)

How can I get free space? I was looking for at least 200MB free for packages (1GB ideally). Only /tmp has this size but thats in-memory space that will get reset after a reboot. Help?

gparted will resize a file system/partition.

gparted will resize a file system/partition.

On https://openwrt.org/docs/guide-user/installation/openwrt_x86

The wiki says this would only be necessary for the other image that I did not use ( combined-ext4.img.gz).

For the image I used it seems to say I shoudl expect a 256MB partition at /dev/sda2 to be mounted and working from the start but that is not the case with the latest image? am I missing something?

1 Like

The Squashfs image generates the rw partition on first boot, not during the image build like the ext4 image (that is already 256MB).

This means that the *.img file of the squashfs type does NOT contain the data partition and has no space for it, so if you just load it like that in a VM then it will not have space for the data partition.

The steps to use a squashfs image in a VM should be:
-import the OpenWrt img file as virtual drive
-use the VM management tools (Proxmox web interface can do this, VMWare can do this, Xen can do this) to increase the size of the virtual drive so that it grows from 10MB or whatever its original size is to 512MB or 1GB and the virtual disk actually has enough space to fit the 250 MB data partition
-boot the OpenWrt VM

Can you please confirm if this solves your issue? So I can update the wiki with this info.

3 Likes

I confirm that resizing the image before the first boot solves the issue:
https://openwrt.org/docs/guide-user/virtualization/qemu#preparation

1 Like

I have tested and validated on Proxmox.

Created VM, deleted default disk, imported the squashfs via

# # qm importdisk 135 openwrt-19.07.7-x86-64-combined-squashfs.img local-zfs

then used proxmox VM settings page to 'attach' disk to VM, there's a "resize" menu make it "1" and it adds 1GB to faux img.

I guess what I was missing is that at first boot if there's "free space" available the image will auto resize to maximum space. Thanks

2 Likes

thanks for confirming.

I'll see if I can get this done automatically on image generation time so that eventually in the future the *.img file you download is big enough to use it for a VM without need to enlarge it manually like that.

2 Likes

One more issue, the hard factory reset fails if you resize the image after the first boot.
I added a workaround with dd that actually works for F2FS.

1 Like

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