OpenWrt on x86 with Docker disk strategy

Hello
I am looking to run OpenWrt on an x86 device with 128GB disk. I have created a 512MB image with all the application packages I need for my set up.

I am looking to run docker containers with their mount points ideally in a different partition.

What I would like to do is to be able to store the container mountpoints on the disk but also to be able to upgrade to a new custom image when a new version is released.

What would be the best way to do this?

Install the ext4 EFI image
Expand the partition to take up the full disk
Create the mount points under /opt/container-data/ (on the 128GB disk)

or

Install ext4 EFI image
Split the disk into 2 partitions
Expand the OS disk to take up half the disk or something like 20GB
Mount the remaining 100GB to /opt/container-data and create the container mountpoints there.

What would be the best way to do this in a way that would allow me to flash a newer version of OpenWrt in the future i.e. 25.20or even 26.00 without losing data?

Install openwrt-efi-squashfs, dont expand anything, sysuphrade is cool, then use remaining space as separate partition with filesystem or lvm pv.

OK. Many thanks for taking the time to reply :slight_smile:

What about updating packages (in between major upgrades) and having a bit of space for configuration files etc?

How do I format the remainder of the disk space?

Upgrading individual packages will kill the system sooner or later.
disk:
https://openwrt.org/docs/guide-user/storage/usb-drives

It's an NVMe disk. Does that make any difference?

name will be nvme-something not sda.

First of all, apologies, it's built-in mmc storage. There is a slot for NVMe but it's empty atm.

Here is the output of df -h

Filesystem                Size      Used Available Use% Mounted on
/dev/root               123.5M    123.5M         0 100% /rom
tmpfs                     7.7G      6.3M      7.7G   0% /tmp
/dev/loop0              386.5M     53.7M    332.8M  14% /overlay
overlayfs:/overlay      386.5M     53.7M    332.8M  14% /
/dev/mmcblk0p1           16.0M      6.2M      9.7M  39% /boot
/dev/mmcblk0p1           16.0M      6.2M      9.7M  39% /boot
tmpfs                   512.0K         0    512.0K   0% /dev
overlayfs:/overlay      386.5M     53.7M    332.8M  14% /opt/docker

The output of mount

/dev/mmcblk0p2 on /rom type squashfs (ro,relatime,errors=continue)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/mmcblk0p2 on /overlay type f2fs (rw,noatime,lazytime,background_gc=on,nogc_merge,discard,discard_unit=block,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,barrier,extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,checkpoint_merge,fsync_mode=posix,memory=normal,errors=continue)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work,uuid=on,xino=off)
/dev/mmcblk0p1 on /boot type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p1 on /boot type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
tmpfs on /dev type tmpfs (rw,nosuid,noexec,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,noatime)
bpffs on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
overlayfs:/overlay on /opt/docker type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work,uuid=on,xino=off)

lsblk output

NAME          MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0           7:0    0 388.5M  0 loop /overlay
mmcblk0       179:0    0 116.5G  0 disk
├─mmcblk0p1   179:1    0    16M  0 part /boot
│                                       /boot
├─mmcblk0p2   179:2    0   512M  0 part /rom
└─mmcblk0p128 259:0    0   239K  0 part
mmcblk0boot0  179:8    0     4M  1 disk
mmcblk0boot1  179:16   0     4M  1 disk

gdisk is giving me the following error

gdisk /dev/mmcblk0
GPT fdisk (gdisk) version 1.0.10

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): n
No free sectors available

If it is not obvious floppy disk device names will be fdNpM, you can interpolate to sdcard.
Print partitions in gdisk?