7 ms·
I've posted about this a lot but I feel the need to evangelize it: The cleverest thing the Raspberry Pi can do that almost no-one uses is network boot. You do
by LeoPanthera 5y ago
I've posted about this a lot but I feel the need to evangelize it:
The cleverest thing the Raspberry Pi can do that almost no-one uses is network boot.
You don't need an SD card at all, you can setup your server such that you can change what OS a Pi boots into just by renaming a symlink.
I have a bunch of Pis around my house that all network boot into specific tasks and it is a joy.
- yboris 5y agoThank you for sharing! I looked around and found this cool link: https://blog.alexellis.io/state-of-netbooting-raspberry-pi-in-2021/ https://blog.alexellis.io/state-of-netbooting-raspberry-pi-i...
- throwaway894345 5y agoI would be really interested in learning how to do this. In the past I've looked into PXE booting, but the tutorials all seem pretty opaque ("just make your router send a magic DHCP packet") or too specific to one configuration.
- nsteel 5y agoDid you try this official guide? https://www.raspberrypi.com/documentation/computers/remote-access.html#network-boot-your-raspberry-pi https://www.raspberrypi.com/documentation/computers/remote-a...
- htrp 5y agoDo you have a preferred tutorial on this? This is item 1 on google (https://linuxhit.com/raspberry-pi-pxe-boot-netbooting-a-pi-4-without-an-sd-card/ https://linuxhit.com/raspberry-pi-pxe-boot-netbooting-a-pi-4...) but happy to see whats worked for you.
- LeoPanthera 5y agoI don't. But I really want to write one, because all the documentation on how to do it is quite poor.
- zellyn 5y agoAs I've been playing around with my Raspberry Pis, I've found this too. The hardware technical documentation is good, but, well, _very_ technical. There is a lot of very good information, but it's spread around in blog posts, forum posts (a lot of those), source code and comments, etc. But not a lot of how-tos for intermediate stuff. Hope to write up the stuff I'm working on once I figure it out :-)
- tjoff 5y agoAnd it causes me endless frustration. Because after a power outage the pi will boot and look for somewhere to boot mere seconds after power is back. But my router supplying DHCP and with info about where it should look takes guessing 3 minutes. And the NAS containing the actual files that the Pi should load is in a virtual machine that takes, guessing, 8 minutes for the hypervisor and VM to start. So by then the Pi will have timed out and sit there, doing nothing for all eternity. Fix? An extremely elaborate scheme of Ikea trådfri outlet controlled by the same server taking 8 minutes to boot to power-cycle the pi after it gets up (and notices that the pi doesn't answer to pings). Has this been fixed yet? Is it even considered a bug? Not sure about the rationale of giving up booting... Especially when this ought to be an extremely common scenario.
- mysterydip 5y agoCould you get a small UPS for the router? I would imagine it's not sucking down a lot of watts, should take care of momentary blips and anything less than an hour fairly easily.
- moffkalast 5y agoOr you know, just insert a $5 SD card like a normal person?
- pmarreck 5y agoIf you have a bunch of them, you cannot centrally manage them this way without a lot more work. Also, if they log to disk, it will wear down the SD card quickly. Netbooting wears down 0 SD cards.
- jthrowsitaway 5y agoSD cards are less than optimal in Pis for general computing usage, but you could put something like iPXE on the card. That's how I'd work around the issue originally described in this thread. https://en.m.wikipedia.org/wiki/IPXE https://en.m.wikipedia.org/wiki/IPXE
- lukifer 5y agoThanks for sharing, didn't know that. Similar PSA: a common Pi complaint is that SD cards wear out quickly under 24/7 use. Routing most logs to memory rather than disk vastly reduces the wear on the SD: https://github.com/azlux/log2ram https://github.com/azlux/log2ram
- ars 5y agoRunning backblocks -n will often fix them (non-destructive read/write - it causes a rewrite of every block on the device). Don't do it often or you'll cause extra wear, but if you find yourself getting random errors from the SD card, give it a try.
- dundarious 5y agoMany services log via journald, so to move those off the SD card, you can just add /etc/systemd/journald.conf.d/volatile.conf with contents below and `systemctl force-reload systemd-journald.service`: [Journal] Storage=volatile Check what your full config is with `systemd-analyze cat-config systemd/journald.conf`. The split file approach is very handy for Pi-s. I have a set of configs I install on any new Pi I get (resolved, locale, timesync, etc.). You can do a very similar thing with services in e.g., /etc/systemd/system/example.service.d/override.conf, which I like to do to constrain their sandbox more than the system package does (ProtectSystem=strict, SystemCallArchitecture=native, SystemCallFilter=@system-service, ~@resources @privileged, etc.)
- chrisjc 5y agoWhat do all these network booted devices do? What do they do better than an SD booted device? > you can change what OS a Pi boots into just by renaming a symlink. Just to be clear, this is the symlink on your server right? Is there any advantage in doing this other than convenience of not having to go around your house and individually change out the SD cards of each device? I've got a bunch of Pis around my house too, but they're just gathering dusk ;) I had all these grandiose ideas, but something, something ADHD.