Skip to main content
32 votes
Accepted

What ext4 functionality does btrfs not support?

Disadvantages of btrfs compared to ext4: 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 ...
Tom Hale's user avatar
  • 31.5k
30 votes
Accepted

btrfs: how to calculate btrfs compression space savings?

In Debian/Ubuntu: apt install btrfs-compsize compsize /mnt/btrfs-partition In Fedora: dnf install compsize compsize /mnt/btrfs-partition output is like this: Processed 123574 files, 1399139 regular ...
AcckiyGerman's user avatar
24 votes
Accepted

nice and ionice: which one should come first?

If nice caused lots of I/O, you would want to do: ionice -c 3 nice ... so that the impact of the I/O would be minimized. Conversely, if ionice performed lots of computation, you would want to do ...
Barmar's user avatar
  • 10.2k
21 votes

How to get rid of the “scanning for btrfs file systems” at start-up?

On Ubuntu 18.04 you can uninstall btrfs-support with apt purge btrfs-progs But that probably wouldn't save you much boot time. On my system the reason was, that I don't have a swap partition but on ...
rubo77's user avatar
  • 29.6k
18 votes

What is the point of btrfs subvolumes?

I’m no expert—not even close!—but since I’ve been reading a lot about Btrfs lately, and since your question has gone unanswered for six months, I figured I’d give it a shot. Here are two possible use ...
Tim Pederick's user avatar
17 votes

How do I determine the block size for ext4 and btrfs filesystems?

You could use stat -f to get an answer of any filesystem, eg.: % stat -f /home File: "/home" ID: 5013a37be3cd6a47 Namelen: 255 Type: ext2/ext3 Block size: 4096 Fundamental ...
Matija Nalis's user avatar
  • 3,176
16 votes

What ext4 functionality does btrfs not support?

As pointed out in the comments there is support for swap files as of kernel 5.0. albeit with some limitations, as listed at https://btrfs.readthedocs.io/en/latest/btrfs-man5.html: SWAPFILE SUPPORT A ...
phk's user avatar
  • 5,983
15 votes

btrfs replace "ERROR: target device smaller than source device"

I encountered this when trying to replace a disk with one slightly smaller. I was getting this error even after resizing the filesystem on the source drive. Since I was using whole disks, there was no ...
rkjnsn's user avatar
  • 702
15 votes
Accepted

Error for `mount`: `system call failed: File exists.`

(I'm not sure why you're using the -o loop mount option, as the LVM snapshot device should be just as good a disk device as its original is.) "File exists" is the standard English text for errno ...
telcoM's user avatar
  • 103k
15 votes
Accepted

How do I determine the block size for ext4 and btrfs filesystems?

You'll want to look at the data block allocation size, which is the minimum block that any file can allocate. Large files consist of multiple blocks. And there's always some "waste" at the ...
steve's user avatar
  • 22.1k
13 votes
Accepted

Why is cp --reflink=auto not the default behaviour?

As of coreutils 9.0 reflink=auto is the default behaviour. See: https://lists.gnu.org/archive/html/info-gnu/2021-09/msg00010.html This is to announce coreutils-9.0, a stable release. This is a new ...
Bruce Adams's user avatar
13 votes

Resize a btrfs partition inside a logical LVM volume

BTRFS takes filesystem mount point as an argument, not a device path. In other words, intead of this: btrfs filesystem resize max /dev/vg/lvhome You should use actual path where the said volume was ...
sanmai's user avatar
  • 1,436
13 votes
Accepted

How do I expand btrfs metadata?

TL;DR The metadata (if the btrfs is not suffering general low space condition) will automatically increase. In cases that no unallocated free space exists, the automatic increase is hembered. If, ...
humanityANDpeace's user avatar
13 votes
Accepted

Can btrfs track / avoid bad blocks?

