Losetup not working

Try with the correct argument cfdisk /dev/mmcblk1

That gives me the following

                               Disk: /dev/mmcblk1
              Size: 29.72 GiB, 31914983424 bytes, 62333952 sectors
          Label: gpt, identifier: 5452574F-2211-4433-5566-778899AABB00

    Device                Start        End    Sectors    Size Type
    /dev/mmcblk1p1         1024       2047       1024    512K Linux filesystem
    Free space             2048       4095       2048      1M
    /dev/mmcblk1p2         4096       8191       4096      2M EFI System
    /dev/mmcblk1p3         8192      10239       2048      1M Linux filesystem
    Free space            10240      12287       2048      1M
    /dev/mmcblk1p4        12288      77823      65536     32M Linux filesystem
    /dev/mmcblk1p5        77824      92159      14336      7M Linux filesystem
>>  /dev/mmcblk1p6        92160     305151     212992    104M unknown           
    /dev/mmcblk1p7       305152     509951     204800    100M Linux filesystem
    /dev/mmcblk1p128         34       1023        990    495K BIOS boot
    Free space           509952   62333918   61823967   29.5G

Where is the offset?

The offset from the beginning of the disk? That is the start.

I need to locate the offset for the root partition (/dev/mmcblk1p6, I think)

I am wanting to expand the roots to use the remainder of the space on the sd card 29.6GB.

By the looks of it, you can only expand mmcblk1p7

Well, that is a waste of sd card space.

Try moving partition 128 to the end of the storage, using gparted, then see if you device still boots.

Try both moving partition 128 and copying and recreation mmcblk1p6 using gparted but then the device failed to boot both times.

Edit:

even using the disk utility it did not like partition 6 being resized! it too failed to boot after that.

Just tried this code and it appears that it could work although, I have no idea why the offset it not being returned?

It looks like your R64 setup does not use a loop device for the writable part of the overlay filesystem so using losetup does not apply.

Systems using losetup show a loop device in the mount command output like:
/dev/loop0 on /overlay type f2fs (rw,noatime)

Your mount command shows:
/dev/mmcblk1p66 on /overlay type f2fs (rw,lazytime,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,fsync_mode=posix)

It looks like you found help for resizing the rootfs_data on an emmc installation in this other thread:
EDIT: rootfs_data and not rootfs.

So I should try resizing the Rootfs after installing emmc?

Oops! I shared rootfs when it is really rootfs_data. Sorry!
I will edit the previous post and correct it.

I won't suggest what you should or should not do. I just pointed out what looks like a solution to have access to more space on storage.

My recommendation is to not use emmc for frequently updated data like log files, database files, other frequently written files as on-board raw nand and nor flash implementations don't have wear leveling like the integrated controllers on sd cards and usb flash drives have. Once failed, the on-board flash storage tends to be unusable.

If the instruction in the other thread are not good for your use-case:
If you want to install more packages, my recommendation is to use the "Customize installed packages" option on the firmware selector site:
https://firmware-selector.openwrt.org/?version=22.03.3&target=mediatek%2Fmt7622&id=bananapi_bpi-r64

The writable area of /overlay/ is still created with 100 Megabytes of free space and you have to download/install an upgrade image anyways with each upgrade.

I tested a custom build for the R64 and it generates all six of the production image types, all under a minute :-).
Only the "Kernel" (recovery) image is not included. I think that is because it is not customized and is always available as the standard build.

If you want more space for logs or application data, I recommend mounting a partition on inexpensive and easily replaced storage meant for frequent writes like a usb disk, usb flash drive, or even a good quality sd-card.

Share what your end goal is, that is - what your use case is for having more storage and we can provide you with the appropriate recommendation and probably detailed help.

Is it possible to use a empty partition on the sd card that has openwrt on it? If so how?

After adding the empty partition to empty space on an sd card and formatting a filesystem on it, Yes.

How it is used depends on your use case.

Was trying to implement extroot on the partition of the sd card but it is not working. Everytime I try to change the "/overlay" to the partition of the sdcard it remains as "mmcblk1p66" (the default /overlay on R64).

Sorry. I don't have any experience with extroot.
I'd start with https://openwrt.org/docs/guide-user/additional-software/extroot_configuration and keep looking for info on 'docs' or here in the forum.

It seems that you have been running into challenges expanding storage on your R64. I don't know if extroot is supported. I think I read that extroot is not supported on emmc or nand/nor flash but I don't know about sd cards. Also I saw somewhere recently that ext4 filesystem is not supported on emmc/nand/nor in OpenWrt. My R4S custom build in the firmware selector uses ext4 for the filesystem on rootfs_data (overlay) on an sd card so it is supported on some platforms. I think extroot may be a different implementation anyway. Sorry to ramble.

Did you have to do a install of software not initially installed on openwrt to increase the size via the custom image? That seems a bit backward if so.

Usig the "Customize installed packages" option on the firmware selector site is the process of installing more packages (software) on the OpenWrt device. It dynamically increases the size of the squashfs rootfs area with all the additional packages already installed and then still adds the 100MB rootfs_data read/write part of /overlay/.

Once downloaded to your PC, it gets installed like a pre-built image. You then repeat the process for each system upgrade, or sooner if you need to add more than 100MB of new packages not added in the custom image.

It does not get you the ability to have the rest of your sd card available for "data" but that is available with adding a standard formatted partition and mounting it. Note that for each sysupgrade, the current (pre-upgrade) added data partition needs to be backed up and then recreated after the sysupgrade and restored from backup.

I use 2 sd cards, flashing the new custom image via my PC to the spare card so I can just pop in the previous card with the working setup if the new one doesn't work right.
If I used the sd card for data storage I would then,
after first boot, re-add the data partition, restore data
mount mount the data partition
and restore my configuration.
With this process scripted, It is back up and running in a few minutes.

I don't use the sd card for data so my sd cards should last years without flash cell wear failure. I write all the collectd rrd data files and some other stuff to a usb flash drive so if it fails, at least my router keeps running fine performing its primary functions.

I only extended my rootfs-data area for /overlay/ as a fun project to help others with a similar platform and storage layout. I won't repeat it on sys upgrades on my system. I have the process understood and documented so it is available if I need it.

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