Openwrt on BTRFS

I'm running OpenWRT on an x86_64 thin client. Is there a way I can install it on a BTRFS filesystem still boot with the generic x86_64 kernel? Perhaps I could make an initrd with the filesystem module to boot with?

Not easily (meaning you'd need to spend quite some time on source development).

There are some scripts that support only ext2 in early mount contexts, you need to rewrite them. To have any gain from btrfs you will also need snapshot boot etc, likely kernel and grub options for those too.

So would I have to make a custom kernel?

The kernel is the least of your worries, procd and sysupgrade support would need more immediate attention.

2 Likes

You might want to look at nic.cz's turrisOS which is based on OpenWrt and at least on the turris omnis it uses btrfs. But the whole update/sysupdate methodilogy is quite different... so I concur it is not a piece of cake, but also not insurmountable....

Like debian linux instead?

I would question the desirability of this. BTRFS is a server grade resilient file system. In a data centre, with ups, with raid 5, it is an excellent solution.

In a router it will be a total disaster. The startup/mounting can take quite some time. Shutdown also.
When was the last time you shut down a router?
Just switch off the router and you are f*ck*d ..... unless you are very lucky.

Yes you can find Youtube videos telling you BTRFS is the best thing ever for your Windows desktop.... Gets lots of views, but... No, just no....

2 Likes

I like having data checksums, subvolumes and snapshots on my system, and copy-on-write can be good for flash memory. There is some performance cost, but it's a just a few seconds longer on boot, which I think is worth it for the features IMO.

And very nice too if you have the hardware to support it eg data centre server grade with big raid storage and ups.

If you can't mount the volume, checksums and snapshots are of no use to you at all.

x86 does not mean server grade. You have a "thin client", so probably a refurb unit from a call centre. Not much better than a commodity router hardware as for as "server grade" is concerned.

Like I said, just switch it off instead of a shutdown/unmount and high probability it will fail to boot next time you power it up.