question

Igor Sarychkin avatar image
Igor Sarychkin asked

Can Venus OS Raspberry Pi image boot from USB or SSD?

Tried booting Venus OS 2.7_4 Large on Rpi 3B and 4 from USB/SSD without success. (Raspberry OS from both USB and SSD boots OK).

USB/SSD would make more sense now that SignalK and Node-Red are included in the Large version.

Cheers

Igor

P.S. Instructions imply USB stick should be bootable but still no go:

"For now not that easy yet: installing and updating is done using the offline install method: with usb stick or sd-card."

Venus OSRaspberry 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.

10 Answers
mvader (Victron Energy) avatar image
mvader (Victron Energy) answered ·

Hi, that quoted text is about installing an update onto a syatem that already has venus os installed.


Wrt running from ssd or usb: I have no idea how that can be done, if at all possible. A bit out of what I’ve experience with I’m afraid.

Whats wrong with using a large SD card?

4 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.

Igor Sarychkin avatar image Igor Sarychkin commented ·

Cheers, Mvader, for clarifying that line from the instructions.

Re SD card on VenusOS Large: read/write activity of some of the SignalK plugins can be quite intensive (e.g. buffering, logging) potentially leading to SD data corruption or worse. SSDs can handle this better and faster. I'm on a boat with power outages, internet cutting out, salt water everywhere etc, etc. :) So it's all about risk reduction and energy saving.

Best regards,

Igor

1 Like 1 ·
mvader (Victron Energy) avatar image mvader (Victron Energy) ♦♦ Igor Sarychkin commented ·

Hi Igor, thanks for coming back on this.

With regards to the logs, it can be made such that those logs are written to memory only, and not disk; which is probably better anyway and maybe already how we do it today (I dont know by heart).


With regards to booting from USB / SSD: I won't be looking at that anytime soon. But you (or anyone else) can. In which case I recommend to start reading and searching here: https://github.com/agherzan/meta-raspberrypi/. We use open embedded as a build system for Venus OS; and that repo there is where most of OE knowledge wrt raspberrypis resides.

The other place is here: https://github.com/victronenergy/meta-victronenergy/. If you scroll (many) pages back in the commitlogs, or simply search for rpi and raspberrypi you'll find all the code that takes care of installing, auto-expanding as well as booting and so forth.

0 Likes 0 ·
Igor Sarychkin avatar image Igor Sarychkin mvader (Victron Energy) ♦♦ commented ·

Thanks, Mvader. That's way over my head - for the moment I will stick to a few cloned SD cards.

Best regards,

Igor

0 Likes 0 ·
Peter Buijs - NL avatar image Peter Buijs - NL mvader (Victron Energy) ♦♦ commented ·

Maybe it is an idea to log to memory as a default. And make a configurable option to log to disk in case of extensive trouble shooting.

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

Starting with v2.70~4, we can now use the .swu mechanism, plugging in a USB flash drive with the new Venus version. This process only updates the active rootfs partition, retaining /data. Much easier than other options.

In the past, UPDATING Venus for RPI 4 required a reflash of the SD card which wipes the /data partition also. But with a Ubuntu (or other *nix) it's possible to copy the data partition from and old SD card to the new one. I use gparted after running the new card first to initialize and expand all the partitions. This mechanism still has value if you need to flash a new Venus SD card and retain a system's configuration.

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.

Igor Sarychkin avatar image Igor Sarychkin commented ·

Thanks, Kevin. I see now. I misread "installing" as installing from scratch from USB stick.

Best regards,

Igor

0 Likes 0 ·
juergenw avatar image
juergenw answered ·

@mvader (Victron Energy) Any new information when booting of Venus OS from USB/SSD will work on Raspberry Pi 4? SSDs are more durable than SD cards so i prefer booting from SSD. Thank you

2 |3000

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

johanndo avatar image
johanndo answered ·

Main problem is the raspberryPy boot loader in the firmware (comparable to the BIOS / EFI on a PC) of the chip, that doesnt look in external usb devices for bootable media and expects the boot loader on the SD card in the card slot. You can then mount other file systems on external drives / symlink them and run the OS from there, no problem, but you still need a SD card to boot.

There were patches to the firmware to overcome this and boot from USB, the rpi3 was able to boot straight off the USB, rpi4 was a step backwards in this regard. There are tutorials on the internet how to use a SSD for the OS once you booted from the SD, it is not too difficult. You always can use a SSD or a USB drive to store write intensive data / logs and make the OS read only.

You can use a RAM disk as well, 8GB of RAM are plenty, even 4GB are more than the 1GB the cerbo has or the 512MB of the OCTO / Venus.

Another consideration is power consumption, the Pi cannot power external drives by USB, it barely has enough power to run properly, so you need a external power supply or powered USB HUB, this all drains power from your battery, the pi becomes an essential part of your battery when you use a networked BMS via CAN or serial port and DVCC, making your pi a critical component for the safety of your system - and one that needs to run 24x7, you want less power consumption then to not drain your battery when your system is longer unattended in storage.


