Help expanding filesystem into SD Card

Hi OpenWrt Forum,

I have been trying, unsuccessfully, to expand the filesystem of an OpenWRT image to Espressobin to take the whole SD Card.

Let me make clear. It does boot before I try to expand.

I'm using Gparted LIVE USB to expand the second partition in order to take the whole filesystem left that are unused.

After that, I can't boot it anymore. The boot stalls here:

[ 0.979209] DSA: switch 0 0 parsed
[ 0.982286] DSA: tree 0 parsed
[ 0.986143] ata1: SATA link down (SStatus 0 SControl 300)
[ 1.686872] Marvell 88E6390 !soc!internal-regs@d0000000!mdio@32004!switch0@1! mdio:11: attached PHY driver [Marvell 88E6390] (mii_bus:phy_addr=!soc!internal-r egs@d0000000!mdio@32004!switch0@1!mdio:11, irq=POLL)
[ 1.806883] Marvell 88E6390 !soc!internal-regs@d0000000!mdio@32004!switch0@1! mdio:12: attached PHY driver [Marvell 88E6390] (mii_bus:phy_addr=!soc!internal-r egs@d0000000!mdio@32004!switch0@1!mdio:12, irq=POLL)
[ 1.926882] Marvell 88E6390 !soc!internal-regs@d0000000!mdio@32004!switch0@1! mdio:13: attached PHY driver [Marvell 88E6390] (mii_bus:phy_addr=!soc!internal-r egs@d0000000!mdio@32004!switch0@1!mdio:13, irq=POLL)
[ 1.947008] xenon-sdhci d00d0000.sdhci: Got CD GPIO
[ 2.015058] genirq: Setting trigger mode 3 for irq 34 failed (armada_37xx_irq _set_type+0x0/0xe0)
[ 2.024176] mmc0: SDHCI controller on d00d0000.sdhci [d00d0000.sdhci] using A DMA
[ 2.032179] hctosys: unable to open rtc device (rtc0)
[ 2.039059] Waiting for root device PARTUUID=15374738-02…
[ 2.137548] mmc0: new ultra high speed SDR104 SDHC card at address aaaa
[ 2.144744] mmcblk0: mmc0:aaaa SC16G 14.8 GiB
[ 2.153837] mmcblk0: p1 p2

Can anyone here tell me what I am doing wrong?

Please, let me know.

Can you use another device and simply use a program like GParted?

I'm using openwrt-19.07.7-x86-64-combined-squashfs.img.gz on an APU4 with a 4GB sdcard

I've been trying to follow the instructions here, to resize the squashfs image and use the rest of my sdcard.

I've successfully found the offset using losetup:

/dev/loop0         0 3014656         0  0 /mmcblk0p2   0     512

And successfully resized the squashfs partion with cfdisk

loop0         7:0    0 253.1M  0 loop /overlay
mmcblk0     179:0    0   3.7G  0 disk 
 ├─mmcblk0p1 179:1    0    16M  0 part /boot
 └─mmcblk0p2 179:2    0   3.7G  0 part /rom

However, attempts to loop mount the underlying f2fs partition are not working:

root@OpenWrt:/# losetup -d -o 3014656 /dev/loop0 /dev/mmcblk0p2
losetup: -o: failed to use device: No such device

I also tried using gparted to resize and it doesn't seem to recognize the squashfs file system type.

Any suggestions?

I'm wondering if you found a solution to this issue.

Please, let us know.

Try expanding ext4.

1 Like