The state of netbooting Raspberry Pis
blog.alexellis.io
blog.alexellis.io
Alternative SBCs have started adding onboard eMMC, USB 3.0, and GigE; while they’re still not desktop PCs, having faster IO makes tinkering so much less annoying (for many applications). I hope if anything, the next Pi has Gigabit.
The fastest low-cost networking board right now (that I can find) is the espressobin, built around the Marvell Armada chipset. It's got three full-duplex GigE ports that can actually run as such as well as pci-E and SATA. Unfortunately it's oriented toward routers and stuff so it lacks HDMI, so no good for home entertainment.
Also Pine64[2] is supposed to be suitable for HTPC (Kodi) usage but I haven’t tried it and YMMV.
I <3 RouterBoards + MikroTik.
Problem with these: I can never be sure what level of acceleration for video playback is supported - and in what quality. The Pi is pretty rock solid in that department. Also, the Pi has by far the biggest community and extensive documentation, and I can rely on there still being Pis available in years, compared to the Chinese outfits where no one knows how long they'll stay in market.
I have rather a lot of them, at home and work. For me, quality and standards count.
Nowadays Pis are made in Wales (by Sony). They are designed by a British foundation. To all intents and purposes they are a British computer that fulfils a particular niche rather well. No, the Pi3 does not have GBE or SATA but it is (in my opinion) a piece of kit that you can trust to not set fire to your cat.
(Aside from that, I’d really like if all models had a serial console over USB, and perhaps a small amount of built-in flash memory to avoid the need for a MicroSD card in some cases)
As someone who's played with raspberry pi's on "real" networks I can tell you that netbooting one is not as reliable as you think. It may work on a small home network, but once you have 50+ devices tftp-ing something will show it's limits.
The firmware that netboots is also not as reliable as one would think. If it fails it just hangs. A proper netboot/PXE client will retry forever.
The approach I followed was to build a minimum ramdisk image which I've placed on the SD card. When that starts, it creates a in-memory file system and downloads the actual image to this file system. The SD card is in read-only mode after that.
That said, net booting used to be a thing. When I joined Sun Microsystems in 1986 it was all about the 'diskless workstation.' At the time was the brand new Sun 3/50.
also, net booting is still a thing, but not for the diskless scenario :)
- download and write a stock raspian image to an sd card
- tweak the init script at /usr/share/initramfs-tools/init to create the ramdisk file system and to insert the download path + download + write part
- use mkinitramfs to create the image (read the man for mkinitramfs)
- replace the initramfs img in the SD boot partition with the one you've just built
- tweak the cmdline.txt and the config.txt files for the boot partition to use the new initrd
- pack the boot partition image.
I understand the appeal of not needing an SD at all, but if the common failure mode is read-only just embrace it.
Speaking of which, why don’t WORM SD cards exist since there aren’t write protect switches on MicroSD cards?
For that matter, is there a way to reliably induce the read-only mode without just bombarding an sd card with writes?
Also "normal" SD cards are not write protected even if they have a switch that is in the write protect position:
> https://en.wikipedia.org/w/index.php?title=Secure_Digital&ol...
"The presence of a notch, and the presence and position of a tab, have no effect on the SD card's operation. A host device that supports write protection should refuse to write to an SD card that is designated read-only in this way. Some host devices do not support write protection, which is an optional feature of the SD specification. Drivers and devices that do obey a read-only indication may give the user a way to override it."
If you pass the correct options to the mount command, you get read only mode (funnily enough it is the ro option)
I hope raspberry pi 4 has gigabit ethernet and netbooting becomes a first class function.
My ideal "netbooting" setup is a faux SD card that translates block IO to UDP packets on a GBit link and has a little software on my computer reading/writing from a binary blob. I can still mount it if theres something mountable in the blob. Being a SD card it solves the other big problem with netbooting, which is that it's not transparent. The bootloader needs to know it's netbooting. The kernel needs to have support for NFS. init needs to know you are netbooting to mount the differently-named FS. And then when a service decides on startup to reset the network connection (hello Android), you're still fucked.
Linux kernel + initramfs, there you are. Why reimplement stuff when it can be done cheaper in kernelspace?
> One of the persistent frustrations with any sort of Linux filesystem is that their makers feel you would only ever want to use them with a full-blown Linux kernel, too
That's true of any modern general-purpose filesystem, for all OSes - there's a reason why embedded devices often enough speak only FAT32, and some even only FAT16.
It is completly self contained. The user just provides it with a linux kernel image and the initrd image.
But the biggest pain point remains the whole NFS mess. I'm not sure you can even do something like SELinux over NFS, and even if you could, you still need to configure the right host computer permissions and attributes only for stuff to match on the netbooting machine.
NFS is a mess. So design your solutions to not need it. I see no reason why the pixieboot solution isn't something capable of scaling to thousands of machines on a network.
That's a little unfair. NFS has been around for a very long time and yet it is still modern and being developed. You do have to do things the Unix way to get the most out of it, so you need to get Unix uid/gid standardised across your network for example. Samba's winbind and the rid backend to idmap is a rather easy way to turn AD users into full Unix users with consistent uid/gid.
If you get your time, DNS and user IDs right then NFS can be pretty easy and very, very reliable. On modern Unix systems, you also have Samba to play with and other things. Lots of choice and with a bit of thought and research, you will find a decent solution.