Btrfs To use it or not to use it? [Personal experience]

It occurred to me to make a post about Btrfs, a filesystem that in the future is supposed to replace ext4, which for now has been the fastest and most used, in addition to its defragmentation is almost nil, unless you have a disk with more than 95% full space.

Btrfs

But what does Btrfs plan to improve on then?

Btrfs is a filesystem developed by Oracle, Involving Red Hat, SUSE, Intel, among other. In this regard, it should be noted that SUSE is putting special emphasis on the fact that it is ready for use in the business area, and it is already offered as a default in its SUSE Enterprise distribution.
Why so much emphasis on its use? This is due to many improvements that Btrfs brings, many of which are totally original and are very innovative in the area of ​​file systems. Btrfs it is a file system copy-on-write« looking for stability, even if something goes wrong, and ease of system repair and administration.

The main Btrfs features available at the moment are:

  • Extension based file storage
  • 2 ^ 64 bytes == 16 EiB maximum file size
  • Efficient small file packing space
  • Space efficient indexed directories
  • Dynamic inode allocation
  • Write snapshots, read-only snapshots
  • Subvolumes (separate internal file system roots)
  • Checksums on data and metadata (CRC32C)
  • Compression (zlib and LZO)
  • Multiple embedded device support
  • File splitting, mirroring, file striping + mirroring, striping with single and double file parity implementations
  • SSD (Flash Storage) awareness (TRIM / Discard to report free blocks for reuse) and optimizations (for example, avoiding unnecessary search optimizations, sending writes in groups, even if they are from unrelated files. This results in larger write operations and faster write performance)
  • Efficient incremental backup
  • Background erasure process to find and correct errors in files with redundant copies
  • Online file system defragmentation
  • Offline file system check
  • Converting existing ext3 / 4 file systems
  • Seed devices. Create a (readonly) file system that acts as a template for seeding other Btrfs file systems. The original filesystem and devices are included as a read-only starting point for the new filesystem. Using copy-on-write, all modifications are stored on different devices, the original is unchanged.
  • Subvolume quota support -aware
  • Sending / receiving subvolume changes
  • Effective Incremental File System Mirroring
  • Batch, or out-of-band, deduplication (which happens after writes, not during)

Additional features in development or in development project:

  • No very fast filesystem connection check
  • Object level mirroring and striping
  • Alternative Checksum Algorithms
  • Online file system check
  • Other compression methods (fast, LZ4)
  • Tracking hot data and moving to faster devices (currently being pushed as a generic feature available through VFS)
  • In-band deduplication (occurs during writes)

It should be clarified that Btrfs is already considered stable and that there are not many changes planned in the future, unless there are very good reasons to do so. However, they try to improve the speed of Btrfs with each new Linux kernel, so it is recommended to have always the latest installed kernel and the latest version of your GNU / Linux distribution.

Also, it is recommended for especially large drives, which is where btrfs innovates the most and its benefits can be felt. In addition, it has support for So if you have SSDs I think you will notice an improvement over ext4 as ext4 still uses somewhat old technologies.

My personal experience

My favorite distro is OpenSUSE and it's the one I use on my netbook from 2011, so I formatted the partition with btrfs to test it, and the truth is that it worked slower on my netbook than with ext4. It took longer to start the computer and I felt more stuck, although I think it copies files faster. They may think I was biased, but I took the response times to be sure and they were slower and the system really felt more stuck.

My conclusions

