Guidance on removing btrfs

I have EOS system installed on ext4 file systems. Upon checking the standard EOS install base, I found that btrfs package is also installed. I do not plan to use btrfs. I have not used btrfs in the past too. The following packages are also not installed

  1. btrbk
  2. libblockdev-btrfs
  3. libguestfs

Given this background, can you please help me out with the following queries

Firstly if I were to remove the package btrfs-progs, will that be sufficient to remove btrfs? Or do I have to remove some other packages too?

Secondly while removing btrfs and its packages do I have to make sure of something? Some configuration that needs to be checked?

Thirdly do I need to do any changes, so that btrfs support in GRUB, systemd, dracut and Linux Kernel is also removed? What changes in configuration of GRUB, systemd, dracut and Linux Kernel should be done so that they work normally after removal of btrfs? What changes do I have to make so that btrfs module is not loaded by Linux Kernel?

[1] Initially the post had listed the the package btrfs-progs as installed. That was a mistake pointed out by @mbod. The post has been edited to reflect that.


  1. Footnotes ↩︎

Btrfs is a partition format like fat32 ntfs ect. Changing it require to format the related drive.

You will have to reinstall from scratch.

btrfs-progs is included in the core repository of the underlying arch installation. I wouldn’t recommend to remove it, the package is rather small with an installed size of only 6.5 mb. I wouldn’t touch any package that’s included in the core repository.

There several use cases (e.g. if you’re using VMs) that may require accessing a btrfs filesystem - what libguestfs is used for.

Due to it’s small size, it won’t hurt to keep those packages.

Additionally: btrfs is essentially tied into the linux kernel since kernel version 2.6.29.

And let me just point to the fact that you’re missing out on one very powerful feature that btrfs is capable of - and that is the support of subvolumes and snapshots via snapper or timeshift. Which is essentially an idiot proof to keep system restore points that could be added to the grub bootmenu in addition to the fallback images.

I highly recommend it to setup snapshots. They require btrfs and won’t work with Ext4, which is a journaling file system. btrfs is a copy-on-write filesystem instead. You can’t add snapshot functionalities simply to ext4 unless you’re already using LVM in combination with Ext4 if I’m not mistaken.

So btrfs-progs is not installed.

But you plan to remove it?

That is confusing.

By the way, btrfs-progs is just 6.5 MB. What is your goal in removing it? It is certainly not space savings.

Also, the btrfs filesystem, is part of the kernel. It is hard coded into the kernel. For the LTS kernel it comes as a module of 860 KB. Also nothing to worry about regrading size.

I would recommend to leave it as it is. Removing default packages is always coming with a risk. And doing it for no good reason is not a good idea.

My mistake, I have corrected it. Thanks for pointing it out. :smiley:

Since btrfs is part of the kernel, if the package btrfs-progs is removed will it impair the working of the Linux Kernel? Can it cause crashes?

no it will not. It is save to remove

Can you please elaborate on this? Does this mean that without the package btrfs-progs the Linux Kernel might not boot or exhibit unspecified behavior?

Yes, btrfs has capabilities of error correction, snap shots and a few others which are part of ext4. I do not plan to utilize these. For me EXT4 works and has what I need. I am not saying that ext4 is better or btrfs is better. Based on the use case, each of the file system fulfills their roles.

I am sorry, save to remove?

btrfs-progs contains user space programs to manage btrfs filesystems. If you dont have btrfs filesystems you can remove btrfs-progs.

1 Like

You can’t remove support for btrfs from grub, systemd and dracut unless you strip out support from the code and build your own packages. But…why would you do that? This is a bunch of work for no obvious gain.

You could build your own kernel without support for btrfs. But, again, why? The kernel module for btrfs shouldn’t be loaded unless it has a reason to.

Lastly, why btrfs? I mean, there is probably support for 20 other filesystems you also don’t use. What is special about btrfs that makes you feel the need to purge it’s existence from your system?

6 Likes

Agreed, I do not contemplate removing the source code from grub, systemd and dracut. I am not planning on going full gentoo way. Maybe I should have been clearer. I wanted to know whether there are some configuration files that can be modified so as to drop support for btrfs.

I do not plan to build my kernel. Though having a look at the IPV4 issues with the Linux main line kernel, i.e. 6.16.42-44, I am considering it.

It is not btrfs alone. I am also looking at hfs/hfsplus, cramfs, cifs, etc. I am looking at support for 20 other filesystems which I do not use.
I hope my post has not come across as if there is something to grind against btrfs specifically. Or to say btrfs is bad or not mature enough or not to be use or anything else disparaging about btrfs.

The Linux kernel contains drivers for thousands of hardware devices that you do not use. Are you also planning to remove those drivers?

6 Likes

In this case, we’re not talking about packages removal, but kernel compilation config.