
Adventures in booting Linux on Raspberry Pi 4 - todsacerdoti
https://blog.mostlypointless.dev/posts/net-boot-rpi/
======
sdenton4
I did a lot with RPi's back in the 2-3 era... My SDCards were constantly
getting nuked by slightly noisy power sources when running timelapse
photography over the course of days. My workaround was to use the SDCard for
boot only, but running everything else off a USB drive. The sdcard then only
ran for a couple minutes at startup, in read-only mode, and never had a chance
to screw up a write.

This worked great, and allowed me to successfully run a four-month timelapse,
where I didn't have access to the device. (You can see it here:
[https://www.youtube.com/watch?v=cyh0QJT0rAQ](https://www.youtube.com/watch?v=cyh0QJT0rAQ)
)

~~~
teruakohatu
I have also corrupted many a micro SD card on a Pi. Does anyone know why SDs
cards are subject to this but not USB drives?

The solution used to be but industrial SD cards but they are so expensive (for
me at least I n NZ)

~~~
milesvp
Having worked on firmware writing to SD cards, I can tell you that the big
problem comes from allocating space for writes. That’s when the card
disappears on you, as it looks for space it will potentially shuffle data
around behind the scenes. Current spec I believe says max latency is 200ms.
This is the operation that will abuse this part of the spec. If you want to
see an SD card flail, just try to write one byte at a time. This will cause
headaches no matter how wear leveling is implemented in the SD card. And will
likely significantly shorten the lifespan of the card. If you can make sure
you only ever write multiples of 4096 (probably card dependent) you’ll be much
happier using SD cards. But even then, you might have a 200ms window where you
can lose or corrupt data if your power to the card fluctuates significantly.

------
jordybg
... and it is not beta anymore. There is now official boot from USB for pi4 in
“stable”. Works flawless for me so far, with Twister OS ;)

Instructions: [https://peyanski.com/official-raspberry-pi-4-usb-
boot/](https://peyanski.com/official-raspberry-pi-4-usb-boot/)

Stay safe!

~~~
wronglebowski
My main issue with USB boot is the abysmal driver support. I have three USB3
to sata adapters with three different chipsets and none work properly. You
don’t get warnings or failures, you’re just left with a black screen. As often
the problem with cutting edge Linux it doesn’t “just work” and this ends up
driving people away.

~~~
geerlingguy
Note that earlier in the beta there was a fairly annoying bug that affected
all three of the SATA adapters I had. That bug was fixed just a week or so
ago, and now all my adapters work out of the box. They're all cheap ones you
can find on Amazon or at Micro Center. Here's the issue, in case you're
interested: [https://github.com/raspberrypi/rpi-
eeprom/issues/151#issueco...](https://github.com/raspberrypi/rpi-
eeprom/issues/151#issuecomment-642168129)

------
onetom
I got into learning Linux by building a remote booting network. I was already
doing that using Novell Netware and boot EPROMs or floppy disks, booting DOS
over IPX. I kept building remote booting networks, then I discovered
[https://ltsp.org/](https://ltsp.org/) which made it a lot easier. I could
easily switch declaratively between configs, like rootfs on local disk or nfs.
I kinda miss those times...

~~~
p0d
ltsp was my first serious learning too after the joy of Windows 3.11, windows
for workgroups.

I was running a PII in my roofspace and a diskless terminal in my living room
using ltsp. I think sometimes you go through a season of fascination and
learning. Luckily I ended up working in this arena as I was maybe less helpful
around the house than I should have been.

I have a fond memory of pulling the cat5 cable through the roofspace floor. My
son was little and couldn't climb into the roofspace so he was the cable
puller. As he pulled the cat5 cable below through the hole in the ceiling he
shouted up, "Daddy, is this magic?".

~~~
s0ss
Adorable

------
rcarmo
You can now boot directly from USB with relatively recent firmware. This means
my only remaining gripe with Raspberry Pi hardware is not including an NVME
slot.

Underneath the board, for instance, would be perfect, and although the glue
logic might make it a bit more expensive, the 8GB model is already near €100
anyway, so... We’re already into Z83ii/mini-PC territory here.

~~~
projektfu
Does it have the underlying bus to make nvme useful?

~~~
floatboth
Only if you sacrifice USB3

~~~
wila
and more details on that are here:

[https://blog.zakkemble.net/rpi4-pci-express-bridge-
chip/](https://blog.zakkemble.net/rpi4-pci-express-bridge-chip/)

------
wila
Apparently there's also PXE boot and HTTP booting [0], but you'll need to use
the firmware from the RPi4 UEFI project.

Hoping to play with this soon as I just received my RPi4 yesterday.

[0] [https://rpi4-uefi.dev/status/](https://rpi4-uefi.dev/status/)

------
bullen
My experience is that normal SanDisc SD cards are the best. Other brands are
unusable because of latency of write/read time! You need to power them when
you buy them though, otherwise they actually break sometimes, and I don't mean
data loss; I mean break!

This means you should try to buy them as fresh as possible and since sellers
don't show production dates that means you have to wait for new models to come
out and buy them then.

To me the most important metric is not speed of bandwidth but speed of time
and stability! Does anyone have measures of how the SSD compares to SD card in
terms of write/read latency?

I have only had problems with USB <-> SATA, the stability of USB3 drivers is a
joke!

~~~
geerlingguy
I've been doing comprehensive tests for five years now, and found that SanDisk
and Samsung cards are orders of magnitude better than all other brands. Here's
my 2019 update: [https://www.jeffgeerling.com/blog/2019/raspberry-pi-
microsd-...](https://www.jeffgeerling.com/blog/2019/raspberry-pi-microsd-card-
performance-comparison-2019)

I've had three Pis running more or less continuously off a microSD for a few
years, and none of those cards (same as original) have gotten corrupted. These
aren't running zillions of writers per day or anything, but most people's
problems stem more from bad power supplies or cheap cards than the Pi's use of
microSD itself.

~~~
bullen
You should probably run iostat in your tests too, to have high bandwidth is
completely useless if it has high latency. Just like a high framrate game is
unplayable if the frames are instead delayed so the motion to photon delay is
many frames.

Companies are now cheating in every way they can to extend and pretend, and
now as the peak density on the flash media reveals that they break with time
it's going to get messy!

------
fotad
USB dual boot for Raspberry Pi 4 - [https://www.spket.com/blog/raspberry-
pi-4-usb-dual-boot/](https://www.spket.com/blog/raspberry-pi-4-usb-dual-boot/)

I can't post the link coz the account is too new