Btrfs is already considered stable, they clarified it on their official page, so:

  • If you have a slightly old PC, stick with ext4
  • If you have something newer with SSD, use btrfs.
  • Keep in mind that they plan to improve their integration with each new Linux kernel, so in the future it may be a good idea to give it a try, so even if they have old hardware now, their speed may exceed ext4 in the future, but this moment, at least, it is not recommended.

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   ArthurShelby said

    It would be necessary to do tests on an ultrabook with SSD, to really say if its performance is superior, since even if it is "assumed" that it will be more powerful in hardware just by mere "theory" it would be pulling our desire for discovery. For their part, the Phoronix people had done tests: http://www.phoronix.com/scan.php?page=article&item=btrfs_linux31_ssd&num=1

  2.   eliotime3000 said

    The truth is that it is a good alternative to EXT4, which, despite being the best alternative to NTFS (for me, the most infamous), it used to leave me with a feeling that it lacked a little more for it to have better performance .

    Anyway, I hope that in the next Debian version it will be available.

    PS: I am using Lynx because I am solving a problem with the Intel video driver that I have installed on my desktop with Debian.

  3.   msx said

    Xubuntu 14.04 on Btrfs: for some operations it is a little slower than ext4 - and ext4 _is slow_, although not as much as NTFS sweet potato.

    Furthermore, Btrfs is not a filesystem as we are used to, it is a universe in itself, if you are not going to read the wiki in detail, do not install it, it will be for headaches (for example tools like df [dfc] or du [ cdu] do not work correctly in Btrfs and you have to use your own tools).

    In my case I finally opted for Btrfs since having Wincrap installed is difficult to use LVM, you can but you have to do magic by hand I wanted to have my penguin running as soon as possible.
    If you don't have Winbosta installed, LVM + ext4 is a fabulous combination: the flexibility and security of using LVM with a file system that keeps improving - and the gilada fought it so hard at the time ...

    1.    eliotime3000 said

      In my case, the problem is not exactly the NTFS, but rather the Windows Vista interface itself.

    2.    joakoej said

      Thanks for the comment. I've never used LVM and I guess I won't, but it's nice to know these things. By the way, what improvement is using LVM?

      1.    msx said

        Btrfs is a filesystem. LVM is a partitioning system. There is a complete article on Wikipedia.

    3.    dhunter said

      The same in my case, I have noticed very slow btrfs, I prefer ext4.

      1.    taregon said

        It's true, it happened to me, I wanted to experiment and I noticed it very slowly.

  4.   Sausl said

    ext4 has not given me problems so far
    I have dual boot therefore the other partitions in ntfs
    and the truth is I do not notice differences with ntfs
    for now I am not to experiment with file systems

    1.    eliotime3000 said

      We are in the same situation when it comes to file system experimentation.

  5.   konqueror3 said

    Currently I use Debian Lenny with reiserfs 3.6 file system on my desktop PC, as it is already too obsolete I started testing (on another disk) with Debian Wheezy. Since reiserfs is no longer available to be used in the installation (although it is possible to install the system on a partition previously formatted with reiserfs), I did tests with btrfs, ext4 and xfs, in addition to reiserfs with the aforementioned method. From the tests done, the most relevant thing I observed was that both with ext4, reiserfs and xfs the performance was almost the same, perhaps with the perception of a little faster when using xfs, but it was definitely much slower when using btrfs, in fact only installation took about three times as long on this file system. Also, as expected with ext4, approximately 5% of usable space is lost when partitioning, so I never considered any ext * a good option. Since I installed my first distro (Suse Linux 6.4) on a PC with a 20 Gb disk I used reiserfs ( back then it was experimental). It is necessary to mention the disadvantage of reiserfs, apart from the fact that it no longer has active development and support, it is the long time it takes to mount, being more noticeable the larger the partition. Regarding xfs, the disadvantage I found is that it cannot be resized ...
    Looking for information on the Internet about file systems available to replace reiserfs I read some articles in which they pointed to xfs since it has a good design and active development and is updated to take advantage of modern multi-core processors, in addition that Red Hat has set its sights on this file system.
    Anyway, for the moment, I consider xfs the best alternative, at least on the desktop, to reiserfs (above ext * and btrfs).

    1.    joakoej said

      Great info, it seems that xfs is a very good alternative, although I tend to resize the disk quite a bit, so I don't know if I would use it, but I will definitely try it.

      1.    msx said

        Not so great the info, check my answer.

    2.    msx said

      Your appreciation about the performance of Btrfs is distorted I suppose that due to lack of knowledge.

      Wheezy uses kernel 3.2 which by today's standards is quasi Paleolithic.
      Like so many other technologies in Linux, the bulk of Btrfs is found in the same kernel and not in the user apps, so there have been countless incorporations of features and bugfixes from the kernel that uses 'the old one' to the kernel that we use today in the rest of modern distros (3.12,3.13 and 3.14).

      On Xubuntu 14.04 (kernels 3.13 and 3.14-pf) and ChakraOS (kernel 3.12.6) Btrfs runs flawlessly if not faster than ext4. The only penalty it has in terms of literacy speed is in intensive database operations - documented to death.

      1.    konqueror3 said

        It is true that with the most recent versions of linux the drivers for btrfs must have received countless additions of features and bugfixes, but that would also be true for xfs.
        Although although I lack technical and deep knowledge about file systems, linux drivers, and others ... Apart from the fact that years ago I stopped trying and experimenting with all distro and new programs that crossed my path (good times!), Test of that is, I still use Debian Lenny! hehe! That is why I have not yet made the jump from distro until my research and tests on the file system that I will use in replacement of reiserfs have finished; that at the moment the number one candidate is xfs. I also believe that I have sufficient criteria and ability to choose what I think would be the best that suits my needs, which are close to those of any common user of a home PC ...
        I leave the link to an interesting article titled: Red Hat thinks XFS is a better file system than Ext4. Of which I highlight a sentence that gives an idea of ​​why btrfs could be slower than xfs: ... Making redundant copies of metadata, for example, gives security, but writing the same data twice to disk will always be slower than not do what…
        Link to article: http://diegocg.blogspot.com.ar/2013/06/red-hat-xfs-es-mejor-sistema-de.html

        1.    msx said

          "It is true that with the latest versions of linux the drivers for btrfs must have received countless additions of features and bugfixes, but that would also be true for xfs."

          Wrong syllogism: "It is true that my Dalmatian dog has 4 legs and 1 tail, it should be true then that all dogs with four legs and one tail are white and spotty."

          Do you follow the development of XFS? Not me, but I would dare to say that it is nowhere near the development speed of Btrfs. In fact ... it has current development, or only bugfixes? Years can pass, eternity if you want and performance will not improve if there is no one behind to elbow 😀

          I absolutely understand your pain when having to abandon ReiserFS, one of the best filesystems of all time, a shame that they do not allow it to continue developing ...
          Regarding your need to look for a new file system, I recommend the LVM + ext4 combo, Btrfs is too alien, you have to read a lot to use it correctly and exploit it to its maximum potential, it is certainly not an "install and forget" technology as well Manuel explains in his link, which entails extra work to maintain.

          If you don't have Wincrap installed, LVM + ext4 is glorious. In fact Btrfs is intended a bit to supplant the need for the LVM + X file system.

          As for Debian, you may want to try Tanglu (mentioned here in DL), Semplice (stabilized Sid) or any of the new distros that try to upgrade a clean, base Debian to today's uses and technologies.

          Greetings.

  6.   jorgejhms said

    For me it convinced me when I tried Gnome Documents. With ext4, searching for documents took centuries. With btrfs it was an instant operation.

  7.   Synflag said

    I used it with fedora 16 and did not notice any changes. Back then it was considered unstable so I kept my lifelong ext4

  8.   Manuel Escudero said

    BTRFS is an excellent file system, among the advantages that I have noticed is more speed in my computers (using the partition / under BTRFS) on the servers, greater tolerance to faults that cause data corruption (Under Ext4 if you turn off a server that is running a MongoDB daemon the database requires that you reactivate it manually by deleting the file «/var/lib/mongodb/mongod.lock» and restarting the mongod daemon, under BTRFS this does not happen due to its CoW structure and others Goodies). In addition to the ability to "revive" damaged hard drives (Obviously they previously had Windows NTFS and end so badly that they do not accept Linux installation with Ext4 without fail).

    THE PROBLEM is that BTRFS is not a file system that works "out of the box" for the user like ExtX, which does not need further maintenance or optimizations. I've been using BTRFS in production since Fedora 15 (I'm on Fedora 20 right now), and over time I've noticed a lot of things that are required to make it work well, including the maintenance processes that I explain in this article:

    http://xenodesystems.blogspot.com/2014/05/btrfs-maintenance-and-other-tips.html

    (With which, among many other things, the usual fragmentation that this system entails is avoided)

    and I also discovered that being a CoW filesystem everything is "location, location, location." You see, BTRFS is great for the / partition by its nature and file access profile, but if you put it on a / home partition and then expect to run for example something that does back-to-back writes to the hard drive (like a running virtual machine whose "hard disk" is in said / home btrfs) the system simply freezes because the CoW is not made for that type of operation (although it is working on it) ...

    At the end of the day, I think it is because of these things that we still do not see it as the "default default" of most distros yet, since these things are points to work without a doubt.

    1.    joakoej said

      Great info, yes I added those advantages in the post, but I am a home user (so to speak), those options do not matter too much to me nor am I sure how they work at all, so I kept the one that worked best for me. Although, I will also test xfs for what they said above.

  9.   Alejandro said

    xfs

  10.   Alex said

    For SSD I would bet on f2fs

  11.   Jorge said

    I have heard good references to btrfs, and the problem to switch (if I wanted to), is having to format EVERYTHING, and since I have too much information, I would have problems backing it up ._.

    And good that it was already stable, although I do not know if for all distros (here in Gentoo the case has not been discussed). In the meantime, I'm sticking with ext4 for issues of habit and stability.

    And I have no dramas with finding files, and I have a hard time indexing to speed up searches, due to the hard disk space it takes: /

    I'd try btrfs when it's more massive and find how to back up for the while (and also when you have a bigger hard drive :)

    1.    joakoej said

      Hello, it is considered stable for its developers more than anything, in other distros, other than SUSE or Fedora, nor is it discussed, although SUSE has already adopted it as I said above.

      1.    Jorge said

        Mmm now I understand. I'll wait for later then. Thanks 😀

    2.    msx said

      No, you don't have to format everything. The extX partitions are transparently migrated to Btrfs with the advantage of reverting the changes (that is, going back to your old filesystem) if you wish.

      1.    Jorge said

        Nice to know. I'll wait for Btrfs to have as much support as ext4 and to be as massive as ext4 is now. And thanks, it leaves me calmer when it comes to wanting to mess with that file system 😀

  12.   Yoyo said

    I have BTRFS in my SSD both in KaOS and Antergos, for now I have not noticed anything strange, that is, I have the fstab conditioning.

    I leave them in case it helps someone.

    UUID = xxxxacaminumeroxxxxxx / btrfs defaults, rw, noatime, compress = lzo, ssd, space_cache, inode_cache 0 0

    I only have btrfs in / root, neither use separate / home nor swap

    1.    msx said

      Check the link posted by @Manuel to add optimizations to your SSD.

      1.    Gabrielix said

        XFS continues in development and includes improvements in the new kernels, set the delaylog option.

  13.   tabris said

    Did you use machine translation in the advantages? because it is written very strange.

    1.    joakoej said

      What is that machine translation? A wordpress option?

  14.   Cristianhcd said

    I'm still stuck on ext3

  15.   Sephiroth said

    Until I exceed ext4 in speed (according to the tests I read, it is quite a long way off yet) I find no reason to switch.

    1.    sieg84 said

      That is not the goal of Btrfs

  16.   Nonamed said

    but is it free?

    1.    msx said

      And ... if it is part of the kernel ...

  17.   George said

    Leave me with ext4 which is going very well even though I have a very new machine with ssd. 🙂

  18.   Ezequiel Ortiz Rossner said

    I use XFS since Ubuntu 10.04 and for me it is the best that works!

  19.   Jon burrows said

    Btrfs still has a way to go.

    Meanwhile, XFS is your friend.

  20.   Carlos said

    Using compression, with kernel 3.12.x, the whole file system gets corrupted after heavy disk writing. Warned…

  21.   jose perez said

    I am thinking a lot about which filesystem to use. I don't know whether to use BTRFS, ZFS or XFS. Now after reading the article whose link, below these words attached, I think I'm going to start using btrfs.

    http://libuntu.com/marc-merlin-de-google-habla-sobre-las-ventajas-de-btrfs-y-las-desventajas-de-zfs/

    1.    Yo said

      ZFS on GNU / Linux? Good luck, I just kept thinking.

      1.    Dago said

        You don't have to think much 😉
        https://clusterhq.com/blog/state-zfs-on-linux/

  22.   Francisco said

    I recently bought a Pavillion laptop AMD A8 processor, 8 GB ram with factory installed windows 8.1, I also bought a 160 GB SSD disk and proceeded to install Ubuntu 14.04 LTS on the SSD via external usb connection (I use the SSD disk externally to the computer so as not to touch anything inside the laptop), for the Ubuntu installation I chose the automatic installation, everything went perfect, even without doing any other operation after the installation, when I turn on the computer automatically a menu appears that It offers the option to boot either with Ubuntu or with Windows, I had never actually tried Ubuntu on a modestly modern computer and with an SSD disk, it does not run, it flies, however I was curious to see what the performance of Ubuntu would be partitioning with Btrfs, I don't have very deep computer skills but I have been using Ubuntu for some time and I like to tinker and try different partitioning options to compare results, for The more I look on the web I don't see a complete tutorial that allows making advanced partitions in linux using SSD disk, if you have any advice in this regard, I appreciate your attention in advance ... haaa ... by the way, congratulations ... Good article.

  23.   Carlos said

    Good morning everyone, I have been looking for an appropriate file system to handle large files, specifically video files. Should I prepare an exclusive partition for them with the XFS format? I currently use ext4, but of course, I have files of all kinds in my / home.

    In this partition basically it would only be to read files.

    I use a Lenovo ideapad s400touch laptop with ubuntu 14.01 and 4 partitions, / boot, swap, / and / home.

    Greetings and thanks for reading me.

  24.   Juan Carlos Sandoval placeholder image said

    Goodnight everyone. I have a production machine with an SSD disk on which I mount OpenSUSE with btrfs. Its features are quite cheering and it is actually very fast for server shutdown and startup processes. On this file system lay the production database of my business, but I had to reinstall my equipment again, because it did not support a power failure and this was the only file system that was corrupted. I was unable to retrieve the file system to make it mountable. With the btrfs restore utility I managed to obtain the database, but nevertheless, it was already corrupted and it was not possible to recover it with the firebird own utilities. The truth was that it caused me a big problem because sales records were lost for a whole half day (that's a lot of records), inventory problems, etc. I do not recommend it for production ultimately.

  25.   pepper said

    Hello everyone, I am using Xubuntu 14.04.01 LTS since it came out and it encourages me to change the ext4. For me / I use btrfs and for / home I use xfs and the truth ... simply excellent, even with xfs the copying of large files is done faster than when I used ext4. I don't understand anything about file systems, but the truth is, I was encouraged to try and I'm very happy with the result, I don't know what will happen later. 🙂

    1.    felix said

      Hello

      I just ran into the problem that I had an oracle linux (redhat) server with LVM. I had a 7gig FS btrfs where I mounted everything / and then another 2G for swap. The fact is that it was petado and yet there was a lot of unused disc.

      I have taken and unmounted the swap and loaded the logical volume of the swap. Then I have created a partition with fdisk with the rest of the available unused space and a physical volume of this and added it to the volume group. And finally I have expanded the VL where the btrfs file system is (mounted EVERYTHING in /) and I have created a new VL for the swap renaming the same so as not to have to touch the / etc / fstab (law of least effort).

      So far nothing unusual for those who know how to use LVM. Using the display commands I could see my 2 VLs (root and swap) and the root one already had the space I needed. But of course when doing a df -h we continue to see the old capacity of the FS (7gigas). So I went to do a resize2fs and that's when (after the error message) I found that the FS was btrfs and I had to go to the internet to find info. I have looked for the commands to do a hot resize (anything that is increasing size is not usually necessary to dismount).

      #btrfs filesystem resize + 10G /

      That has been the command used. And I can say that it turned out perfect. At that time I have done a df -h again and the new capacity was coming out. All this has been on the root FS (/) and all hot from that same server. Without having to start any livecd or anything.

      In conclusion, everything is correct. btrfs and LVM take mother dp.

      Bye.

  26.   Abkrim mateos said

    One of many supposedly technical articles that distort the technical universe and that in the end are nothing more than "comments and personal appreciations." There are no objective data, and instead there is «I think» «I did tests (whose data is not published» ...
    On the other hand, the used distro and its kernel more than outdated, are not the reliable proof of anything.

    1.    hey said

      Also, he hasn't even bothered to translate the copy paste about the BTRF features well. Anyway, the typical «article», being very generous, made to win visits ...

  27.   Francis Rivarola said

    Hello everyone.
    First of all, what Mr. Mateos says is true, everything is based on experiences and readings from "out there", but it is true that everything works, few would understand such technical data.
    Regarding the fs, I use openSUSE from the beginning, I tested how many distro crossed my path, in a not very powerful netbook, 4GB ram and cpu celeron 1.6 Ghz x2. Since version 13.2, partitioning with btrfs in / and xfs in / home is default. SUSE did it and for a reason it is. The truth is that it works great, no other distro works like openSUSE, the search speed on desktop is immediate, copied, cut, pasted everything is fast, more than in debian and derivatives, (the truth is that I still do not understand how Linux users use ubuntu) .
    I installed ubuntu with ext4 and then btrfs and the latter was better, I don't know why, but it was.
    Continuing with btrfs, SUSE and company use it by default because they incorporate snapshots for recovery, without having to be an expert to recover in case of disaster.
    The truth is, there is nothing better than openSUSE, and not to stay at 13.1 just for evergreen, the changes to 13.2 are incredible. I would not recommend or use anything other than the chameleon distro.
    Greetings to all and… HAVE A LOT OF FUN !!

  28.   Olivier said

    I have used the btrfs file system for a microsd and it has been impossible to format it later, after having used countless formatting systems. A bad experience, although the system seems promising, especially for ssd disks, as long as problems like the one that happened to me are overcome.