BananaPi R3 eMMC overlay resizing

I was curios about the command in the wiki

It suggests:

parted /dev/mmcblk0 -- mkpart f2fs 768MiB -34s resizepart 5 768MiB resizepart 4 67.1M resizepart 3 12.6M 
  # say F to fix gpt global size
reboot

mount /dev/mmcblk0p66 /mnt && umount /dev/mmcblk0p66 && resize.f2fs /dev/mmcblk0p66
  # if resize.f2fs fails, a sysupgrade may fix

Can somebody explain the parted command?
First it makes a new partition of 768MiB? why?
What is -34s?
Why does it resize part 4 and part 3? Because overlay is on part 5 ?

I guess partly my question is why not resize part 5 only, then run the resize.f2fs on overlay to enlarge it?

Thanks,

Okay: I've managed to to this.
Outline:

Installed 23.05-rc3 from sdcard to NOR/NAND and EMMC
Boot production NAND partition, install parted and f2fs-tools

resize /dev/mmcblk0p5 with parted to the size you like
reboot production NAND system, mount and unmount
/dev/mmcblk0p66 as outlined above, then resize.f2fs /dev/mmcblk0p66

I didn't bother with eliminating the free spaces (sectors) between some partitions, as they are minimal.

@panachoi that is exactly what I did myself. Except I built myself an image with the needed tools. I do not like to bother with installing stuff later :smiley:

But the wiki has so much more cumbersome process. I am not sure why they have that. I was wondering if anybody knows if there is a practical reason. I was just curious.

I also came to this thread hoping for a proper answer to @yurtesen's question, but I guess whoever wrote that wiki section doesn't pay much attention to the forums.

In searching for more answers, I also ended up at this comment over at the BananaPi forums:

https://forum.banana-pi.org/t/bpi-r3-change-or-add-partion-to-overlay/14240/12

Which is a completely different take on the whole subject as recommended by @daniel.

There are too many threads on the same matter, not just on this subject, but all subjects.
Making it is VERY difficult to find answers.
I have successfully performed this, but not from the instructions in this thread.
I will have to find my post, as I replied, that the procedure I followed worked.

I resized my BPI-R3 eMMC via the following method:

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.

I went ahead and pieced together the exact meaning of the parted command from the wiki article, for any other novices like me who are baffled.

https://www.gnu.org/software/parted/manual/parted.html

"--" signifies the end of command options. Prevents the "-34s" from being interpreted as an option (that doesn't exist).

"mkpart f2fs 768 MiB -34s" is all one command, making a new partition beginning 768 MiB from the start of the disk and stopping 34 sectors from the end of the disk. So this fills the entire eMMC capacity, less 768 MiB (approx. 6.57 GiB). Does not actually create the filesystem, only specifies its expected type (f2fs) for the partition table.

"resizepart 5 768MiB" moves the end of partition 5 to 768 MiB (i.e. where the previously created partition starts). This is the "production" partition (i.e. where your stuff goes). The actual size will be 704 MiB because the partition starts at 64 MiB (67.1MB).

"resizepart 4 67.1M" moves the end of partition 4 to 67.1 MB (i.e. 64 MiB, where partition 5 starts). This is the "recovery" partition, and this resize pads it out to fill the ~20 MiB of empty space left between partitions 4 & 5 in the default flash layout. I don't really see any reason to bother with this.

"resizepart 3 12.6M" moves the end of partition 3 to 12.6MB (i.e. where partition 4 starts). This is the "fips" partition, and this resize pads it out to fill the ~1.5 MiB of free space left between partitions 3 & 4 in the default flash layout. Again, I don't see any reason to bother with this.

My understanding is that the new 7 GiB partition becomes the overlay (mmcblk0p66) after the resize.f2fs operation.

But to repeat, a primary developer strongly discourages that approach:

https://forum.banana-pi.org/t/bpi-r3-change-or-add-partion-to-overlay/14240/12

And messing around with partitions 3 & 4 just feels like chasing OCD to me ("Nooo! I can't have any free space!"). What's the benefit?

I'm going to stick with increasing partition 5 (production) a sensible amount, and then use the uvol/autopart solution to get additional space that can be used for anything.

Thanks for your help.
However: I don't have cfdisk and can't seem to install it:
opkg install cfdisk
gives an error:
Failed to download the package list from https://downloads.openwrt.org/releases/23.05.3/targets/mediatek/filogic/packages/Packages.gz

And I can't update my packages, maybe due to too less free space (approx 25MB).
Do I really have to de-install AdGuardHome first in order to extend my eMMC partition?
(and why is the full eMMC capacity not being used in the first place?)

Sorry, I have no idea, I am just a simple user here.

I do notice that on my GL.iNet GL-MT6000, the FULL space IS available, and is utilized.
So, I think this is a bad configuration desicion issue that can possibly be changed from the start?
I don't know, nor understand either...

1 Like