*) UPDATE there is an update for the boot loader where you can now boot from USB or even LAN with a configuration menu on the pi to choose the boot order. You need a raspbean OS to update the boot loader, then you can boot of a SSD, when preparing the SSD for venus, edit fstab to point the links to the SSD partitions, then you should be good to boot your Venus OS from the SSD.

2 |3000

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

johanndo avatar image
johanndo answered ·

You may look in /etc/fstab and relocate the system to partitions on a ssd if you want to.


/dev/root / auto defaults 1 0

proc /proc proc defaults 0 0

devpts /dev/pts devpts mode=0620,gid=5 0 0

tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0

tmpfs /var/volatile tmpfs defaults 0 0

/dev/mmcblk0p1 /u-boot vfat defaults 0 0

/dev/mmcblk0p4 /data ext4 noatime 0 2

/dev/mmcblk0p1 /u-boot vfat defaults 0 0

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 answered ·

Due to the way VenusOS works and maintains two versions of the OS for redundancy and backup purposes there is no easy way to boot from SSD. VenusOS is designed as an embedded OS based around either emmc for the Victron based hardware solutions and SD-Card for PI.

While it might be possible to get it working, I suspect any update of VenusOS would then break and the backup image capability would not work.

For an embedded OS with predominantly read requirements from the SD-Card the MBTF of the card is likely high enough for many years of running.

What is the write needs that drive the need for SSD? If there is a major need for high writes that drives an SSD need then mount the SSD and link key folders onto the SSD.

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.

Kevin Windrem avatar image Kevin Windrem commented ·

Starting about v2.80 the /root partition is mounted read only so there are no writes to this part of the SD card. However, /data is mounted read/write and writes do occur for settings changes and for logs. There may be other things written to /data as well.

In addition, we remount /root to be read/write to install modifications. This is never undone so /root remains mounted as read/write, BUT since Venus is designed not to write to /root there should not be any writes to it in normal operation.

I have been working with Venus OS on a Raspberry PI for about 3 years and have yet to see an SD card corrupted by simply removing power. If there is any corruption, the file system checks performed at boot repair them. I have seen removing a USB flash drive corrupted if the drive isn't removed cleanly with the menu command in the VRM menu. The corruption is flagged when inserting the flash drive in a computer and disk repair may be needed to fix it. But again, the drive can be repaired.

I have a package that offers a clean shutdown menu option and also a GPIO shutdown pin:

https://github.com/kwindrem/ShutdownMonitor

https://github.com/kwindrem/RpiGpioSetup

Theses will help with manual shutdowns but won't address a power failure.

Note that Venus OS typically runs in an environment that is powered at all times from battery so a power failure is unlikely.

All that said, when I was running a Venus OS system on a Raspberry PI, I kept a spare SD card with an image of the working one with me just in case.

1 Like 1 ·
gexle avatar image
gexle answered ·

Hi

Then Venus OS booting from SDD is not yet possible, is it? Thank you

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.

bathnm avatar image bathnm commented ·
@Gexle no it is not possible. Lots of work to do that and little value. Once booted you can use an SSD for storage of VRM logs and other data.
0 Likes 0 ·
elko avatar image elko bathnm commented ·

I find it a great pity that it is still not possible to boot from USB/SSD.

I would really appreciate it if this were possible at some point.

0 Likes 0 ·
wattsup33 avatar image
wattsup33 answered ·

It is a pity that Venus OS can not boot to an SSD. I have gotten PiHole and Home Assistant to run from SSD without any issues. I played around with cmdline.txt to see if I could just correctly refer to the second partition, but nothing worked. I initially had hoped that I could plug the Victron USB directly into Home Assistant, and have the data available within HASIO. It appears this is not possible, so I grabbed my spare Pi3B+ and SSD and imaged the SSD, but could not make it boot. I cannot boot to SD on that Pi3B+ as the MicroSD card slot is broken. I have had this Pi 3B+ booting to SSD many times with multiple images, but SD card is not an option. I would rather not have to buy a new Raspberry Pi for this, particularly with the ridiculous prices over the last two years.

Having Home Assistant read the data directly from the USB cable would be my preferred option, so I may just research that option a little further.

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 answered ·

The issues to just get the RPI4 booting was a night mare. It is all about software compatibility of various components, firmware, u-boot, etc. It is a niche group of people that want SSD booting. If you want to make its work then the area to look at is u-boot and how it interacts with the inbuilt RPI firmware. Oh and a serial console is going to be needed to debug and get this working.

2 |3000

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

jzdiy avatar image
jzdiy answered ·

Booting from SSD will be more and more important, because we all know SD card used for the current Vinus OS booting process has limited life after too many read/write. The last thing you would want to see happening is when you SD card crash & die and your PV/Storage system stop operating and blackout while you are not on-prem. Booting from SSD gives the reliability the victron community needed for the system reliability.

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

Additional resources still need to be added for this topic

Raspberry Pi running Victron’s Venus firmware - Blog Post

Venus OS Large image: Signal K and Node-RED - Install

raspberrypi install venus image


Additional resources still need to be added for this topic