Hacker News new | ask | show | jobs
by jakogut 1554 days ago
I think a simpler and easier solution when you have plenty of memory is to use an initramfs [0] as your root, which avoids having to read from disk after boot. Considering the Pi 4 can be had with up to eight gigs of memory now, this is a pretty good solution. Additionally, Buildroot [1] can build a kernel with a compressed initramfs image quickly and easily, for a number of popular single board computers, including the entire Pi family. This allows more than enough functionality for simple and reliable data logging.

EDIT: You couldn't be sure when the disk was ready for writes, so you'd have to log to memory, and have a task that attempts to mount the data partition and flush the buffered data to disk atomically before clearing the buffer.

[0] https://www.kernel.org/doc/Documentation/filesystems/ramfs-r...

[1] https://buildroot.org/