Spyke

Which file system do you recommend for Linux?

Just a simple question : Which file system do you recommend for Linux? Ext4...?

EDIT : Thanks to everyone who commented, I think I will try btrfs on my root partition and keep ext4 for my home directory 😃

View original on lemmy.ml
lemmy.ml

If you’re just doing a vanilla Linux install, ext4 is the way to go.

111
lemmy.ml

Upvoted. Not everyone wants to rely on backups and restore broken system every month like on BTRFS

-48
lemmy.ml

File system is a core component of any electronic system. Even if it's just 1% less stable than other ones, it's still less stable. Maybe it's faster in some cases and supports better backups but ehh idk if it's worth it. Losing documents is something you probably want to avoid at all costs

-5
dblsaikoreply
discuss.tchncs.de

Yeah, but it isn't noticeably "less stable" if at all anymore* unless you mean stable as in "essentially in maintenance mode", and clearly good enough for SLES to make it the default. Stop spreading outdated FUD and make backups regularly if you care about your documents (ext4 won't save you from disk failure either which is probably the more likely scenario).

* not talking about the RAID 5/6 modes, but those are explicitly marked unstable

23

My short BTRFS history

  1. Installed on a 1TB NVME
  2. used for 2 years
  3. Rebased my system a ton, used rpm-ostree a ton (which uses BTRFS for the snapshots I think?)
  4. Physically broke the SSD by bending (lol used a silicon cooler pad but it bent it) which resulted in hardware crashes
  5. With dd barely managed to get all the data onto a 1TB SATA SSD
  6. dd-ed the SATA SSD onto a 2TB NVME
  7. deleted and restored the MBR, resized the BTRFS partition to max, resized the BTRFS filesystem to max, balanced it

Still works, never had a single failure

25
lemmy.ml

Well gtk if it's really as stable as ext4. I will still stick to ext4 though because why change what already works well and tested on almost any machine you can possibly imagine?

-4
slrpnk.net

I suppose by being more efficient, "using modern technology" (everything saving Google, Meta, Amazon etc. money and is thus extremely well funded, all server related stuff), is good for the environment.

If something runs faster on the same hardware, it may use less energy. It may also just be restricted in hardware usage, like not using multithreading.

Linux Distros shipping x86_64-v2 packages is a whole other problem...

4
Mereoreply
lemmy.ca

I disagree. My partition is ext4, but Timeshift saved my ass when an upgrade went wrong. I just had to restore the system from a previous snapshot taken before the upgrade.

13
lemmy.ml

Of course updates can break stuff. What I don't understand is why would you intentionally go for a less stable FS that can break and corrupt all files? It's especially bad on old machines with limited space where full backups are not possible

-8
Mereoreply
lemmy.ca

Are you talking about ext4 or BTRFS?

11
lemmy.ml

Updates can break stuff on any file system but BTRFS is known for worse stability, at least in the past

-8

I'm running it for over 3 years as complete linux moron with no issues whatsoever. It was default in openSUSE and its automatic snapshot feature saved my ass multiple times. I've heard everyone saying ext4 is super stable and I should use it, but I went with default and can't complain.

7

Just stop already. You look like a ext4 zealot with all these outdated comments.

-1

I never tested BTRFS on SSDs under 128GB or even HDDs, but never had a corrupted one.

Those anecdotes are worth little so it would be best to have current data.

One of the above points was that the claims are outdated, which would be really interesting to verify.

Like, making a study with many different parameters

  • hdd, sata ssd, nvme ssd, emmc, etc.
  • size: 50-200MB, 1GB, 16GB, 128GB, 500GB, 4TB (from small embedded, to IOT, to usb flash drive, to smartphone, to laptop, to Server/Backup)
  • amount of usage: percentage filled, read/write per minute
  • BTRFS actions: snapshots, balance, defragment
6
lemm.ee

If full backups aren't possible that's an administrator failure.

Reliance on a file system to never fail rather than have proper backups, is an administrator failure.

ANY system can, and will, fail. Thinking and behaving otherwise is an administrator failure.

