With RPis running from SD cards you might be better off using the squashfs images, and create an extra partition out of the unused space formatted for ext4fs. That way you could properly fsck the ext4 filesystem after a power problem without compromising your boot and core configuration.
What are the benefits of this solution?
I simply wanted to have an fsck checked filesystem at startup - UNIX Standard so far ¯_(ツ)_/¯
Can squashfs save my configurations?
Pretty much all Desktop Linux Distros like Ubuntu and Fedora does this, heck even PFsense checks the FS on boot. I think it's simply is not there because OpenWRT was originally built to extend life to old el-cheapo routers with SquashFS, low flash devices in mind not ext4 with gigabytes of flash
Corruption will still occur with SquashFS, the expectation is if the FS get's corrupted due to unclean shutdown, you are expected to re-install OpenWRT/reset configuration just like what @pythonic said
It's been that way since forever, and I don't see it anytime changing soon. The only other option is wait for someone to implement it, or implement the functionality yourself, my advice is to probably just use an alternative router distro. I think even debian would work, just install a couple of packages and it becomes close to OpenWRT, but if you're going that route, just use VyOS.
While corruption to saved configs can still occur with SquashFS based images it is much less likely than with ext4 based images - most regular domestic routers use SquashFS based installations and saved configuration corruption is quite rare with such devices for this reason despite repeated unclean shutdowns.
To be specific:
- the SquashFS filesystem used to store all the OpenWrt code is immutable and will only suffer corruption due to failure of the underlying storage medium
- the overlay filesystem (most commonly JFFS or F2FS) used to store the configs in conjunction with the SquashFS filesystem is inherently much less susceptible to corruption than ext4 filesystems.
If there are any power stability issues on targets which use SD cards, like the RPi and some other SBC type devices, using SquashFS based images will be much more resilient to config corruption.
On a different tack, backing up and restoring systems with SD cards is much easier than with many alternative storage media - as long as you've got a spare SD card you can just copy the working SD card to the backup card with an imaging tool (e.g. dd on Linux, Win32DiskImager on Windows).
This totaly makes sence but why do the OpenWrt Team recomment an ext4 install for RPi for default? (Edit: squashfs only offered for RPi 4 by default)
Maybe I‘ll give squashfs a chance in the future. OpenWRT runs 2 years pretty stable my Pi for now and I don‘t wanna change because of fs probs. I‘ve made 2 partitions for /opt and /root now which are rw and checked each boot by /etc/init.d startup script. / fs is pretty stable as long you don‘t run fancy stuff on it like docker - so /opt is now the problem child but for now this seems to solve my problems. Thanks everyone!
This is because of the following, unlike ext4, you can simply expand the partition, I myself don't even know how to expand the squashfs partition, based on quick search, this came up: Expanding OpenWrt squashfs image (SDcard) - #31 by wtuppa but maybe @pythonic has a better solution other than compiling from source?
This disk image uses the traditional OpenWrt layout, a squashfs read-only root filesystem and a read-write partition where settings and packages you install are stored. Due to how this image is assembled, you will have less than 100MB of space to store additional packages and configuration, and extroot does not work. It supports booting from EFI.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.