18

btrfs (often pronounced "better fs") has quite a few features that ext4 lacks.

However, comparing the functionality of btrfs vs ext4, what is lacking in btrfs?1

In other words, what can I do with ext4 that I can't with btrfs?

1 Ignoring the lesser battle-ground testing of btrfs given ext4 is so widely used

  • 3
    "Better" and "worse" are always relative to a purpose. So, from what point of view do you want to compare them? – Satō Katsura May 10 '17 at 11:12
  • I would argue also at which point btrfs is mature enough and if it is a wise decision SuSE using it on production systems as the default, but them we are entering the off-topic realm; nevertheless, both answers to this question are pretty interesting. Tom, could you somewhat try to rework the question for it not to be closed as too broad or off-topic? – Rui F Ribeiro May 10 '17 at 12:38
  • 1
    My first thought is "swap files" – Dmitry Kudriavtsev May 10 '17 at 15:48
  • I think you meant that ext4 is "widely", not "wildly" used. But I like "wildly" better. 😁 – Alex D May 11 '17 at 9:53
  • A reliable fsck. – Martin Schröder May 18 '17 at 22:48
29

Disadvantages of btrfs compared to ext4:

  1. btrfs doesn't support badblocks

    This means that if you've run out of spare non-addressable sectors that the HDD firmware keeps to cover for a limited number of failures, there is no way to mark blocks bad and avoid them at the filesystem level.

  2. Swap files are only supported via a loopback device, which complicates things because it seems impossible to resume from suspend using this method

  3. It's quite tricky to calculate free space, so much so that...

  4. You can get "No space left on device" errors even though btrfs' own tools say there is space

  • 1
    I put btrfs on my daughter's computer and number 4 has been a real pain. I do not recommend btrfs for anyone that doesn't know what they are getting in to. – David Baucum May 11 '17 at 0:11
  • Why would you want to use it on a computer? – Freedo May 11 '17 at 9:13
  • @DavidBaucum Fully agree on "look before you leap". My preference is to use compression and store more data and run the occasional btrfs balance. One can always do dd if=/dev/urandom of=file; ls -lh file; rm file to know what's usable, if you can wear a momentary No space left on device. – Tom Hale May 11 '17 at 13:31
16

A major disadvantage (especially in regards to Ubuntu switching to swap files on new installations) is that butter FS (as I like to pronounce it) does not support swapping files, see FAQ - Does btrfs support swap files? | btrfs Wiki :

Does btrfs support swap files?

Currently no. Just making a file NOCOW does not help, swap file support relies on one function that btrfs intentionally does not implement due to potential corruptions. The swap implementation used to rely on some assumptions which may not hold in btrfs, like block numbers in the swap file while btrfs has a different block number mapping in case of multiple devices. There is a new API that could be used to port swap to btrfs; for more details have a look at project ideas#Swap file support.

A workaround, albeit with poor performance, is to mount a swap file via a loop device.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.