"Everything gets gone, sooner or later" - being prepared for it is good administrator behaviour.

5

Yes but why intentionally choose a worse option? Sorry but it's not very smart imo.

And not having enough space is not an administrator failure. It's usually budget issue. And are you saying that making apps bloated (like severely bloated) is ok and the user should always be blamed for having lower hardware?

-2
sh.itjust.works

And LVM is more than good enough for occasional snapshots before a major upgrade.

9

Well lvm makes a shit filesystem and btrfs is useless at volume management.

11

LVM creates "block devices" and is FS agnostic. You can install btrfs on an LVM volume if you wanted. Or any other FS for that matter.

But since it doesn't know anything about the FS it can be a bit more cumbersome to modify volumes (especially when shrinking).

2
lemmy.ml

Good that you mentioned that. Reminded me that I have an Arch Linux install here where I forgot that I did choose BTRFS during installation. Within maybe a month I noticed FS errors. Looked scary. Nervously searching for documentation was even more scary :

https://wiki.archlinux.org/title/btrfs#btrfs_check -> This article or section is out of date. (Discuss in Talk:Btrfs) Warning: Since Btrfs is under heavy development, especially the btrfs check command, it is highly recommended to create a backup and consult btrfs-check(8) before executing btrfs check with the --repair switch.

What is this? My beloved Arch Wiki is not 100% perfect!

Then found this :

WARNING: Using '--repair' can further damage a filesystem instead of helping if it can't fix your particular issue.

Warning

Do not use --repair unless you are advised to do so by a developer or an experienced user, and then only after having accepted that no fsck successfully repair all types of filesystem corruption. E.g. some other software or hardware bugs can fatally damage a volume.

I figure this explains the popularity of BTRFS snapshot configurations. Luckily I had some backups :)

7

Filesystem snapshots won't help, if the filesystem itself corrupts. But I've been using BTRFS for 6 years now and haven't had a file system corruption, so mileage may obviously vary.

3
lemmy.ca

In my opinion, it depends. If a distro has BTRFS configured to automatically take a snapshot when upgrading (like OpenSuse Tumbleweed), then BTRFS.

If not, for a beginner, ext4 + timeshift to take snapshots of your system in case an upgrade goes wrong will be fine.

44
slrpnk.net

But you can also just use BTRFS without any fancy setup and not use its features, it will still be faster.

0

Btrfs has many advantages over ext4, but being faster isn't one of them.

6
lemmy.world

Btrfs is slower than ext4, xfs, and f2fs in pretty much every metric. Noticeably slower app opening times is the reason I switched to F2FS for good.

1

Very interesting. I heard F2FS has no journalling, but afaik Fedora Atomic doesnt rely on it?

It might be worth looking into, as it beat many tests.

1
slrpnk.net

Edit: BTRFS has advantages that likely make it better for me.

It has compression and allows flexible partition sizes. The compression may explain the speed decreases.

1
lemmy.world

Compression might be useful in some cases, but the bulk of my data is already compressed or not much compressible (think videos, images, compressed archives, game assets). So the trade off doesn't make much sense to me.

1

That is true, not for Flatpaks but for sure.

I wonder how much of a pain it would be not having BTRFS subvolumes on atomic Fedora. Will try F2FS in a VM.

1

Mint doesn’t default to btrfs, but will use it if you so choose during install. And it integrates fantastically with Timeshift. I’ve set up daily and weekly snapshots and have peace of mind.

0

And it has repair tools that actually work and can make the filesystem usable again.

17
lemmy.zip

Until you pull the power at the wrong time. Its better to use Btrfs as others have said.

-7
blackstratreply
lemmy.fwgx.uk

But pulling the power on a btrfs drive at the wrong time results in you not even being able to mount it as read only. No snapshotting can help you there.

3

Especially just getting into linux. Ext4 works well enough, when you learn enough to care about what it doesn't do well try something then

4
lemmy.ml

