question

stager avatar image
stager asked

Raspberry Pi bootable SD with specific partition

Is it possible to create bootable SD for Raspberry Pi with VenusOS that there it has custom partitioning?

Or at least one partition, not be affected by the update system?

Venus OSRaspberry Pi
1 comment
2 |3000

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

johnny-brusevold avatar image johnny-brusevold commented ·

@Stager

You could try to create a partition at the end of the disk after writing image to the sd card, before you boot pi for the first time and add it to fstab after start ?


EDIT

Tested now, it does not work.

0 Likes 0 ·
4 Answers
Stefanie (Victron Energy Staff) avatar image
Stefanie (Victron Energy Staff) answered ·

Hi @Stager

Venus OS already has a /data partition which is not affected by the update system.

https://www.victronenergy.com/live/ccgx:root_access

1 comment
2 |3000

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

stager avatar image stager commented ·

Thanks. Yes, the data partition is the last chance.

But I would like to have a separate partition with special markup. But if create these partition -- the remote console inform about partition error.


0 Likes 0 ·
Kevin Windrem avatar image
Kevin Windrem answered ·

The SD card used as the system drive for the Raspberry PI supports at most 4 partitions without going to extended partitions. Venus OS uses all 4 of the partitions: rootfs 1, rootfs 2, data, boot. In order to create more partitions, one of these needs to be deleted and an extended partition added in its place. Then you can add the partition you deleted to the extended partition and add your additional partition. But I don't think Venus OS can deal with the extended partitions so it's complaining that it can't find one of the partitions it is looking for.

Boot is formatted FAT (or FAT32). Data and the two root partitions are formatted ext4. I believe the partition order is hard coded, especially the two root partitions.

Venus OS alternates between the two root partitions when updating so these don't survive a firmware update. Boot and data are not touched by a normal firmware update so these could be used to store your persistent data. Boot is currently small but I don't see any reason it couldn't be expanded.

Note that anything you change in fstab will be lost with a Venus OS update since it is located in the root partition.

1 comment
2 |3000

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

bathnm avatar image bathnm commented ·
I'd be careful about moving boot. It must be a standard partition as it is the main boot partition, and needs to be partition 1 and flagged with the master boot record.
0 Likes 0 ·
stager avatar image
stager answered ·

No way found...

I tried naively way:

copy files from "data" partition

remove "data" partition

create extended partition instead "data"

create two logical partitions

copy "data" files to one of the logical partition

edit fstab


Ok, os started, "data" partition mounted. But web console don't work. I do not know what the problem is.


And on this way edit of fstab is necessary. So update becomes impossible.


Eventually, I just formatted existed "data" partition as I want.

2 |3000

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

johnny-brusevold avatar image
johnny-brusevold answered ·

@Stager

made it work then

wrote image to sd card

edited /etc/init.d/ zzz-resize-sdcard 'parted / dev / mmcblk0 -ms resizepart 2 30% mkpart primary ext4 30% 60% mkpart primary ext4 60% 90%'

booted pi and then halt

mounted in a linux pc write down sctors and deleted last partition

made extended + one same size ext4 + ext4 rest of emty space

edited fstab to

/ dev / mmcblk0p1 / u-boot

/ dev / mmcblk0p5 / data


started up pi and everything worked.

mkdir / home / root / test

mount / dev / mmcblk0p6 / home / root / test

wrote a file two test and restarted

everything OK

2 |3000

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