Hacker News new | past | comments | ask | show | jobs | submit login

Surprisingly, the article doesn't seem to mention SquashFS[1] or EROFS[2].

Both SquashFS and EROFS are filesystem specifically designed for this kind of embedded, read-only use case. The former is optimized for high data density and compression, and already well established. The later is comparatively new and optimized for high read speed.[3] SquashFS as a rootfs can already be found in many embedded applications using flash storage and is typically also combined with tmpfs and persistent storage mount points or overlay mounts.

For both those filesystems, one would build a rootfs image offline. In the Debian ecosystem, there already exists a tool that can bootstrap a Debian image into SquashFS[4].

[1] https://en.wikipedia.org/wiki/SquashFS

[2] https://en.wikipedia.org/wiki/EROFS

[3] https://www.sigma-star.at/blog/2022/07/squashfs-erofs/

[4] https://manpages.debian.org/testing/mmdebstrap/mmdebstrap.1....




This is actually why I switched all my Pis to Alpine Linux since they use a RAM disk by default for RaspPis Haven't lost an SD card since, meanwhile my Octoprint RasPi has failed 4 times (mostly because of random power disconnects)


I'm a fan of Alpine too, but I want to point out that to the best of my knowledge at least, running root from RAM is trivial and is not something you need to change distros for, you simply have to add the "toram" kernel boot parameter. For example, if your entire read-only root is contained in "filesystem.squashfs", then adding "toram=filesystem.squashfs" would read all of this into RAM on boot.

I can't vouch for every single distribution out there, but I've done this successfully on Debian at least.


Very true. Before I found Alpine I used a heavily modified raspbian with a root read-only ramdisk which also worked but Alpine did it out of the box without having to modify everything


I have a pi or two running openwrt, which does this naturally.

I also have a pi running pikvm. You change the filesystem by doing:

  # rw   <-- makes filesystem read/write
  # (change config, or commands making filesystem changes)
  # ro   <-- back to read-only




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: