Choose between Btrfs and LVM-ext4

Photo by Raul Petri on Unsplash

Fedora 33 introduced a new default filesystem in desktop variants, Btrfs. After years of Fedora using ext4 on top of Logical Volume Manager (LVM) volumes, this is a big shift. Changing the default file system requires compelling reasons. While Btrfs is an exciting next-generation file system, ext4 on LVM is well established and stable. This guide aims to explore the high-level features of each and make it easier to choose between Btrfs and LVM-ext4.

In summary

The simplest advice is to stick with the defaults. A fresh Fedora 33 install defaults to Btrfs and upgrading a previous Fedora release continues to use whatever was initially installed, typically LVM-ext4. For an existing Fedora user, the cleanest way to get Btrfs is with a fresh install. However, a fresh install is much more disruptive than a simple upgrade. Unless there is a specific need, this disruption could be unnecessary. The Fedora development team carefully considered both defaults, so be confident with either choice.

What about all the other file systems?

There are a large number of file systems for Linux systems. The number explodes after adding in combinations of volume managers, encryption methods, and storage mechanisms . So why focus on Btrfs and LVM-ext4? For the Fedora audience these two setups are likely to be the most common. Ext4 on top of LVM became the default disk layout in Fedora 11, and ext3 on top of LVM came before that.

Now that Btrfs is the default for Fedora 33, the vast majority of existing users will be looking at whether they should stay where they are or make the jump forward. Faced with a fresh Fedora 33 install, experienced Linux users may wonder whether to use this new file system or fall back to what they are familiar with. So out of the wide field of possible storage options, many Fedora users will wonder how to choose between Btrfs and LVM-ext4.

Commonalities

Despite core differences between the two setups, Btrfs and LVM-ext4 actually have a lot in common. Both are mature and well-tested storage technologies. LVM has been in continuous use since the early days of Fedora Core and ext4 became the default in 2009 with Fedora 11. Btrfs merged into the mainline Linux kernel in 2009 and Facebook uses it widely. SUSE Linux Enterprise 12 made it the default in 2014. So there is plenty of production run time there as well.

Both systems do a great job preventing file system corruption due to unexpected power outages, even though the way they accomplish it is different. Supported configurations include single drive setups as well as spanning multiple devices, and both are capable of creating nearly instant snapshots. A variety of tools exist to help manage either system, both with the command line and graphical interfaces. Either solution works equally well on home desktops and on high-end servers.

Advantages of LVM-ext4

Show the relationship of LVM-ext4 filesystem to hard-drive partitions and mounted directories.
Structure of ext4 on LVM

The ext4 file system focuses on high-performance and scalability, without a lot of extra frills. It is effective at preventing fragmentation over extended periods of time and provides nice tools for when it does happen. Ext4 is rock solid because it built on the previous ext3 file system, bringing with it all the years of in-system testing and bug fixes.

Most of the advanced capabilities in the LVM-ext4 setup come from LVM itself. LVM sits “below” the file system, which means it supports any file system. Logical volumes (LV) are generic block devices so virtual machines can use them directly. This flexibility allows each logical volume to use the right file system, with the right options, for a variety of situations. This layered approach also honors the Unix philosophy of small tools working together.

The volume group (VG) abstraction from the hardware allows LVM to create flexible logical volumes. Each LV pulls from the same storage pool but has its own configuration. Resizing volumes is a lot easier than resizing physical partitions as there are no limitation of ordered placement of the data. LVM physical volumes (PV) can be any number of partitions and can even move between devices while the system is running.

LVM supports read-only and read-write snapshots, which make it easy to create consistent backups from active systems. Each snapshot has a defined size, and a change to the source or snapshot volume use space from there. Alternately, logical volumes can also be part of a thinly provisioned pool. This allows snapshots to automatically use data from a pool instead of consuming fixed sized chunks defined at volume creation.

Multiple devices with LVM

LVM really shines when there are multiple devices. It has native support for most RAID levels and each logical volume can have a different RAID level. LVM will automatically choose appropriate physical devices for the RAID configuration or the user can specify it directly. Basic RAID support includes data striping for performance (RAID0) and mirroring for redundancy (RAID1). Logical volumes can also use advanced setups like RAID5, RAID6, and RAID10. LVM RAID support is mature because under the hood LVM uses the same device-mapper (dm) and multiple-device (md) kernel support used by mdadm.

Logical volumes can also be cached volumes for systems with both fast and slow drives. A classic example is a combination of SSD and spinning-disk drives. Cached volumes use faster drives for more frequently accessed data (or as a write cache), and the slower drive for bulk data.

The large number of stable features in LVM and the reliable performance of ext4 are a testament to how long they have been in use. Of course, with more features comes complexity. It can be challenging to find the right options for the right feature when configuring LVM. For single drive desktop systems, features of LVM like RAID and cache volumes don’t apply. However, logical volumes are more flexible than physical partitions and snapshots are useful. For normal desktop use, the complexity of LVM can also be a barrier to recovering from issues a typical user might encounter.

Advantages of Btrfs

Show the relationship of Btrfs filesystem to hard-drive partitions and mounted directories.
Btrfs Structure

Lessons learned from previous generations guided the features built into Btrfs. Unlike ext4, it can directly span multiple devices, so it brings along features typically found only in volume managers. It also has features that are unique in the Linux file system space (ZFS has a similar feature set, but don’t expect it in the Linux kernel).

Key Btrfs features

Perhaps the most important feature is the checksumming of all data. Checksumming, along with copy-on-write, provides the key method of ensuring file system integrity after unexpected power loss. More uniquely, checksumming can detect errors in the data itself. Silent data corruption, sometimes referred to as bitrot, is more common that most people realize. Without active validation, corruption can end up propagating to all available backups. This leaves the user with no valid copies. By transparently checksumming all data, Btrfs is able to immediately detect any such corruption. Enabling the right dup or raid option allows the file system to transparently fix the corruption as well.

Copy-on-write (COW) is also a fundamental feature of Btrfs, as it is critical in providing file system integrity and instant subvolume snapshots. Snapshots automatically share underlying data when created from common subvolumes. Additionally, after-the-fact deduplication uses the same technology to eliminate identical data blocks. Individual files can use COW features by calling cp with the reflink option. Reflink copies are especially useful for copying large files, such as virtual machine images, that tend to have mostly identical data over time.

Btrfs supports spanning multiple devices with no volume manager required. Multiple device support unlocks data mirroring for redundancy and striping for performance. There is also experimental support for more advanced RAID levels, such as RAID5 and RAID6. Unlike standard RAID setups, the Btrfs raid1 option actually allows an odd number of devices. For example, it can use 3 devices, even if they are are different sizes.

All RAID and dup options are specified at the file system level. As a consequence, individual subvolumes cannot use different options. Note that using the RAID1 option with multiple devices means that all data in the volume is available even if one device fails and the checksum feature maintains the integrity of the data itself. That is beyond what current typical RAID setups can provide.

Additional features

Btrfs also enables quick and easy remote backups. Subvolume snapshots can be sent to a remote system for storage. By leveraging the inherent COW meta-data in the file system, these transfers are efficient by only sending incremental changes from previously sent snapshots. User applications such as snapper make it easy to manage these snapshots.

Additionally, a Btrfs volume can have transparent compression and chattr +c will mark individual files or directories for compression. Not only does compression reduce the space consumed by data, but it helps extend the life of SSDs by reducing the volume of write operations. Compression certainly introduces additional CPU overhead, but a lot of options are available to dial in the right trade-offs.

The integration of file system and volume manager functions by Btrfs means that overall maintenance is simpler than LVM-ext4. Certainly this integration comes with less flexibility, but for most desktop, and even server, setups it is more than sufficient.

Btrfs on LVM

Btrfs can convert an ext3/ext4 file system in place. In-place conversion means no data to copy out and then back in. The data blocks themselves are not even modified. As a result, one option for an existing LVM-ext4 systems is to leave LVM in place and simply convert ext4 over to Btrfs. While doable and supported, there are reasons why this isn’t the best option.

Some of the appeal of Btrfs is the easier management that comes with a file system integrated with a volume manager. By running on top of LVM, there is still some other volume manager in play for any system maintenance. Also, LVM setups typically have multiple fixed sized logical volumes with independent file systems. While Btrfs supports multiple volumes in a given computer, many of the nice features expect a single volume with multiple subvolumes. The user is still stuck manually managing fixed sized LVM volumes if each one has an independent Btrfs volume. Though, the ability to shrink mounted Btrfs filesystems does make working with fixed sized volumes less painful. With online shrink there is no need to boot a live image.

The physical locations of logical volumes must be carefully considered when using the multiple device support of Btrfs. To Btrfs, each LV is a separate physical device and if that is not actually the case, then certain data availability features might make the wrong decision. For example, using raid1 for data typically provides protection if a single drive fails. If the actual logical volumes are on the same physical device, then there is no redundancy.

If there is a strong need for some particular LVM feature, such as raw block devices or cached logical volumes, then running Btrfs on top of LVM makes sense. In this configuration, Btrfs still provides most of its advantages such as checksumming and easy sending of incremental snapshots. While LVM has some operational overhead when used, it is no more so with Btrfs than with any other file system.

Wrap up

When trying to choose between Btrfs and LVM-ext4 there is no single right answer. Each user has unique requirements, and the same user may have different systems with different needs. Take a look at the feature set of each configuration, and decide if there is something compelling about one over the other. If not, there is nothing wrong with sticking with the defaults. There are excellent reasons to choose either setup.

FAQs and Guides Fedora Project community For System Administrators

