question

Warwick Bruce Chapman avatar image
Warwick Bruce Chapman asked

Raspberry Pi Expand Storage to fit SD

I might be daft, but I could have sworn there was documentation somewhere on how to get Venus OS on the Pi to use all available space on the SD for logging. By default it seems to come with a few hundred MB free on a 32GB SD card.

Am I dreaming or is there a command to expand the FS to fit the SD?

Raspberry Pi
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

4 Answers
Kevin Windrem avatar image
Kevin Windrem answered ·

The 2.60 build for the RPI 4 expands the two rootfs and the data partitions to 1/3 the size of the SD card automatically. That should be sufficient for the off-line VRM database for months.

If you want to tweak more, the easiest tool is 'gparted' on Ubuntu. You can graphically repartition and move each partition. Hint: the SD card will often mount some/all of the SD card's partition which prevents you from making changes. Select each partition and choose Unmount from the menu. Then you can make changes.

I'm running Ubuntu under Parallels on my Mac and it works great.

There are apparently versions of gparted that will run natively on the Mac but I've also read about some ext fs drivers for the Mac being flakey and the gparted I tried was tied into one of these. Best stay native to avoid damaging the SD file system.

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Warwick Bruce Chapman avatar image Warwick Bruce Chapman commented ·

I have done this with gparted on the data partition and then created a new image with:

dd if=/dev/sddevicename of=venus-pi-sd-expanded.img

Subsequent writes to SD eg with Balena Etcher work fine.

Also convenient to do all your default config on the image first before doing the dd above.

0 Likes 0 ·
Show more comments
Warwick Bruce Chapman avatar image
Warwick Bruce Chapman answered ·
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Warwick Bruce Chapman avatar image
Warwick Bruce Chapman answered ·

Found it on https://www.victronenergy.com/live/ccgx:root_access.


It says to run

/opt/victronenergy/swupdate/resize2fs.sh

I noticed that has changed (and updated the Wiki):

/opt/victronenergy/swupdate-scripts/resize2fs.sh


But, the result was:

root@raspberrypi2:~# /opt/victronenergy/swupdate-scripts/resize2fs.sh
resizing /dev/mmcblk0p2
resize2fs 1.43.5 (04-Aug-2017)
The filesystem is already 512000 (1k) blocks long.  Nothing to do!


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Alexander Hein avatar image
Alexander Hein answered ·

I have inserted a microSD card with a capacity of 128 GB.


with the command:

  1. /opt/victronenergy/swupdate-scripts/resize2fs.sh

I could expand the memory, but "only" to 36.9 GB.

1650974191457.png

I would be grateful for a tip on how the remaining memory can also be added.


1650974191457.png (21.7 KiB)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.