guysoft / RealtimePi

An out-of-the-box raspebrrypi/raspbian distro with a realtime kernel
GNU General Public License v3.0
163 stars 25 forks source link

overlay file system doesn't work #38

Closed jk987 closed 1 year ago

jk987 commented 1 year ago

If I try to switch on overlay file system in raspi-config (in Performance Options) then everything seems to be ok. It is generating new initrd image, cmdline.txt contains "boot=overlay", script /etc/initramfs-tools/scripts/overlay exists... But if I try to write something on disk after reboot then it is still there after next reboot. I tried 2021-05-07-realtimepi-buster-armhf-lite-0.5.0.img

Any ideas?

jk987 commented 1 year ago

Meanwhile I'm studying how the overlay file system should work and if I try simple experiment then it works:

root@realtimepi:/home/pi# mkdir lower
root@realtimepi:/home/pi# mkdir upper
root@realtimepi:/home/pi# echo low > lower/low.txt
root@realtimepi:/home/pi# echo up > upper/up.txt
root@realtimepi:/home/pi# mkdir work
root@realtimepi:/home/pi# mkdir merge
root@realtimepi:/home/pi# mount -t overlay overlay -o lowerdir=lower,upperdir=upper,workdir=work merge
... check that in merge is both low.txt and up.txt ...
root@realtimepi:/home/pi# echo m > merge/m.txt
... upper/m.txt is created ...
root@realtimepi:/home/pi# rm merge/up.txt
root@realtimepi:/home/pi# rm merge/low.txt
... lower/low.txt stays untouched, in upper stays only m.txt and some weird low.txt ...

I guess that now I should try to understand how to mount root this way on boot.

guysoft commented 1 year ago

Does it work for you on normal Rpi OS?

jk987 commented 1 year ago

Yes, I tried something called 2022-09-22-raspios-bullseye-armhf-lite.img and it worked.

Do you think I could try to mix somehow your realtime image with standard raspbian?

I'm still sort of linux beginner so I don't know very well eg. what the initrd image is for and whether I could take offical initrd image and put it into your system.

guysoft commented 1 year ago

That image is newer than the released version of RealtimePi 0.5.0 that uses 2021-05-07.\

I can build a nightly image for to test. You can also just install the latest realtime kernel, but I did not test it: https://github.com/kdoren/linux/releases/tag/rpi_5.15.65-rt49

jk987 commented 1 year ago

Sorry for the delay.

I found this solution: http://wiki.psuter.ch/doku.php?id=solve_raspbian_sd_card_corruption_issues_with_read-only_mounted_root_partition And it works pretty well for me. One executable script in /sbin and calling this script from /boot/cmdline.txt For me it is nice simple solution.

guysoft commented 1 year ago

No worries thanks for sharing, does it work now for you? Should I close the issue?

jk987 commented 1 year ago

Like I said. It works fine. You can close it.