As someone who ran BTRFS for years, I'm personally switching back to EXT4. Yes, the compression and other features are nice, but when things go wrong and you have to do a recovery, it's not worth the complexity

21
lemmy.zip

I've found it much easier and way more reliable. If I pull out the power on ext4 it is likely to cause corruption and sometimes you can't fix it.

Btrfs is pretty much impossible to completely corrupt. I've had drives fail and I didn't lose anything

11

Lemme say this - While complex, I can vouch for recovering files on BTRFS. I can't vouch for recovering files on ext4, because I never had to.

24
lemmy.ml

When booting into a live CD, mounting the various subpartitions is super annoying.

When your disk space hits full, things break uncontrollably because different programs don't have a consistent measurement of how much space is left.

When shrinking partitions, you can lose data if you shrink it too much. I'm not talking about forced overrides of any configs, I'm talking about things like KDE Partition Manager.

All of these things can be excused one way or another, but at the end of the day I just want a stable filesystem that doesn't lose my docs.

9

Ah yes, the free space calculation stuff is still a mess.

Overall, I've been daily-driving btrfs on some system and it's been treating me well. But yeah, they still got a long way to go.

4
infosec.pub

Btrfs. Just format as one big partition (besides that little EFI partition of course) and don't worry about splitting up your disk into root and home. Put home on its own subvolume so that root can be rolled back separately from it. You can have automatic snapshots, low-overhead compression, deduplication, incremental backups. Any filesystem can fsck its own metadata, but btrfs is one of the few that also cares if your data is also intact.

20

It cares so much that when it goes wrong you can't even mount the partitions as readonly to try get your data back. It will stubbornly hold on to it and refuse any access at all. Boy I am so glad it didn't let me access a potentially corrupted byte somewhere!

1

btrfs every day of the week. The only scenario where I'd even consider something else is for databases that would suffer from CoW.

I've been running it on my home server since 2010. The same array has grown from 6x2TB to 6x4TB, one disk at a time as they've failed. Currently sitting at 2x18TB+1x4TB. No data loss even though many drives have failed.

18
joel_feilareply
lemmy.world

Umm correct if um wrong but cant you make a snapshot of ant file system

1

I personally use ext4 everywhere but it is recommend to have BTRFS for your OS partition if you take snapshots often.

13
lemmy.ml

How about bcachefs. I'm waiting for it to support swapfiles, which seems to be in the TODO list, but so far doesn't work. If you use swap partition[s], or prefer not to have swap at all (I never fell for this, and besides swap is required for hibernation if that's a thing for you), then bcachefs is ready for you. It's already part of linux since 6.7, and on Artix, current linux is 6.8.9...

To me is the FS to use. I'm still on luks + ext4 (no LVM) and do entire home backups with plain rsync to an external device. I'd have to learn new stuff, since ext4 is really basic and easy to configure if in need, but I think bcachefs is worth it, and as mentioned, just waiting for it to support swapfiles, :)

12

Thank you for sharing this. I didn't know this FS yet. It seems new and have some nice goals. I always have a grudge against zfs/btrfs because of the resource usage/performance.

I'll keep an eye on this. I'd love to find some benchmarks.

2

Not yet, but bcachefs will be the future as the goals replicate most of OpenZFS while not having that licencing issue.

1

Ext4 for most home users, because it's simple and intuitive. Btrfs for anyone who has important data or wants to geek out about file systems. It's got some really cool features, but to actually use most of them you'll have to do some learning.

12
lemmy.ca

Ok but please explain subvolumes, the information has failed to latch onto my brain

4
cmnyboreply
discuss.tchncs.de

Subvolumes are somewhat like a partition, but they don't have fixed size. What they allow you to do is take snapshots. Snapshots are used to backup and restore the subvolume. They can be created instantly and don't take up any space until something is changed.

4
lemmy.ca

If I'm trying to install Linux with BTRFS, and it doesn't work, what are some of the most likely mistakes I've made?

2

What distro? Some installers will set everything up for you and others you have to setup subvolumes manually.

3
swg-empire.de

