Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Booting on a USB drive #421

Open
max-l opened this issue Feb 13, 2023 · 5 comments
Open

Booting on a USB drive #421

max-l opened this issue Feb 13, 2023 · 5 comments

Comments

@max-l
Copy link

max-l commented Feb 13, 2023

I have tried to get HifiberrOS to boot from a USB ssd, using a variation of this recipe:

https://www.tomshardware.com/how-to/boot-raspberry-pi-4-usb#:~:text=Launch%20Raspberry%20Pi%20Imager%20and,to%20open%20the%20next%20menu.&text=4.,us%20to%20the%20main%20menu.

  1. installed and configured a HifiberyOS instance on an SD card
  2. copied the SD card partitions to the USB drive, using "sudo sudo dd bs=4M if=/dev/sda of=/dev/sdb"
  3. changed the boot sequence to "usb, then ssd", using an image created with raspery pi imager that does just that
  4. tried booting from the USB drive

It didn't work, i.e. the hifibery device web interface doesn't come online, it seems the os does not manage to boot.

Has anyone succeeded in doing this ?

@max-l
Copy link
Author

max-l commented Feb 13, 2023

I dug a bit into it, and imagine /etc/fstab needs a bit of tweaking, given that the file system mounting arguments (partition, fs types, etc) will need to change:

cat /media/maxou/hifiberryos/etc/fstab

/dev/root / ext4 rw,noatime 0 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts defaults,gid=5,mode=620,ptmxmode=0666 0 0
tmpfs /dev/shm tmpfs mode=0777 0 0
tmpfs /tmp tmpfs mode=1777 0 0
tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0
sysfs /sys sysfs defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults,noatime,quiet 0 2
/dev/mmcblk0p4 /data auto defaults,nofail 0 2

I'm trying to configure syslog to increase the log level, because logs remain empty after failed boot attempts : /var/log/**
I realise logging must be reduced to absolute minimum, given that the os is meant to run on an SD card. I'd like to increase the logging level

@hifiberry
Copy link
Owner

It's a lot more complex than this. Not just fstab, but many parts of the system needs to be adapted for this as the whole disk partitioning/update mechanism is based on the file system on SD card. Even if you get this working, the first update will break everything.

@max-l
Copy link
Author

max-l commented Feb 13, 2023

Thanks, I was beggining to realize it would be harder than I thought.

It seems a better approach might be to create my own build config, on a forked repo, so I can merge upstream releases.

https://github.com/hifiberry/hifiberry-os/blob/master/doc/building.md

How hard would it be to maintain such a fork ?

Are we talking of a few config changes, or a major overhaul ?

@hifiberry
Copy link
Owner

You would need to completely remove the updater for this.

Try to get it working first. Once the system can directly boot from USB, we can help with the new functionality of the updater.

@djvj1
Copy link

djvj1 commented Jun 5, 2024

I run all my Pis from SSD as I don't see the point in the SD cards and very high chance of corruption on sudden power loss (has happened to me countless times). Has any work ever been done on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants