4 ms·
this is a bit misleading in that it's not necessarily about netbooting (which per linked article just works). As someone who's played with raspberry pi's on "r
by mirceal 9y ago
this is a bit misleading in that it's not necessarily about netbooting (which per linked article just works).
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.
- exhilaration 9y agoIt seems like another benefit of your method is that it will allow the subsequent image to be downloaded over WiFi, is that right? Or are you also limited to ethernet?
- mirceal 9y agoit can work on whatever. the biggest advantage is that it's not using the SD card and it's always using the latest image.
- ChuckMcM 9y agoI don't disagree, it reads a bit like submarine marketing for the clustering hardware. But the difficulty in net booting is for the Pi1 or Pi2. On the Pi 3 it "just works." 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.
- mirceal 9y agopoint was that it does not just work on a pi 3 if you put it in a real-life environment. also, net booting is still a thing, but not for the diskless scenario :)
- deleted 9y ago[deleted]
- kasey_junk 9y agoI’d love to see any code/instructions you have for that. Looks like something I was planning on building.
- mirceal 9y agoThe overall approach is to: - 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.
- djhworld 9y agoThe article does state in the reliability section that booting was very unreliable
- eltoozero 9y agoMaybe a dumb question, is there some technical reason why the SD card ever needs to be writeable if you’re netbooting? 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?
- wolfgke 9y ago> Speaking of which, why don’t WORM SD cards exist since there aren’t write protect switches on MicroSD cards? 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&oldid=814403607#Write-protect_notch 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."
- gerdesj 9y agoNo there is no reason for the SD card to have to be writable. You can put / and other filesystems into RAM discs. You can disable swap or run it over NFS and you can get other filesystems over NFS as well, so lots of options. If you pass the correct options to the mount command, you get read only mode (funnily enough it is the ro option)