Just go with whatever is the default of your distribution.

That said I've come to love the automatic snapshots OpenSUSE gives me with BTRFS. I think they use snapper to automate that. It does a snapshot before and after every packet install, update or removal. And it has some system to delete snapshots that aren't needed anymore but it always keeps enough to give you peace of mind, especially when you're experimenting.

I should look into keeping some snapshots of my ~ as well. And I should implement that especially for my family.

11

Snapper is life saver. I don't get it why nobody else use it by default, it's so great. It saved me many times. My coworker, who happens to be kind of non-linux user forced there by MS bullshit, uses Ubuntu and she's got to problems so many times, and all those would be couple clicks repair with Snapper...

3

Btrfs. It was the default filesystem already when I used Fedora on both my personal and work laptops. Not a single problem. It is true I don't really make much use of most of its advanced features like snapshotting, CoW, etc., but I also didn't notice any difference whatsoever in stability compared to ext4 so I'm pretty happy with it as my new default.

11

I prefer using ext4 for stability. But if stability doesn't matter to you, you should use BTRFS.

10

For standard use, ext4. If you want to tinker and use fancy features, btrfs (or maybe zfs?).

10

Do what OpenSUSE Tumbleweed suggests, make a brtfs partition for your system and xfs/ext4 for home parition

8
lemmy.world

I’ve been very happy with btrfs. Ext4 is basically rock solid, so you can’t really go wrong with it, but btrfs has some nice features that ext4 doesn’t have, like snapshots. And it’s fast. I have an extremely cheap SSD that’s too slow to run anything with ext4, but actually usable with btrfs.

8
lemmy.world

Btrfs or XFS.

No idea why people are into EXT4. XFS is more performant by far.

6

I agree that’s why most of my systems run btrfs. (Maybe soon bcachefs).

But XFS is in the same tier of “datedness” as EXT4, just with more performance. Some apps like ScyllaDB actually require XFS performance crazily enough.

4
lemm.ee

I love zfs. Started using it for my data storage pool and now I have it on root as well. It has some rough edges but overall it is very stable and has amazing features.

6

ZFS is amazing but i wish it's support for flash was better. I'm not sure if ZFS will ever be able to fully utilize flash since ZFS was designed around spinning disks and the pitfalls they provide. Maybe at some point F2FS will catch on...

1

Ext4 is, afaik, the fastest as it's the most understood

Btrfs has compression and you can make snapshots to roll back to if something goes wrong (not necessary on immutable distros or NixOS tho)

There are many other options, but I've only ever had a need for those two

6
refreezereply
lemmy.world

btrfs snapshots are still useful on immutable distros to recover accidentally deleted data.

3

If you don't care any will do. ext4 is fine but check the "use LVM" button during install if you do go with ext4 since it will give you better partitioning options later.

6
pastermilreply
sh.itjust.works

How's F2FS been treating you? I've been wanting to get into that. Also, why not for your rootfs?

2

I haven't had any issues with it so far, but I like having snapshots incase I need to rollback an update or something so that's why BTRFS.

1

XFS. It fills the same role as ext4 but it's less likely to lose your data and that's probably the most important part of a file system. Not that ext4 is bad or anything, but XFS is good. The only downside to XFS is you can't shrink the filesystem size.

5

agreed. EXT4 for system, XFS for everything else (mostly large VM image files). when XFS is properly configured for the underlying drive array geometry, its a nearly perfect streamlined FS.

1
lemmy.world

I don't know what's the brand neW meta pick, but at least BTRFS over Ext4. BTRFS is just more stable and less corruptable than Ext4. Heck, fedora changed to it as default

5
8osm3rkareply
lemmy.world

To be fair, Fedora switching to something as default isn't a good sign that you should start using it. I do agree, though, btrfs has come far enough to be a default choice for most people.

3
swoooshreply
lemmy.world

What did fedora adopt that wasn't a good choice in hindsight?

2
sh.itjust.works

I always go LVM + BTRFS these days. I simply love the versatility.

