Hello everyone. I’m going to build a new PC soon and I’m trying to maximize its reliability all I can. I’m using Debian Bookworm. I have a 1TB M2 SSD to boot on and a 4TB SATA SSD for storage. My goal is for the computer to last at least 10 years. It’s for personal use and work, playing games, making games, programming, drawing, 3d modelling etc.

I’ve been reading on filesystems and it seems like the best ones to preserve data if anything is lost or corrupted or went through a power outage are BTRFS and ZFS. However I’ve also read they have stability issues, unlike Ext4. It seems like a tradeoff then?

I’ve read that most of BTRFS’s stability issues come from trying to do RAID5/6 on it, which I’ll never do. Is everything else good enough? ZFS’s stability issues seem to mostly come from it having out-of-tree kernel modules, but how much of a problem is this in real-life use?

So far I’ve been thinking of using BTRFS for the boot drive and ZFS for the storage drive. But maybe it’s better to use BTRFS for both? I’ll of course keep backups but I would still like to ensure I’ll have to deal with stuff breaking as little as possible.

Thank you in advance for the advice.

46 points

If you’re not intending to use complicated RAID setups, just go with btrfs. There is no reason to bother with zfs given your specs and needs.

Do not go with ext4. Unlike both btrfs and zfs, ext4 does not do data checksumming, meaning it cannot detect bit rot (and obviously cannot fix it either). You’ll also be missing out on other modern features, like compression and copy-on-write and all the benefits that entails. Once you start using snapshots for incremental backups using btrfs send (or its zfs equivalent), you’ll never want to go back. Recommended script: snap-sync.

permalink
report
reply
11 points

ext4 + mdadm + dm-integrity would solve the bit rot problem. But you’d end up with a lot of parts bolted together and still miss out on the features that btrfs/zfs provide.

permalink
report
parent
reply
5 points

The kind of data OP is talking about using won’t benefit much from the features of btrfs. That being said it’s still a great choice for them!

Also it will detect bitrot but it won’t be able to fix it unless DUP is being used.

permalink
report
parent
reply
6 points

Almost all data, aside from stuff like databases, benefits from filesystem-level compression, and almost every user benefits from having snapshots. Snapshots have saved my ass so many times, e.g. when I accidentally delete a file I shouldn’t have, or when a program has overwritten a file it shouldn’t have, or when Crusader Kings 3 corrupts my savegame.

As for bitrot, I frankly don’t know if btrfs has an automatic mechanism of fixing rotten files from an external backup of the filesystem (created using btrfs send), but even if it doesn’t it’ll tell you what has rotted so you can restore the files manually.

permalink
report
parent
reply
3 points

I use OpenSUSE Tumbleweed, and snapshots have been a lifesaver the 2-3 times when an update went bad (NVIDIA each time, go figure). A 30 second snapper rollback later and I’m back up and running.

permalink
report
parent
reply
3 points

Systems like DSM from synology have integrity scrubbing to fight bit rot. Run it once a quarter on a 4 drive, and you’re protected. Plus, you should be backing up your data, even with RAID.

BTRFS, last I read, had lots of complexity and weird problems. Hopefully, it has improved since then (about 3 years ago).

permalink
report
parent
reply
5 points

Btrfs can be a little complex and needs more user-friendly tooling for some of the advanced features to be useful to “laymen”, but OP seems technical enough (the fact that he cares about what filesystem he’s running in the first place is an indicator of this) that this should not be an issue.

As for “weird problems”, the majority of those seems to come down to users using advanced features without RTFM, and users having underlying system issues that cause issues that btrfs catches early and refuses to mount the filesystem as RW, and the users then blame btrfs for the issue.

permalink
report
parent
reply
1 point

I don’t mind needing to be technical or having to read to do things right. I probably wont really do much fancy things, I just don’t want the filesystems dying on me out of nowhere. If they’re stable enough for that, that’s enough for me. Thanks for the help

permalink
report
parent
reply
2 points
*

DSM uses btrfs? It’s actually quite solid.

permalink
report
parent
reply
1 point

I’m aware. I considered using it when I upgraded the hardware. Good to hear it is solid. If that is the consensus, I might switch, eventually.

permalink
report
parent
reply
1 point

I just reinstalled my home lab server with Ubuntu 22.04 LTS. There was no choice in file system type.

Is it possible to convert from ext4 to btrfs?

If I should rather re-reinstall the server, how do I set the file system type during setup?

permalink
report
parent
reply
1 point

It is possible to convert from ext4 to btrfs, but if you just installed the server it may be easier to just reinstall.

permalink
report
parent
reply
1 point

Ubuntu setup wizard doesn’t offer btrfs, and the manual override requires me to set up all the partitions myself. I am not that good at Linux.

permalink
report
parent
reply
22 points

Ext4 with backups

permalink
report
reply
15 points

This for sure. As a general rule of thumb, I use XFS for RPM-based distros like Red Hat and SuSE, EXT4 for Debian-based.

I use ZFS if I need to do software RAID and I avoid BTRFS like the plague. BTRFS requires a lot of hand holding in the form of maintenance which is far from intuitive and I expect better from a modern filesystem (especially when there are others that do the same job hassle free). I have had FS-related issues on BTRFS systems more than any other purely because of issues with how it handles data and metadata.

In saying all that, if your data is valuable then ensure you do back it up and you won’t need to worry about failures so much.

permalink
report
parent
reply
4 points

ZFS is great but I wouldn’t recommend it for single volume setups. I’ve never lost data with it but the parity has always been the saviour.

Never used BTRFS.

I avoid XFS due to performance reasons as most my systems are comprised of many smaller files which XFS isn’t great for. But the usage I’ve had with it, it’s been great

