How to convert my Storage temp space into Overlay space?

Whenever you do an attendedsysupgrade the storage space gets changed.

Here's what my storage looks like now (It's 4GB sd card ext4 version of OpenWrt running on Raspberry Pi4)

What's the method to make the Temp space into the overlay?

/tmp (or temp) is RAM, not fixed storage.

resizing the default 100MB root fs is trickier, esp if you use squashfs.

I'm pretty sure it's referring to space on the sd card the Pi boots from. The Memory block on the overview shows the Memory of the Raspberry Pi just fine.

I am using ext4, not squashfs for this system.

If you say so.

Pull the card, and run gparted on it.

Or make the rootFS ro, resize the partition, then resize2fs the file system. Remount as rw afterwards.

The partition is there and expanded to the full size of the empty space. It's just not being used as the /overlay.

What partition ?

Fire up fdisk instead.

I took the chip out, used Disk Management on Windows to create a partition on the unallocated space, and formatted it to fat32. Reinserted the chip and rebooted.

I have installed these packages: fdisk kmod-fs-ext4 resize2fs block-mount

Next I configure rootfs_data:

mkdir /rwm
DEVICE="$(sed -n -e "/\s\/overlay\s.*$/s///p" /etc/mtab)"
uci -q delete fstab.rwm
uci set fstab.rwm="mount"
uci set fstab.rwm.device="${DEVICE}"
uci set fstab.rwm.target="/rwm"
uci commit fstab

Format the new partition:

DEVICE="/dev/mmcblk0p3"
mkfs.ext4 ${DEVICE}

Made the new partition the new overlay:

eval $(block info ${DEVICE} | grep -o -e "UUID=\S*")
uci -q delete fstab.overlay
uci set fstab.overlay="mount"
uci set fstab.overlay.uuid="${UUID}"
uci set fstab.overlay.target="/overlay"
uci commit fstab

Transferred the data over:

mount ${DEVICE} /mnt
cp -f -a /overlay/. /mnt
umount /mnt

Then I did a reboot.

The Storage on the Overview didn't change - maybe a bug there. However, I now have 99% free space on the Luci software screen, so the larger partition is the overlay.

FWIW and future reference. Thank you for the help.

found the temp folder too, anywhere on the mem card ?

Maybe. I might not have done this perfectly but the large overlay works now. Not sure where the tmpfs things come from or whether they can be safely removed. I've learned from experience not to try to fix things too much because I invariably mess up a working system.

Does not work as easily as advertised.

The attendedsysupgrade process created, but didn't delete some of that. Every time you update firmware, it changes the storage allocations on the mem card and the overlay gets shrunk to the default size. This post is for reference because I'll need this again next time I upgrade firmware.

I may just start from scratch and create the firmware from the selector and restore a backup - but at the moment, the firmware selector throws an error when I try to rebuild it with custom packages. I have to figure out the bare minimum I need to make the configuration work with the firmware selector and install any extra packages later.

I think that is one of the issues with EXT4: you cannot just add packages; you need to know what you want when you bake.

The promise was that you could expand the file system and, maybe, extend the card life by spreading out read/writes.

All I know for sure: I have tried gparted to expand the file system, it acts like it does it, tosses an error that cannot be fixed but shows the partition expanded, put it in a Pi and nothing grew.

I felt like Dt. Strange vs. Dormammu:
Over and over again but the card lacked the sense to give up.

OR use the "offline" image builder to create an image the size of your SD card.

I tried Fdisk (disk management, as it is now called), the card did not give a $#)6. Unallocated? tuff.

Is "offline" a program I don't know about?

Sounds like squashfs, tbh.

Hold on, I'm gonna mail my sd card to you and you video what it replies when you say that to its face. :rofl:

root@OpenWrt:~# ubus call system board

  "kernel": "5.15.137",
        "hostname": "OpenWrt",
        "system": "ARMv8 Processor rev 3",
        "model": "Raspberry Pi 4 Model B Rev 1.4",
        "board_name": "raspberrypi,4-model-b",
        "rootfs_type": "ext4",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.2",
                "revision": "r23630-842932a63d",
                "target": "bcm27xx/bcm2711",

I used ext4 because in my attempts to create different uses with different chips for the Raspberry Pi I'd screw it up so I couldn't ssh into it, but I could edit the network wireless and firewall files in /etc/config on another computer and get it working. Plus, I bought 10 fast 4GB mem cards cheap and that's the most the default firmware images need. I don't need to waste any large capacity memory cards on this sort of application.

My last project I finished was a working wireguard VPN enabled wireless router using no dongles, just the stock RP4 hardware. Plug in the built in ethernet port to Internet, it goes through Wireguard VPN then out to wifi. The wireguard setup much different than OpenVPN especially setting up devices and firewall with a much more complicated user setup - but I finally got it. Neglecting one checkbox cost me hours.

1 Like

Plug in a monitor, keyboard and you are in.
No SSH no user, maybe password? I don't remember having to log in, just hit enter when it stops scrolling.

I don't want to disassemble my rat's nest of wires on my working computer or disconnect the Pi from all its wires at its tactical location.

Also, you have to edit some files to get it to display on a 1920x1080 monitor. Some bug with the Pi hardware itself.

1 Like