EDIT: DO NOT DO THIS LMAO, JUST USE BTRFS, I AM SO STUPID

4
refreezereply
lemmy.world

I'm curious, why do you use LVM with BTRFS and not just use BTRFS built in subvolumes?

2

Because I'm stupid and like to run my partitions across multiple drives. 😅

2

Uff, somehow missed your post. See mine. That's the FS I'm hoping to use next. I'm waiting for it to support swapfile, or alternatively read from official sources they won't ever support it, :). But yes, that's the one I'm looking forward to use.

1
lemmy.world

Well since so many people recommend btrfs because "it have never lost any data for me". I want to suggest OP to never use btrfs ever. Because it has lost my data, at least three separate times, the most recent time a week ago. And it's not because of a power loss or anything, it just corrupted my files for absolutely no reason at all.

Stay away from btrfs at all costs.

4

"It's never lost data for me. Yet" is what they mean.

I totally agree, the only file system I've lost data with as a result of a file system corruption not caused by hardware errors or power problems in 35 years has been btrfs. FAT even served me better.

2

FS is for nubz, do these instead:

Read

dd if=/dev/sda of=/dev/stdout

Write

dd if=/dev/stdin of=/dev/sda
2

I like btrfs but only cause it got transparent compression. I don't need the extra disk space and it only helps a bit but I just think it's neat

2
lemm.ee

BTRFS for the OS partitions, ext4 for /home, tmpfs for /tmp. I rarely need to use snapshots, but I do use a rolling release. It's one of those things you don't need until you really fucking NEED it. Tumbleweed support is great - I can roll back a bad update in about as long as it takes to reboot.

2

This is exactly how and what Im using.

Home and other ext4 are backed up one form or another on by NAS.

1
lemmy.ml

I prefer ext4 on HDD and f2fs on flash devices.

1
Scribbdreply
feddit.nl

Also taking f2fs for a spin.

As far as I have experienced (I didn't measure this): don't use that partition for container layers. It might just be my system, but f2fs has slowed my container engine down a bit.

1
Samsyreply
lemmy.ml

I excactly doing this. I run coreOS with f2fs and it runs really fast. No issues so far.

2

Totally accepting it is my system being slow. It is a openwrt router after all.

1

BTRFS is not more performant than EXT4.

I personally dont use any features of BTRFS manually though, as Fedora Kinoite does that for me.

-5
atzanteolreply
sh.itjust.works

Note that ext4 is damn old and thus also not as performant as more modern ones like btrfs or bcachefs

This is not true. BTRFS has more features but ext4 is very performant. They're both similar enough that I promise you that you wouldn't notice unless you had some very specific use-case that needed to be performance tuned.

What do you think "being old" has to do with performance?

9
slrpnk.net

What do you think "being old" has to do with performance?

Being tailored to NVMEs or SATA SSDs instead of to HDDs and similar. But I am not sure about which one would be better here.

Phoronix Benchmark so we have something to look at

BTRFS seems to be better at multithreading, being outperformed by F2FS (which I forgot to mention, it is used on Android and I would call that damn stable).

Actually, F2FS seems to be a really good replacement for EXT4, being top in most tests, while having no journaling, while BTRFS in fact worked pretty badly!

-1

Note that ext4 is damn old

Hmm ? Linux kernel is way older than ext4. And before ext4 there was ext3 and ext2. Linux users also have the choice of using XFS file system and for IT persons working for corporations XFS can have some advantages. Let's see, XFS was born in 1993.

more modern ones like btrfs or bcachefs

Years ago I thought that bcachecfs looked interesting but last thing I read about it this year was not very promising regarding reliability. Not sure whether it was in comments on Lemmy but here I found something from Linus himself : https://en.wikipedia.org/wiki/Bcachefs#Stability

3

Exactly especially when the default file system on windows is 30 years old.

2
Björnreply
swg-empire.de

NTFS can't handle Linux file permissions. It is not suited as a system drive.

And supposedly it can give you problems if you use it to store your Steam games. I never cared to test that, though.

12