milanp Posted September 2 Share Posted September 2 Hello, I have a fully working customized Armbian on OrangePi PC Plus. There are two partitions, one for the rootfs, second mounted as /home I want to convert the root partition to squashfs, and use the squashfs file to boot from. I already converted the root partition to squashfs file, I can mount squashfs file, and the contents are correct. I even tried to mount it via fstab and it works. I searched everywhere, obviosly not enough, but I cannot find a way to boot directly from the squashfs file. The idea is to have only squashfs file and rw partition for /home Please, can somebody help me, or point me to the right instructions ? 0 Quote Link to comment Share on other sites More sharing options...
going Posted September 2 Share Posted September 2 4 часа назад, milanp сказал: The idea is to have only squashfs file and rw partition for /home Quite interesting! If you try to explain your ultimate goal and the reasons that led you to this decision, perhaps I can give you some advice. 1 Quote Link to comment Share on other sites More sharing options...
milanp Posted September 2 Author Share Posted September 2 (edited) I intend to use opipc's as appliances,with a simple cordova application which is started upon boot. The app uses web services to communicate with the backend, very small database locally. I had very positive experience with openelec/librelec kodi distributions where all the os+app were in squashfs. During more than 5-6 years of usage, I never had corrupted filesystem on those systems. Because of ro access to the squashfs, there's less posibility of corruption of rootfs. I tested several times to cut of power on the opipcplus, and managed to corrupt the system, so it will not boot. With squashfs, the rootfs should be more resilient. The data corruption of the local db is handled by the cordova app. Meanwhile I think I found a solution, I should put a script to mount the squashfs in the initrd scripts folder(unpack,recreate initrd with my script inside). All the tmp,proc... folders should be mounted on persistent storage (I intend to use ext4, on a separate partition). The /usr/bin+/usr/sbin folder should contain all the needed libraries + executables. It seems that the script should go in scripts/init-bottom. This is what I researched today, by learning about the boot chain of linux. Unfortunatelly, I will be away in the next days, with no time to try. Edited September 2 by milanp 0 Quote Link to comment Share on other sites More sharing options...
going Posted September 7 Share Posted September 7 02.09.2024 в 19:40, milanp сказал: Because of ro access to the squashfs, there's less posibility of corruption of rootfs. It's hard to argue with that. But the squashfs file system is basically an opportunity to use a compressed root file system to save space. If we set the task as ensuring fault tolerance of the root file system, then we need to perform a whole set of measures. And mounting the root file system with the read-only flag is one of the points. By the way, u-boot is able to work with the squashfs file system. I thought your question was about that. With respect. 1 Quote Link to comment Share on other sites More sharing options...
robertoj Posted September 7 Share Posted September 7 There the option of “overlay file system”. It makes your file system “forget” anything that is changed since the snapshot, upon each poweroff look for it in armbian-config 2 Quote Link to comment Share on other sites More sharing options...
milanp Posted September 8 Author Share Posted September 8 @robertoj and @going Many thanks for the replies. Yesterday I managed to mount squashfs in initramfs, mount the persistent partition in initramfs + to create overlay for the squashfs. I could not create overlay in intitramfs until I installed overlayroot. @robertoj, I saw that option yesterday,I did not have time to play with it. Let's see how this works. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.