[BPI-R3] resetting / reformatting eMMC

OK - I got the BPI-R3 booting fine via the SD -> NAND -> eMMC winding path.
So far so good. However I started adding packages before realizing just how limited the eMMC partition is.

I have an M.2 NVMe card on order - however, the eMMC partition is flat full. I added the gcc package and it couldn't complete due to lack of disk space.

So, I'm trying to wipe the eMMC partition so I can start again. And then move to the M.2 NVMe.

Using the DIP switches, I can boot back on the SPI-NAND. First I just used the u-boot menu to install the bootloader etc to the eMMC (like the first time). While I can boot to eMMC after that - the image is clearly borked and I still don't have any extra disk space.

So the question is, how do I fully wipe/reformat the eMMC partition so that I can re-install the image? The U-Boot console seems to be the most likely place - but not sure where to start.

Or - is there some simple way that I'm missing?

You should be able to do this the typical Linux way. If you boot into the image on NAND and have the eMMC enabled, it will show up as a normal block device (usually /dev/mmcblk0) and be accessible the same as any other disk device would in Linux. From there, you can repartition or wipe using your preferred tools. Personally, if the data present right now isn't viable, I'd simply use dd and fill the eMMC with zeros. From there, you can reboot and install as if it were fresh.

You know, that you can resize the emmc partition, to make openwrt use the full 8GB for overlay, do you?

Thank you Sailor - that would be far too easy. :slight_smile: I'll take a look at that. I assume I could do that booting from the NAND partition.

I'll look at the commands involved and report back. Thanks.

When I get the NVMe installed and up - I assume I can add that to the overlay? I've only played with the overly long ago.

Though, I have yet read any of the ways to so, noob friendly.
Or, that worked for me, and then I have to perform manual reinstall all over, reset packages, configs, the whole thing...

Do you have a preferred method, or link?

I would love to do this, as my eMMC is almost full.

I also seem to read, that the BPI-R3 cannot use ext4?
I don't know why though.

df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                11008     11008         0 100% /rom
tmpfs                  1020704     14444   1006260   1% /tmp
/dev/mmcblk0p66          88572     88084       488  99% /overlay
overlayfs:/overlay       88572     88084       488  99% /
tmpfs                      512         0       512   0% /dev
type or paste code here

sigh...

Did you ever get this working from an already working device?

It‘s been a while, since I setup my bpi r3. But first of all, we need to solve your space problem. I think the easiest way, would be the get the sqashfs factory image from openwrt.org. Then head to: system/ firmware upgrade in luci and install the image. If I remember right, luci puts the image in /tmp, which is a ram disc. After the reboot everything should be fine again. On the fresh install, install cfdisk. With it just resize /dev/mmcblk0p5 to occupy the remaining free space and reboot afterwards. After the reboot you should have 8GB space available.

Edit: the post was saying: resize /dev/mmcblk0p66 before, which is wrong. I posted the correct procedure below.

1 Like

Thanks!
I will try this.
It maybe a little bit of time, as I am currently using this device as my "production" device, and my family will kill me for interrupting their service.

cfdisk says the partition is in use, and it is a bad idea to resize.

There seems to be a lot more to it than this?

My mistake. Try like this:

cfdisk /dev/mmcblk0

it look something like:

Navigate to /dev/mmcblk0p5 and resize this partition. It should work without a warning. Afterwards reboot.

1 Like

Thanks for the update.
It looks like I have to start over, as I can't login via ssh, nor url.
Shrug, it's okay, I already swapped gateways on the pfsense box, and took the BPI-R3 off the network, so, all is good there.
I will now start over and try this again...

Getting there - after following a variation - /dev/mmcblk0p6 was originally listed as "Free space" of 7.1G. I navigated down and chose [New] - then wrote quit and rebooted.
Now I have:

So far so good.

Next, I formatted the new partition:
mkfs.ext4 /dev/mmcblk0p6

Then mounted:
mount /dev/mmcblk0p6 /overlay/

df -k shows to overlays (the previous and the new):
Capture2

Now the trick is to get the new partition to mount every boot.

I'm checking on extroot.

Thanks all. It's close.

1 Like

You don‘t need to use extroot. Just resize mmcblk0p5 as I said. Don‘t format it, just reboot afterwards and your overlay will have the full available size of approximately 7.2 GB shown in my screenshot.

Still trying to get an image with cfdisk, I have one with luci.
Seems firmware selector is not in working status.
Probably have to roll my own...

Starting over it seems that I can't resize to that extent as there is another partition next to it:

Capture3

With resize, I can add 20M (partition before) but mmcblk0p128 is in the way of adding the 7G

Wow, so the firmware selector seems to broken, for now, I set up the environment in debian to build, and cannot find the cfdisk option, argh...
Really hate having to poke around in the make menuconfig, takes waay tooo loong...

Oh look, the firmware selector is back online and, working, yey!
"Build successful"

I see, I will need to have a look at my r3 tomorrow. It’s been a while, since I set it up. But as it is my productive router, I can not try everything out myself.

Woo!

root@OpenWrt:~# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 5888      5888         0 100% /rom
tmpfs                  1020704        72   1020632   0% /tmp
/dev/mmcblk0p66        7327000    187784   7139216   3% /overlay
overlayfs:/overlay     7327000    187784   7139216   3% /
tmpfs                      512         0       512   0% /dev

Works!

Thank you!