ImageBuilder; Cannot upgrade OS running on eMMC

So this time, I built an image using IB and used dd to write it to a 32GB sd card.
I then booted the SD card on this device and checked the partitions, space etc.
What confuses me is why the full device is never being used?
This still seems to be maxed out at 8GB or so.

# fdisk -l
Disk /dev/loop0: 96.44 MiB, 101122048 bytes, 197504 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk0: 29.54 GiB, 31719424000 bytes, 61952000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5452574f

Device         Boot  Start    End Sectors  Size Id Type
/dev/mmcblk0p1 *     65536  98303   32768   16M 83 Linux
/dev/mmcblk0p2      131072 344063  212992  104M 83 Linux


Disk /dev/mmcblk1: 28.91 GiB, 31037849600 bytes, 60620800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5452574f

Device         Boot  Start    End Sectors  Size Id Type
/dev/mmcblk1p1 *     65536  98303   32768   16M 83 Linux
/dev/mmcblk1p2      131072 344063  212992  104M 83 Linux


Disk /dev/mmcblk1boot0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk1boot1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 7.8M      7.8M         0 100% /rom
tmpfs                   995.6M      1.2M    994.4M   0% /tmp
/dev/loop0               84.4M    699.0K     77.0M   1% /overlay
overlayfs:/overlay       84.4M    699.0K     77.0M   1% /
tmpfs                   512.0K         0    512.0K   0% /dev

I'm at a loss here, been at this for over a week and unable to solve the problem. No matter if I use the sd card or the on board eMMC, I cannot use the full size of the storage and this means I cannot run sysupgrade to write a new fw to the device.

What could be causing this?

Did you tell image builder to increase the FS' size ?

This is something I've been looking into but cannot find concrete info on how to do it.

When I write the openwrt image to the sdcard, this is the command I'm using
sudo dd if=r5c-2024-02-15.bin of=/dev/sdb bs=4M status=progress

From what I've read, the dd command writes the OpenWrt image directly to the SD card, but it only writes as much data as is contained in the r5c-2024-02-15.bin image file. This means only a portion of the SD card is used, specifically the size of the OpenWrt image.

But, I've yet to find enough information to know how to fix this. I'm using the sd card first but eventually want to run the OS directly off of the built in eMMC but I need the full space so I can remotely use sysupgrade as needed.

As I understand it...

When I write the OpenWrt image to the SD card using the dd command, I am effectively copying a pre-configured filesystem structure and operating system onto the card. This image has a fixed size, which is usually much smaller than the capacity of the SD card, especially if using a large one like 32GB.

There are bits of information on using tools to change the partition sizes etc but I can't use those unless it's a one time thing because from remote, I would not dare messing with partitions.

Again, from the little I understand, I should be changing some partition stuff on the sd card after it's written but before putting it into the router. Confusing when you've not done something like this before.

I've never had a problem until I used this nanopi r5c. I've used other nanopi and never had the issue so I don't know what's different about this one or what steps I must have taken at some point to cause this.

I found this which worked but only up until I re-flashed the image in-place.
Meaning, first I dd'd the .img from the sd card to the eMMC.
Then I ran the automated example found here;
https://openwrt.org/docs/guide-user/advanced/expand_root

After rebooting from the eMMC now, the full space of the eMMC was being used.
So to test, I then copied a new image to /tmp and used sysupgrade which completed but after reboot, the same size returned.

This doesn't seem to keep permanently. It seems this has to be run after any sysupgrade was done.

What has worked so far is the link I shared.
I created the two files, I then created the sysupgrade.conf as shown and now everything seems to work with all of the storage space being used.

What an interesting and challenging problem this was.

Thank you for all of the help. I hope this thread helps someone else.

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