51 Comments

  1. Sergey

    I use KVM on servers where all the virtual disks are on the LVM(XFS). BtrFS can already do that ?

    • If you mean that the virtual disks use an LVM volume group and allocate out of that, not exactly. With Btrfs you’d have a directory for file-based virtual disk images. You’d also want to disable copy-on-write in that disk directory, since large image files like that don’t have good performance with CoW (from what I have read). This can be done with the “chattr +C” command.

      But note that that is a fairly advanced usage of LVM and a nice one at that. So it is entirely reasonable to keep using LVM, allowing for nice management of generic block devices, and using a logical volume to host your Btrf volume.

  2. RandomInternetDude

    I usully install fedora with LVM+ext4 with LUKS2 encryption.
    I didn’t see a flag for encryption when choosing BTRFS in the installer.

    How do I install Fedora with BTRFS and full disk encryption?

    • Chris

      I followed this tutorial, and it seems to work:
      https://mutschler.eu/linux/install-guides/fedora-btrfs/

    • red chili

      So do I and I therefore also missed that option within Anaconda (the installer), especially when one wants to not only use BTRFS within LUKS2 but also use some subvolumes (I prefer to put /home into a @home subvol as well as some others).
      It ended up working fine but involved quite some try and error, manually partitioning LUKS2 and BTRFS and after the installer has finished manually moving parts of the fs-tree into the respective subvolumes while mounting/unlocking the LUKS2 volume through booting via live-cd.

  3. Esc

    Great job. Is there any info about stable raid5 in btrfs?

  4. Jesse Pollard

    Biggest problem btrfs has is that it STILL has not got reliable raid support – “mostly OK” doesn’t cut it.

    • Specifically RAID 6/5. While it is actually usable and falls back to journaling to address some of the write hole issues, it’s probably best to avoid using in production until it’s actually marked as stable. RAID 0/1/10 are ready, which TBF, is more important in general for desktops. As Workstation targets desktops, this is good news.

    • Yeah that is definitely true. Though mdraid or raid5/6 support with LVM can be used with Btrfs on top. The only downside there is that there isn’t the all-in-one command

      btrfs

      to do all management from. Otherwise, it is a perfectly valid option.

  5. Norbert J.

    Great article, many thanks!

    I also wonder whether I should migrate from LVM-ext4 to Btrfs and appreciate the checksum feature, but I usually have the last 2 Fedora releases installed in parallel, with the option for yet another distro in mind. Although this probably can also be achieved with Btrfs subvolumes, I believe LVM to provide much better protection against accidental loss of the old OS when installing the new one.

    • Thanks! blushes

      I think your usage is pretty advanced, so it seems entirely reasonable to keep using LVM to help separate the multiple OS versions and use Btrfs on top of one of the logical volumes. This is in fact the path I have chosen. The main upside to an all-in Btrfs setup is easier management, but when you start managing side-by-side versions of the OS, you are already past that level of easy 😉

  6. Sally

    With the all benefits that’s been said of Btrfs, why fedora still uses ext4 on /boot by default with F33?
    And what is the best filesystem for ‘/boot’?

  7. Cédric

    Interresting
    In LVM/ext4, it s simple to extends VG by adding Disks. Same things when a disk need to be change.
    btrfs seems to integrate lvm on the FS feature
    If I have unterstood, you could use RAID0 to extends an existing FS Full but what s happen if you need change a device with data? when you are in raid0 mode and use for example 3 devices? In LVM you could migrate data between device.

    What s happen if / is full? Do you have always access for launching some cleaning? like 10% reserved space in ext4. Ok it s too important when you use a big FS, but the System continu to work.I m not sure that this is manage by brtfs.

    I think that brtfs must to be more mature with more tools for admin to integrate standard feature basicaly like
    Add/Extend/Remove/… device with one command only without use raid feature.
    But it s my opinion 🙂

    If someone have an experience in production with BRTFS with standard issue, Full FS, disk failures,…

    Regards,

    • Mica

      Don’t use brtfs in production. COW is a performance killer and btrfs balance and disk fulls due to snapshots have caused downtime to dozens of vms. The only thing btrfs is good at is selling more cloud vender disk as you have to way over provision. Simple disks and xfs or ext4 is the most stable setup. Back your disk stores on NetApp filers and you are good to go

      • Jos

        Of you are ok with silent data corruption ext4 is great, ot wont bother telling you your priceless family photos are damaged. If you care about your data, I would recommend btrfs. The performance differences are a wash and you get a great many extra benefits from the snapshots and easier backups to more flexible raid setups.

        As a reply to Cédric, you are in luck, btrfs handles those situations better than moat setups – it is extremely flexible in how you can add and remove drives and modify volumes on the fly, a major advantage over a lvm/extremely or ZFS setup.

      • Btrfs seems perfectly fine to use in production, Facebook is continuing to expand their own own usage for example. Of course, like any infrastructure there are tradeoffs in different scenarios. Snapshots are a fantastic tool, but they must be managed. Taking a snapshot freezes that data, that’s the point! But that means you must be very deliberate about clean ups. And certainly if you have a huge churn in your data that is being snapshot, you will consume additional space more rapidly as new copies of the data are created during write operations.

        There certainly seem to be cases where COW really hurts performance, large binary files such as VM disk images is the classic example. It is prudent to do targeted disabling of COW to be sure. However, COW also enables some really nice features, especially around handling of snapshots and the integration with the checksuming to detect otherwise silent data errors.

      • Benjamin Smith

        My comments are based on ZFS…

        CoW was a life saver for our situation! We had over 500 million files in a large, 50/50 read/write distributed that we had to back up nightly per SLA and rsync just wasn’t cutting it any longer – just the discovery phase was taking over 24 hours and hammering performance.

        Switched to ZFS, RAIDZ zvols of 6 drives RAIDZ2, 24 drives total, in systems having 32 GB of RAM and 24 Xeon cores each. Backup time dropped from almost 36 hours to under 1 over Gbit connection, and system load average dropped through the floor.

        I don’t trust BTRFS after getting burned a few times, and have been using ZFS ever since with wonderful reliability, although I don’t use ZFS on root – only hosted data partitions. Admittedly, the BTRFS burns were long ago, but involved RAID and here it’s years and years later and it’s still not fixed.

      • Chris

        After a week of testing Btrfs on my laptop, I can conclude that there is a noticeable performance penalty vs Ext4 or XFS. Using Btrfs, just expanding a zip file and trying to immediately enter that new expanded folder in Nautilus, I am presented with a “busy” spinning graphic as Nautilus is preparing to display the new folder contents. This never happens for me with Ext4 or XFS. And it’s a fast M.2 drive on very good hardware. That said; this wait could be completely worth it. If the added data integrity protections offered by Btrfs are to be believed, then a desktop user would be better served at least giving it a shot. And if you have not been using Linux for the past decades, you’re never going to notice the slight performance regression vs Ext4 or XFS anyway, as you have no point of reference. As for me, I’m back to XFS. I have backup practices in place that do not require file-system level roll-backs, so it is doubtful that I would even use Btrfs for what it is intended to provide. I do fully appreciate all of the hard work that is going into Btrfs and Fedora. In the future when I have the time, I will begin to migrate to my backup procedures to take advantage of what Btrfs has to offer. Until then, I’m sticking to XFS backed up to ZFS RAID on TrueNAS.

        • Leslie Satenstein, Montreal,Que,Canada

          With zfs (single disk lvm) you can almost watch the electrons move as your command gets processed. I used xfs, migrated to btrfs, and am testing openzfs. For a desktop system the latter two are overkill. Btrfs is about 2x speed of zfs for my config.
          my config
          2700x 16gigs ram, 120 gig SSD (zfs) m.2 1tb for btrfs. System is underutilzed.

          • One thing to set on zfs that can improve performance is “ashift=12” (2^12=4K sectors). Without that setting, zfs defaults to 512 byte sectors (modern SSDs are optimized for 4K I/O). I also like to use the “edonr” checksum algorithm. Setting “relatime=on” can also help. On Fedora you will want “xattr=sa” so all the SELinux extended attributes will be stored efficiently. Also, “acltype=posix” and “dnodesize=auto” are a good idea. Unfortunately (or perhaps fortunately depending on how you look at it) zfs has a LOT of tunables (and if you really want to get under the hood, have a look at “modinfo zfs”). With so many configurable options and varying defaults, one cannot really just say “btrfs is better than zfs” or vice versa.

      • David Ruedeman

        I was thinking the similar thing. Interesting that RH went from “we won’t consider btrfs” to including it as standard in version 33. Suse has included btrfs as standard. HOWEVER, they only support a subset of btrfs. They do not support, for example, native btrfs RAID, integrated volume management ,compression and encryption. Moreover, they recommend to use it only for root and use xfs for other volumes. Also they have janitor processes running btrfs balance , btrfs scrub etc on a regular basis. I do not see this on Fedora 33. Is this just sloppiness on Fedora’s part or is there some improvements in the later kernels that obviate the need for janitor processes.

  8. Timo

    Great article. There is also another significant difference between Btrfs and LVM-ext4 setups. LVM supports encryption while Btrfs doesn’t yet. If you have to meet a data at rest requirement you can’t conform with it with Btrfs alone.

    • Alex

      It is possible to place a BTRFS file system on a LUKS volume. Lets say you have a disk at /dev/sdb with a single partition /dev/sdb1 spanning the entire disk. You can then do the following:

      cryptsetup luksFormat /dev/sdb1

      cryptsetup luksOpen /dev/sdb1 mydata

      mkfs.btrfs -L mydata1 /dev/mapper/mydata

      mount /dev/mapper/mydata /mydatamntpoint

    • Anaconda, Fedora’s installer, will place Btrfs on LUKS/dm-crypt. It’s as simple as checking “Encrypt my data” in Figure 12 screenshot, in the install guide.

      Custom it’s slightly trickier to find, you need to set it on the entire Btrfs volume rather than at the mount point. The encrypt option is found in the Volume>Modify submenu, Figure 21 of the install guide shows it, it’s center-right in the screenshot.

  9. red chili

    Thanks for this insightful writeup which I wish I had come across earlier (yes, i know its just been published) as it answers many fundamental questions one might wonder about in regards to this new default.
    One think that I think should be explicitly mentioned that the new default only affects DESKTOP-spins, fedora 33 SERVER will per default typically still use LVM + XFS but as @chrismurphy has stated in his reply to my issue posted at https://ask.fedoraproject.org/t/cannot-mount-btrfs-subvolume-to-home-from-within-lvm/10805 , this can be altered by choosing ‘custom’ and BTRFS as partition scheme during installation.

  10. svsv sarma

    Thank you for the attempt at explaining/clarifying/recommending the new BTRFS. But the more you explain the more I am confused. Are you aware of any feed back from the existing users of Fedora 33 with the default BTRFS? That is very helpful really and decisive. Presently I am using Fedora 33 in live cd due to the dilemma and avoided upgrading lest it should spoil my mood. However I will install Fedora 33 BTRFS soon as recommended. If only the secret of Fedora 33 btrfs is not revealed!!

    • Are you aware of any feed back from the existing users of Fedora 33 with the default BTRFS?

      I have used btrfs from Fedora 33 rawhide on with Fedora Silverblue. I have 2 SSD setup as raid1 for the subvolume ‘/’ and a spinning disk setup as subvolume ‘/home’. I created a sub-volume on my spinning disk when I was running Fedora 32 SB to do a snapshot of my home dir prior to fresh installing F33 rawhide SB onto my system. I later mounted this snapshot and restored my home dir after fresh install. So far I have upgrade to release version F33 SB with all of the updates in between with no file system issues.

    • “Are you aware of any feed back from the existing users of Fedora 33 with the default BTRFS? ”

      Here’s a Reddit thread from some users!

      https://www.reddit.com/r/Fedora/comments/k3toqr/how_is_btrfs_going_for_everyone_so_far

  11. Leslie Satenstein, Montreal,Que,Canada

    When the experts stated that btrfs was the default for Fedora 33, I took their advice and converted most of my partitions to btrfs. I added compression, as an advantage, which allowed me to conserve some disk space. It has worked out well for me.

    There are some features of btrfs such as snapshots and perhaps some other tools that I want to explore in order to do off-site backups using an external hard disk.

    But at the same time, I am researching openzfs and finding openzfs to be disappointing and great at the same time. The disappointment is the licensing. It is not gpl2* licensed and therefore not available to RedHat or derivatives. The great part is that it is a logical volume manager and a superior btrfs solution all rolled up into one. Hopefully, oneday soon, openzfs can be dual licensed under cddl and gpl2, making it available to Fedora.

    I must congratulate the author on this fine posting. It is well organized and reads well. It confirms my decision to standardize, all my data partitions to be btrfs organized.

    Happy New Year to all.

    • Jos

      Sorry, zfs will never be fixed licens-wise, but it doesn’t do anything btrfs doesn’t and being out of the kernel means it is perpetually behind. It is no loss.

  12. leslie Satenstein

    Grub and btrfs. One serious issue for me is grub’s support of multi-btrfs based systems.
    I use fedora 33 with btrfs, and I have a test version of Fedora33 (btrfs) and Rawhide(btrfs). The grub2-mkconfig recognizes all three, but only creates entries for the host Fedora 33.

    I have to resort to “chain load” options to be able to boot the secondary distributions. If you only have the one Fedora33 with btrfs, the grub.cfg problem would be a “no-issue”.

  13. József Dezső

    I currently prefer BTRFS.
    But if the system and installer supported ZFS, I would rather choose it.

  14. For a workstation, Btrfs is unnecessary and LVM-ext4 is slower than plain ext4. Just use plain ext4 and store your data in the cloud with Dropbox and/or git. If Gnome Shell crashes your machine, all you data is safe in Dropbox. Just reinstall Fedora or use a different machine. If all your data is in the cloud, your workstation becomes just a replaceable terminal.

    • oldkid

      But the author mentioned that btrfs would benefit SSD life, I think it must be a good thing. Other than that, I too prefer your method. I just back up important files to other external hard drives without messing with the file system at all. I have enough programming background but for some reason I always suck at dealing with the file system, group, volume stuff. No matter how many tutorials I read, I’d always make one or two mistakes in the process, which unsurprisingly ends up with me in grief and misery for days.

  15. Edson

    Does btrfs suffer of sane problema as ext4 on “outage inodes” (out of disk space even having space) when running a filesystem with millions of files? Xfs currently doesn’t suffer on this problem.

    • Btrfs and XFS dynamically allocate inodes, rather than being created with a fixed number at mkfs time as it is on ext4. Further, Btrfs subvolumes are an independent file tree with their own pool of inodes. Each subvolume can contain 264 inodes and each Btrfs file system can contain 264 subvolumes (snapshots are also subvolumes).

  16. Connor The Poomp

    Why are you calling a file system that is over a decade old “next gen” …?

    • Jos

      Because it is next gen compared to ext4 and LVM, bringing many new features and improved reliability (like not silently letting your data corrupt but catching and, if you use RAID, fixing it).

      • Jos is right on. Filesystems are naturally very conservatively evolving code bases as they are so critical to computing, so it isn’t surprising it has been more than 10 years before we are really getting comfortable pulling it in for default use.

        The “next generation” is less about age and “newness”, but instead more about paradigm. There are many filesystems, but most are based around the same basic ideas with incremental tweaks. Next gen filesystems like Btrfs and ZFS rethink what a filesystem can do, pulling in novel features and integrating capabilities found previously only in volume managers. Even one of the key developers around Ext4 pointed out that it was just a stop-gap measure, piling on older file system principals, and biding time for Next gen systems like Btrfs to mature. https://arstechnica.com/information-technology/2009/04/linux-collaboration-summit-the-kernel-panel/

  17. Mark

    One of the more useful features of LVM is being able to vgexport/vgimport allowing VM or SAN logical disks and even physical disks to be easily moved between machines and retain all the logical volume layouts used.

    A quick search on a brtfs equivalent only found the below which indicates brtfs works with whole disks. It basically says move the disks and mount them, that implies things like quotas are stored on the disks similar to an lvm exported volume group which if true is nice.

    https://btrfs.wiki.kernel.org/index.php/UseCases#Are_there_a_similar_commands_in_BTRFS_like_ZFS_export.2Fimport.3F

    When there are disk issues there are likely to be more google answers for lvm/ext4 than for brtfs so lvm/ext4 is a better fit for new users.

    Also resizing filesystems on LVs and the underlying filesystems on them is fairly trivial. brtfs quotas may enforce sizes similar to LVs but are not nearly as intuitive as under zfs.

    As for zfs I was using that from the 2006/06 solaris x86 release that finally got it working; personally I don’t see brtfs as an improvement over what was available then. However as zfs licensing does prevent it being part of Linux by default anyone that worries about bitrot (which really does occur) should consider brtfs for its checksum facility to hopefully prevent that.

    Portability may be a consideration as well. ext4 has been around for a long time and there are windows utilities to read ext4 filesystems, I’m not aware of any for brtfs although there may be some. If you have a dual boot system you may want ext4.

    Also the mediawiki entry raises a few questions. From the below link
    https://en.wikipedia.org/wiki/Btrfs

    The ‘dd’ command is often references in google search results as a way of backing up data on ohysical or lvm filesystems, interesting that using dd on a brtfs filesystem wil result in data loss.

    That wikipedia entry also states
    In August 2017, Red Hat announced in the release notes for Red Hat Enterprise Linux (RHEL) 7.4 that it no longer planned to move Btrfs, which had been included as a “technology preview” since RHEL 6 beta, to a fully supported feature, noting that it would remain available in the RHEL 7 release series. Btrfs was removed from RHEL 8 in May 2019.
    In 2020, Btrfs was selected as the default file system for Fedora 33.

    Therefore one must wonder why brtfs is being pushed in F33. Of course you cannot believe everything you read on the internet and RedHat may be filly embracing brtfs.

  18. bruce sm

    I used btrfs, Then it tried to kill all my data. I thought once was just a version problem. TWICE? Now i use xfs or ext4. XFS survived a lightning strike. It will be a very long time before i trust btrfs again, in fact count that as never again.

    • same it tried to wreck 2tb of a database…
      2tb, i say that seriously my database is roughly 2tb large and there were so many missing or extra semaphores that it was overflowing because of i had to revert to backup and say like you did… never again.

  19. Btrfs caused me all sorts of issues with high input-output mariadb on sata hdd

    I’m waiting till all the kinks are ironed out.

  20. Troy Volin

    Super article. Lots of useful tidbits dangled along the way, while staying very focused.
    Interesting that you say you’ve chosen (for yourself) to stick with btrfs-on-LVM.
    Seems like there will always be cases when you may benefit from that flexibility at the lower level. LVM for swap, LVM to have a distinct high-performance-unencrypted btrfs volume, etc.
    And since it supports shrinking mounted volumes (!!!) you can dump almost all your space on your primary btrfs, and shrink the FS and LV later if needed.
    Now I have a plan! Thanks!

    • I proposed the article partly to document my own journey of learning. Honestly when I started my research I had settled on sticking with LVM+ext4. I had also come to the conclusion that I shouldn’t do Btrfs on LVM. As a result I didn’t convert my desktop when I installed Fedora 33, even though I did a fresh install. After my research I got super excited about Btrfs and could barely stay focused on finishing my article because I wanted to convert my systems. I also learned that I still wanted some of the features and flexibility of LVM, and that it was perfectly reasonable to put Btrfs on top as long as you accepted that Btrfs wouldn’t be the one-stop-shop.

      Now my new laptop has LVM + LUKS2 + Btrfs. I have already taken advantage of sending snapshots and transparent compression, it has been really awesome so far.

      Good luck on your file system journey!

  21. NuBz

    I don’t use lvm and have no need to get all fancy with my file system.
    EXT4 works fine for everything I do.

  22. Olivier

    Does anyone have experience or some numbers about the performance of BTRFS on a spinning disk ?
    When upgrading to Fedora 33, I had a spare partition on my old laptop; decided to try a fresh install with BTRFS.
    The first time I did a

    dnf upgrade

    , it took almost 2 hours to get done. And each time I tried to use dnf, I had to be really patient. I first thought about a DNF problem, but I decided to give XFS a try (the old system partition is using a good old ext4).
    All I have to say is that with XFS, my computer and DNF are back to normal speed (not fast for that old machine, but not extra slow).
    I suspect that BTRFS is not behaving correctly on a spinning disk, but maybe it’s just a configuration problem. But what to change ?

  23. Matthew

    Nice to hear! I’ve been using btrfs for multiple drives now for 4 years and it’s been rock solid. No need to mess with gparted and complicated LVM schemes anymore. Welcome to the Linux filesystem of the future.

Comments are Closed

The opinions expressed on this website are those of each author, not of the author's employer or of Red Hat. Fedora Magazine aspires to publish all content under a Creative Commons license but may not be able to do so in all cases. You are responsible for ensuring that you have the necessary permission to reuse any work on this site. The Fedora logo is a trademark of Red Hat, Inc. Terms and Conditions