Sadly, no. btrfs doesn't track bad blocks and btrfs scrub doesn't prevent the next file from hitting the same bad block(s). This btrfs mailing list post suggests to use ext4 with mkfs.ext4 -c (this &...
Tom Hale's user avatar
  • 31.5k
13 votes
Accepted

How to set a non default zstd compression level at btrfs filesystem defragment?

Kernel 5.1 added ZSTD level support. I tested it with rc1 today using a mount option compress=zstd:12 in /etc/fstab. The default level is 3. To be clear: The change affects only files that are written ...
Sven's user avatar
  • 275
13 votes
Accepted

How to encrypt an existing disk on Fedora without formatting?

This assumes a default Fedora installation, with the following Btrfs-based partitions: Root partition (Btrfs subvolumes "root" [mounted at /] and "home" [mounted at /home]) Boot ...
jessica-rod's user avatar
12 votes

BTRFS convert RAID0 to RAID1

When making a btrfs filesystem across multiple devices, the default is to use RAID0 for data, and RAID1 for metadata. If you want to change this you can pass arguments to the mkfs command to change ...
fooot's user avatar
  • 804
12 votes
Accepted

Why would I want to disable Copy-On-Write while creating QEMU Images?

The performance degradation with VM images on BTRFS is not merely due to a lot of file writes; as far as BTRFS is concerned the writes are to the same file. The issue arises from a lot of random ...
Emmanuel Rosa's user avatar
12 votes

Get size of btrfs directory which may contain subvolumes

Yes, it's probably a BTRFS related issue. As a general rule, classic du is not reliable with BTRFS, and quite often can give seemingly nonsensical results like this. This ultimately arises from the ...
Austin Hemmelgarn's user avatar
12 votes
Accepted

Serious backup options for linux disk (dmcrypt, luks, ext4, ext3, btrfs) normal and encrypted system

Linux system backup When targeting a true full system backup, disk image backup (as asked) offer substantial advantage (detailed bellow) compared to files based backup. With files based backup disk/...
intika's user avatar
  • 14.7k
11 votes
Accepted

I have a disk failing in a RAID1 btrfs such that writes are iffy, but reads mostly work. How to replace it?

This has turned out to be a royal PITA. First, it's important to note that btrfs now has a proper replace command, which is very much better than add new, remove failing. First, start by partitioning ...
derobert's user avatar
  • 111k
11 votes
Accepted

Btrfs RAID1: How to replace a disk drive that is physically no more there?

Update: According to @mkudlacek, this problem has been fixed. For prosperity, here is my answer to why in 2017, I could not rebuild a RAID with a missing drive. Turns out that this is a limitation of ...
Hans Deragon's user avatar
11 votes

Btrfs RAID1: How to replace a disk drive that is physically no more there?

replace needs the filesystem to be mounted rw to operate. In a degraded BTRFS RAID1 filesytem, you have one and only one chance to mount the filesystem rw using -o degraded: degraded (...
Tom Hale's user avatar
  • 31.5k
11 votes

btrfs — Is it dangerous to defragment subvolume which has readonly snapshots?

Btrfs defrag won't break all reflinks Just the particular instances you point it at. So, if you have subvolume A, and snapshots S1 and S2 of that subvolume A, then running defrag on just subvolume A ...
Pro Backup's user avatar
  • 5,014
11 votes
Accepted

How to display btrfs snapshot size

Enabling quota is not a recommended if you have lot of backups. Instead, you can use btrfs filesystem du -s command: # btrfs filesystem du -s @snapshot* Total Exclusive Set shared Filename ...
Jarppiko's user avatar
  • 126
10 votes
Accepted

How do I view the btrfs checksum of a file?

Btrfs calculates a crc32c checksum for each file. This is not correct. Both of the open-source checksumming file-systems (ZFS and BTRFS) calculate a checksum for each logical block (the unnamed ...
Peter's user avatar
  • 374
10 votes
Accepted

BTRFS balance completed, but still shows data stored in "single" mode

With the help of a user on the btrfs irc, I was able to answer question (1). It seems unrelated to the reboot and unsuccessful mount attempt (still not sure what that was about). Instead, it seems the ...
mboratko's user avatar
  • 313
10 votes
Accepted

ENOSPC: Why is `btrfs balance` required? What does it do?

Unlike most conventional filesystems, BTRFS uses a two-stage allocator. The first stage allocates large regions of space known as chunks for specific types of data, then the second stage allocates ...
Austin Hemmelgarn's user avatar
10 votes
Accepted

What does a rmlint's "clone" for btrfs do?

The differences are somewhat subtle. Reflink deletes the duplicate file and creates a new file in its place which is a clone of the original file. The metadata of the duplicate is lost, although ...
thomas_d_j's user avatar
  • 1,521
10 votes

Can I use btrfs subvolumes for trying multiple Linux distributions without committing a set quantity of disk space?

I have get it works, partially. From an OpenSUSE installation (btrfs used by default), I have: created a subvolume (btrfs subvol create /debian), installed debootstrap, deboostrap --arch=amd64 stable ...
Frédéric Loyer's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible