Need larger root directory

I am setting up a new RPI4 and have flashed and loaded the latest SD card to a 64GB card. After using it I find that my / directory is at 93% although other directories are ok. I have tried moving to a 128GB card but it only moves the original image as 64GB and the nearly full / directory. Is there a way to resize the root before flashing the card since raspi-config won’t work because there are three partitions? I am not skilled in Linux and need help. I tried the resizing instructions in your archive but couldn’t get it to work. Thanks in advance. Cheers.

Bob

PS I have another earlier RPI4 running fine with a 2021 image

pi@emonpi:~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.6G     0  1.6G   0% /dev
tmpfs           760M  9.5M  750M   2% /run
/dev/mmcblk0p2  6.4G  5.6G  478M  93% /
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           5.0M   16K  5.0M   1% /run/lock
tmpfs           1.0M     0  1.0M   0% /var/lib/php/sessions
tmpfs           128M     0  128M   0% /var/tmp
tmpfs            30M  428K   30M   2% /tmp
/dev/mmcblk0p1  510M   67M  444M  13% /boot/firmware
/dev/mmcblk0p3   52G  3.3G   46G   7% /var/opt/emoncms
log2ram          50M   22M   29M  43% /var/log
tmpfs           1.0M     0  1.0M   0% /run/credentials/systemd-journald.service
tmpfs           1.0M     0  1.0M   0% /run/credentials/[email protected]
tmpfs           380M   12K  380M   1% /run/user/1000

mmcblk0     179:0    0  59.5G  0 disk
├─mmcblk0p1 179:1    0   512M  0 part /boot/firmware
├─mmcblk0p2 179:2    0   6.5G  0 part /var/log.bak
│                                     /
└─mmcblk0p3 179:3    0  52.4G  0 part /var/opt/emoncms
zram0       254:0    0     2G  0 disk [SWAP]

Do you have GParted either on the RPi or on your other machine, and if the other machine, does it have a card reader? That’s what I use to resize partitions. You’ll need to move everything above it upwards first to make space, GParted will only do one thing at a time (it won’t move and then resize with one instruction).

You must do this after flashing the SD Card - because Balena Etcher writes the image as downloaded, and that includes all the partitions.

Thanks for the reply, Robert, you have saved me several times before.

Yes, I have gparted on another machine. I will get back to you tomorrow as it’s supper time and I’m sure way past your bedtime by now. Many thanks! Cheers, Bob

Robert,

I decided to take the plunge with gparted and a 64GB SD and actually think I did it. At least it boots and is showing the expanded partitions. Next is to move my old working system backup into the new one. Thanks again for coming to the rescue.

Cheers,

Bob