Confusion about OpenWrt filesystems

I was looking at the OpenWrt documentation pages about the available file systems, and I ended up in being a little confused.

I'm building images for PC Engines ALIX boards, supported by the x86 Geode target (they mount an x86 AMD Geode processor), with both the ext4 and squashfs options selected in "make menuconfig".
The memory used is always a 4/8 GB Compact Flash memory, which should be raw NAND (is this correct?).
I get, as result of the build process, these two images:
-> openwrt-x86-geode-combined-ext4.img
-> openwrt-x86-geode-combined-squashfs.img
I've always used ext4 images, feeling more comfortable, while experimenting, with a more standard filesystem, but I have also read that SquashFS+JFFS2 (with OverlayFS) provides journaling and wear leveling, while ext4 does not.
SquashFS+JFFS2, however, seems to be unsuitable for raw NAND devices.
In the documentation, it says that SquashFS+UBIFS is instead used for raw NAND devices.
How can I tell whether the openwrt-x86-geode-combined-squashfs.img is actually using JFFS2 or if it uses UBIFS? How can UBIFS+SquashFS be better than JFFS2+SquashFS for NAND memories if SquashFS is still being used (partitioning in UBIFS images is still "TODO" in the documentation)?
Then, what is the best option, in terms of stability/speed/flash memory life for devices like the PC Engines ALIX boards, which are more capable than other routers? ext4 (with/without journaling), the "squshfs" based images or potentially other solutions?

If instead of compact flash memories SSD were used, which should be FTL devices, would ext4 be a good option?

Thanks a lot in advance.

If I'm not using ZFS, I run ext4 on mSATA. SATA, and USB "stick" drives on APU2/3 devices. I stay away from SD-card "drives", in general, when I can, as they aren't typically designed for the amount of writes that an OS typically puts on them. CF looks like an ATA device to most OSes, so I'd suggest ext4 (or ZFS) for them as well.

Thank you for your reply! So, ext4 seems to be a good choice in the end. I've read multiple times suggestions about using ext4 withouth journaling. Do you know why is this actually a better choice (being also the default one when building OpenWrt)?

By the way, as far as I have understood, CF cards include a controller, possibly already providing a wear leveling system; is this right?

I don't know enough about ext4 journaling, but always worry with devices that aren't running on "uninterruptible" power about file system corruption. I personally don't know the reasoning behind the suggestion to not using journaling.

My understanding of CF devices aligns with yours -- that the device itself takes care of the memory within, much as an SSD would. I can't comment on how sophisticated those devices are, or how well they hold up with repeated write cycles. With the relatively low price of smaller SSDs in both the mSATA and 2.5" formats, those tend to be my first choice, when the interfaces support them.

1 Like

Because of potential performance hit. Depends upon write-activities, of course.


Linaro has an article about flash cards. In particular, I can recommend the "FAT optimization" section. The benchmark is dated now, but the facts given might still be relevant for current hardware.
I would expect SSDs to take fewer of the shortcuts described there.

This LWN article provides even more details.

1 Like

Sorry for my late reply! I've had some very busy days during this week.

Thanks! I will read the article you suggested as soon as I can.

Pretty much "any" filesystem is fine for CF/SD/USB unless you do constant logging (writes) which will kill it eventually. That said, I've run a fully fledged OS (FreeBSD on UFS) off a USB flash drive (Sandisk Extreme) for 1y+ without any issues at all and while I'm not using that box anymore the USB drives are still in everyday use without any issues at all. :slight_smile:


My experience with USB "drives" is similar to that of @diizzy in running a "full" OS on them as the primary storage media (mirrored ZFS, in my case, as I don't trust them not to fail).

SD or microSD cards, on the other hand, tend to die on me in a year or two when actively used by the OS.

CF devices were used for many years by commercial embedded systems (prior to the availability of inexpensive SSDs). However, they use "commercial" or "industrial" units, not "consumer" units. See, for example,

1 Like

Thank you again for your replies!
I am actually using (at least in one of the embedded boards in which I integrated OpenWrt) a high-endurance PC Engines CF card (which is more towards "industrial", taking as reference the page @jeff linked me), also due to the need of doing a good logging activity, at least in the first phase of my work with OpenWrt and the ALIX boards.
So, in the end, you are suggesting that ext4 can be a good file system to select (considering the images that are typically built within the OpenWrt build system), is that right?