I have an embedded system (specifically, Google Coral with Mendel Linux), which will be running some models. I expect it to get turned off in not a secure way (basically plugging it off) mostly every time, so I want to make a robust system that won't have any data loss or corruption. After reading a lot and doing research, I found that making a Read-Only file system is what can work best (+ having an external micro-SD card that can be r-w, and in case of corruption of that, check that on every boot and repair it).
But there is something I am not understanding. Everywhere I read, it says
making RO the root filesystem
And after running lsblk -l, I can see that in my system, there is /, /boot and /home. And I am not sure what is the difference between making / RO or making all mmcblk0 partitions RO. I did not find any explanation or differentiation. In some places they just did /boot and / RO (as home was not always present). From what I understand, / is the "beginning" of the fs, and everything else pends from it, so /boot should be under it?
lsblk -l
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0 179:0 0 7,3G 0 disk
mmcblk0p1 179:1 0 128M 0 part /boot
mmcblk0p2 179:2 0 1M 0 part
mmcblk0p3 179:3 0 2G 0 part /home
mmcblk0p4 179:4 0 5,1G 0 part /
mmcblk0boot0 179:32 0 4M 1 disk
mmcblk0boot1 179:64 0 4M 1 disk
mmcblk0rpmb 179:96 0 512K 0 disk
mmcblk1 179:128 0 28,8G 0 disk
cat /etc/fstab
/dev/mmcblk0p4 / ext4 noatime,defaults 0 1
/dev/mmcblk0p1 /boot ext2 noatime,defaults 0 2
/dev/mmcblk0p3 /home ext4 noatime,nosuid,nodev,defaults 0 3
Sources I have read:
- Is using a read only root file system a good idea for embedded setup?
- Journaled filesystems and power failure
- SSD meta-data corruption
- Protecting disk from powerloss
- Most powerloss failure tolerance systems
- Preventing data corruption on powerloss (RO root)
- Robustness by RO
- Preventing FS corruption
- Using Overlay fs (I think it's not possible in my actual system)
- Read-only filesystem - Considerations and Loss of Functionality