question

mfoo avatar image
mfoo asked

Venus GX Partition Layout - small /data

Hello,

Have been hacking around with a Venus GX running v2.90 Large. Using SignalK with node-red embedded rather than the image-provided node-red to facilitate some custom N2K/SignalK functionality. Problem I'm having is the /data partition filling up. At 120MB it is undersized compared to expected parameters.

My understanding is that the partitions should have been resized by installing an image later than v2.73. However I note in my own previous thread from 2021 I forced a firmware installation - Venus GX had v2.72 installed. I crammed the beta v2.70_5-large-18 into it by running swupdate manually.


@mvader answered on that issue that the installer for v2.73 would automagically update the partioning on a Venus GX if required. I assumed that this hook would also be part of the installer for any version after v2.73. Was this mistaken? Is v2.73 the magic sauce? Or perhaps my ham-fisting of the initial large image flipped some bit that breaks the check for repartitioning?

I can advise that in this case v2.90 was installed over v2.70~large via the standard GUI/online update, no manual swupdate shenanigans.

I did try resetting to defaults by applying venus-data.tgz with no apparent change in partitioning. Do not believe this is related to the usual resize2fs for the root partition.

Here's the mounted filesystems after fresh install (/dev/mmcblk0 is a 32GB mSD card):

root@beaglebone:~# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root              1212848    832676    301236  73% /
devtmpfs                245884         4    245880   0% /dev
tmpfs                   254588       900    253688   0% /run
tmpfs                   254588       796    253792   0% /var/volatile
/dev/mmcblk1p5          122835      2053    111608   2% /data
/dev/mmcblk0p1        30736384      4416  30731968   0% /run/media/mmcblk0p1
tmpfs                   254588       900    253688   0% /service
/dev/sda1              1932960    696416   1236544  36% /run/media/sda1

After installing node-red under signalk and the venus plugins, /data is just about full:

root@beaglebone:~# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root              1212848    832684    301228  73% /
devtmpfs                245884         4    245880   0% /dev
tmpfs                   254588       900    253688   0% /run
tmpfs                   254588       356    254232   0% /var/volatile
/dev/mmcblk1p5          122835     99248     14413  87% /data
/dev/mmcblk0p1        30736384      4416  30731968   0% /run/media/mmcblk0p1
tmpfs                   254588       900    253688   0% /service

Here's what I would expect to find as partition sizes (larger /data) on a beaglebone/Venus GX per https://github.com/victronenergy/venus/wiki/machines

root@beaglebone:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root              1261181    316027    883950  26% /
devtmpfs                247184         4    247180   0% /dev
tmpfs                   255888       212    255676   0% /run
tmpfs                   255888       452    255436   0% /var/volatile
/dev/mmcblk1p5          499656     76652    386308  17% /data
/dev/mmcblk1p6         4374280      8824   4123536   0% /scratch

Hope someone has some guidance! Thanks.

modificationsSignalKstorage
2 |3000

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

2 Answers
mfoo avatar image
mfoo answered ·

In the absence of expert guidance, digging into the install process it seems that the MMC should be repartitioned with sfdisk every time a firmware is installed.

Will try to go run an installer again...


https://github.com/victronenergy/meta-victronenergy/blob/master/meta-venus/recipes-images/venus-install-initramfs/install.sh

do_install() {
    do_mounts
    do_modules $MODULES
    do_mtdparts
    watchdog &
    waitdev $SWUDEV
    findimg $SWUDEV
    do_testmode
    do_format
    setup_data $DATADEV $DATAFS
    install_swu
    install_firmware
    setup_board_id
}

do_format() {...}

format_mmc() {
    mmc=$1

    root_blocks=$((ROOT_SIZE * 1024 * 2))

    msg "Creating partitions..."
    sfdisk -W always /dev/$mmc <<EOF
label: dos
label-id: 0x564e5553
2048, 16384, c, *
, $root_blocks, L
, $root_blocks, L
,, E
,, L
EOF

    msg "Formatting data partition..."
    mkfs.ext4 -F /dev/${mmc}p5

    DATADEV=/dev/${mmc}p5
    DATAFS=ext4
}
2 |3000

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

mfoo avatar image
mfoo answered ·

Finally got back to this system today. Installed full fdisk via opt and had a look at the partition table:

# fdisk -l
Disk /dev/mmcblk1: 3.66 GiB, 3909091328 bytes, 7634944 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x564e5553

Device         Boot   Start     End Sectors  Size Id Type
/dev/mmcblk1p1 *       2048   18431   16384    8M  c W95 FAT32 (LBA)
/dev/mmcblk1p2        18432 2639871 2621440  1.3G 83 Linux
/dev/mmcblk1p3      2639872 5261311 2621440  1.3G 83 Linux
/dev/mmcblk1p4      5261312 7634943 2373632  1.1G  5 Extended
/dev/mmcblk1p5      5263360 7634943 2371584  1.1G 83 Linux

So clearly a new partition format was laid out with /dev/mmcblk1p5 being partitioned as 1.1G but the filesystem hadn't been resized. resize2fs to the rescue!

# resize2fs /dev/mmcblk1p5
resize2fs 1.45.7 (28-Jan-2021)
Filesystem at /dev/mmcblk1p5 is mounted on /data; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 5
The filesystem on /dev/mmcblk1p5 is now 1185792 (1k) blocks long.

And there we go, /data is now a useful size, 1GB instead of 100MB.

root@beaglebone:/# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root              1212808    837784    296084  74% /
devtmpfs                245884         4    245880   0% /dev
tmpfs                   254588       904    253684   0% /run
tmpfs                   254588       380    254208   0% /var/volatile
/dev/mmcblk1p5         1144219    108853    984011  10% /data
/dev/mmcblk0p1        30736384      4416  30731968   0% /run/media/mmcblk0p1
tmpfs                   254588       904    253684   0% /service
overlay                 254588       380    254208   0% /var/lib
2 |3000

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

Related Resources

Experiments, Modifications and Adaptions. Mods (Modifications) can be made to Victron Software by the Community. Please use the modifications space for enthusiasts who want to push what is possible, without official Victron Support.

Additional resources still need to be added for this topic