Closed giuliomoro closed 7 years ago
After doing some research on this I have realised it's not such a good idea.
It's quite a lot more complicated than it sounds to mount the rootfs read-only, as several folders need to be written-to by the system during use. This means you have to mount a bunch of read-write tempfs file-systems on top of the rootfs, and it can get quite messy (https://wiki.debian.org/ReadonlyRoot). It doesn't actually gain much in terms of boot time, the main reason to do it is to prevent data corruption. As FAT32 partitions are much more prone to data corruption than EXT4, this doesn't really make much sense for us.
As a side note, the kernel actually mounts the rootfs as read-only at boot, then later systemd reads /etc/fstab
, runs fsck
on the rootfs if it was not unmounted properly, and remounts it read-write. Running fsck
can add a few seconds to the boot time, so its good to shut your board down properly!
One thing we could do is wipe the emmc, format it to FAT32, mount it to /data and expose it as a USB mass-storage device. That would give people a nicely accessible 4GB of extra storage...
Add a large-ish FAT32 partition for the
~
folderThis will allow:
ro
~
is of a non-root user), though for now it should be/root
otherwise nothing will work :)with the following drawbacks:
examples
folder without realizing they are making a permanent change