Score:5

Should I use zfs or ext4 filesysttem on old laptop with SSD?

mw flag

While installing Ubuntu 21.10 on a rather old laptop, I've noticed that I can Also choose ZFS as a filesystem which is apparently has become default on Ubuntu server. As far as I could read it is one of the prides of FreeBSD community as a robust and mature filesystem and is a rather newcomer to Linux ecosystem. So I'm curious about it.

I'd like to encrypt my laptop's entire SSD and I'd like have a performant system. So I'm wondering what will be the effects of using ZFS instead of good old ext4, in terms of performance, stability and battery usage?

guiverc avatar
cn flag
If you've got loads of RAM, loads of cpu resources, and a need for ZFS - it's a good production file-system. It's resource heavy though; so I'd skip using it unless you benefit from what it provides.
chrylis -cautiouslyoptimistic- avatar
As a side note, if it's not soldered on, I recommend replacing the SSD. They have a consumable lifetime, and they're not especially expensive.
ag flag
Unless you have very good reason to, just choose the file system suggested by the installer. This will give you a configuration that is very well tested and therefore with the least surprises. Also if you encrypt your hard drive, you better have very well tested backups as well or you should be prepared to lose data. Testing is both backup and restore.
Score:6
in flag

ZFS is great on servers with lots of ram, lots of cpu, and lots of disks.

It does very well on large disks and joining multiple disks, and has nice features like software implementation of hybrid spinning rust + SSD cache raid volumes for extra performance.

If you have a single small disk with limited ram, zfs might still work well, but most of its advantages are gone, and ext4 might work as well, but with lower ram use.

For single disks over 4T, I would consider xfs over zfs or ext4. For more than 3 disks, or a spinning disk with ssd, zfs starts to look very interesting. Between 2T and 4T on a single disk, any of these would probably have similar performance.

But, as always, your specific use case affects this greatly, and there are corner cases where any of these would work better than the others. For example, zfs and xfs perform much better than ext4 when you have thousands of files in a single directory, no matter what the disk size. But this is a corner case, and not common, especially with disks smaller than 2T.

For small disks typically found in laptops, ext4 should be sufficient, and if you want encryption, the defaults you get when you enable it in the ubuntu installer probably work best with ext4 anyway.

blnks avatar
mw flag
My disk is only 256GB. So what do you reckon about possible difference that it makes?
user10489 avatar
in flag
I don't see a lot of point in using anything except ext4 for something that small. The defaults with LUKS and ext4 in the ubuntu installer should work well.
cn flag
pts
Why is XFS better than ext4 for large spinning disks?
user10489 avatar
in flag
xfs was specifically designed for large files and large numbers of files. Many of its internal data structures are b-trees instead of the linear lists that ext4 generally uses. Above 2T, xfs starts becoming advantageous, and above 4T ext4's linear data structures start becoming a serious problem. (b-trees are like binary trees, except not binary, and designed to be efficient on block based devices.)
cn flag
In my experience, XFS has better read performance than ext4 with lots of small files, but write performance is significantly worse. It's popular on web servers, where reads greatly outnumber writes, but on a personal laptop where I sometimes compile things, I still prefer ext4.
user10489 avatar
in flag
I prefer ext4 on smaller disks. Interesting xfs has slower write performance; it was originally designed specifically for a read mostly situation (video on demand servers), so it's not too surprising.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.