EXT4 is always my go-to for normal usage. Unless I need to be supporting older machines then it’s ext2/3.

permalink
report
parent
reply
3 points

Hey, thanks for the help. Can you elaborate on what kind of issues BTRFS gave you? What caused them, too?

permalink
report
parent
reply
2 points

Sure, I’ve used it both in Server and NAS scenarios. The NAS was where we had most issues. If the maintenance tasks for BTRFS weren’t scheduled to run (balance, defrag, scrub and another one i can’t recall), the disk could become “full” without actually being full. If I recall correctly it’s to do with how it handles metadata. There’s space, but you can’t save, delete or modify anything.

On a VM, its easy enough to buy time by growing the disk and running the maintenance. On a NAS or physical machine however, you’re royally screwed without adding more disks (if its even an option). This “need to have space to make space” thing was pretty suboptimal.

Granted now I know better and am aware of the maintenance tasks, I simply schedule them (with cron or similar). But I still have a bit of a sour taste from it, lol. Overall I don’t think it’s a bad FS as long as you look after it.

permalink
report
parent
reply
1 point

It needs a bit of periodic maintenance, the btrfs-assistant and btrfsmaintenance packages will set it up and from then on it’s automatic.

permalink
report
parent
reply
2 points

OpenSUSE, both Leap and Tumbleweed, use btrfs by default. Do you switch those to xfs during installation?

I’ve had btrfs snapshots pull me out of the fire multiple times on my home machines, but I don’t fully trust any file system at all, so I rsync stuff to two local network destinations and an off-site location as well. Those, too, have come in handy.

permalink
report
parent
reply
2 points

Yep, sure do. I’ve no real benefit for the features it adds, or I’m completely ignorant to the benefits is probably more accurate :)

For the things you’ve mentioned it is useful. I think the main thing I’ve been warned to never do with BTRFS is use it for RAID and to use md under it instead. That said, that could be old info and it may be fixed now.

permalink
report
parent
reply
20 points

I’m assuming you don’t want to tinker with things? I’m also assuming you do not have experience with things like ZFS. So….

Unless you’re running multiple drives (or special options) zfs & btrfs aren’t going to give you much. For instance btrfs (unless it’s set to DUP) isn’t going to protect from bitrot or other data corruption. Same goes for ZFS. It will throw an error when something doesn’t match the checksum though.

Your best option is to either use ext4 or xfs for your 4tb storage. If you’re working with a lot of large files xfs has some advantages but overall you’re not going to notice that much of a difference in your uses.

For your ssd, btrfs has the advantage over ext4 and xfs. Although so does f2fs. In practical uses for what you’re describing it’s not going to make that much of a difference.

Unless you have a specific reason to use something other than ext4 then just stick with that. It’s simple and just works. Make sure you’re keeping backups eg restic, borg, rsync, duplicity, etc etc. and follow the 3,2,1 rule where possible and you’ll be fine.

If it were me setting up that system I’d mirror the drives and use btrfs. Which is pretty much what I did on my PC. But that double the costs of storage.

The only place (at home) I use ZFS is on my NAS. I have Rocky8 setup and all it does is handle storage. I use mirrored pairs on my important data and Z1 on everything else. But that’s a topic for another post

If you REALLY want some of the features of zfs or btrfs eg snapshots, I’d lean on your backup software for that but if you can use LVM to take snapshots in a similar fashion. See STRAIS for another example too. However that’s beyond the scope of this post.

permalink
report
reply
2 points

Thanks for the help. Both of my drives are SSDs, the boot drive is M2 and the storage is SATA. I’ve heard filesystems that support compression would be better for their health and lifespan as they’d have to write less. But yes, no matter what, I will keep constant backups. Snapshots would be appreciated, but since I’ll run Debian I don’t think they’d be that necessary, if to have them there’s a lot of problems to deal with in exchange.

permalink
report
parent
reply
2 points

Since both drives are SSDs there’s nothing really stopping you from using BTRFS. You are correct that the features for BTRFS are better for the long term health of your SSDs and if you feel comfortable with it then you should 100% use it. That being said with todays SSDs the life span extending features of BTRFS, F2FS, etc are going to be minimal at best. So don’t stress too much over running it or not. Just use whatever you’re most comfortable with.

permalink
report
parent
reply
16 points

A lot of these responses seem… dated. There’s a reason TruNAS and such use ZFS now.

I would recommend ZFS 100%. The copy-on-write (allowing you to recover almost anything), simple snapshots, direct disk encryption, and ability to not only check the file system, but tell you exactly which file has an issue if there is an error, make it an easy choice even if its a one-disk system.

Personally I use date times for my snapshot names, and delete old ones as time goes on. Its fabulous for backups.

permalink
report
reply
5 points

Isn’t zfs out of tree?

permalink
report
parent
reply
4 points

Yes its license is not GPL compliant.

permalink
report
parent
reply
1 point

There’s a reason TruNAS and such use ZFS now.

Do you mean for the boot drive?

permalink
report
parent
reply
1 point

Well yeah, ZFS is absolutely fantastic for a NAS, but it’s complete overkill for a desktop. That’s why I recommend BTRFS for a desktop like this, and still recommend ZFS if you’re building a NAS (mine also uses BTRFS, but that’s because I don’t need the features and would rather only deal with one FS).

permalink
report
parent
reply
14 points

btrfs and you get snapshots, the ability to send subvolumes around + compression and a ton of other stuff.

be aware that to configure a good layout in btrfs you will need to do that manually, follow the arch wiki and you will be ok.

permalink
report
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 9.6K

    Monthly active users

  • 5.8K

    Posts

  • 162K

    Comments