r/btrfs

▲ 4 r/btrfs

Can a raid1 be disolved without rebalancing data?

If I have a raid1 with device A and B. Can I just keep A without having to rebalance data, and at most only change meta data?
It does not seem possible because if I do "device remove" I get an error that you cannot remove a device from a 2-device raid. You first have to convert into single mode which result in data rebalancing which can take a lot of time. Then you can remove the device and half of the data needs to be moved again back onto the remaining device which was completetly uneccesary in the first place because at the beginning it was already all there.
It should actually be an operation that does not need more than to rewrite meta data. So is it possible somehow? And if not, why?

reddit.com
u/Separate-Still-1616 — 5 days ago
▲ 3 r/btrfs

How well is btrfs supported on macos?

I need to format a drive to be used on both cachyos and macos, is btrfs a better option than exfat?

reddit.com
u/youzhang — 5 days ago
▲ 4 r/btrfs+1 crossposts

My BTRFS partition broke

Mount says: mount: /mnt/storage_test: can't read superblock on /dev/sdb2.
Dmesg says:
[ 2021.927627] BTRFS error (device sdb2): parent transid verify failed on logical 91701248 mirror 1 wanted 859 found 815
[ 2021.930881] BTRFS error (device sdb2): parent transid verify failed on logical 91701248 mirror 2 wanted 859 found 815
[ 2021.930919] BTRFS error (device sdb2): failed to verify dev extents against chunks: -5
[ 2021.931219] BTRFS error (device sdb2): open_ctree failed: -5

I tried sudo btrfs check --readonly /dev/sdb2, but it fails with segfault:
parent transid verify failed on 50249728 wanted 848 found 753
parent transid verify failed on 50249728 wanted 848 found 753
parent transid verify failed on 50249728 wanted 848 found 753
Ignoring transid failure
parent transid verify failed on 50266112 wanted 848 found 753
parent transid verify failed on 50266112 wanted 848 found 753
parent transid verify failed on 50266112 wanted 848 found 753
Ignoring transid failure
fish: Job 1, 'sudo btrfs check --readonly /de…' terminated by signal SIGSEGV (Address boundary error)

I tried sudo btrfs restore /dev/sdb2 /mnt/storage_test, and it copies files to my other disk, but there's too much data, and I can't save it here.
What can I do?

reddit.com
u/iliRomaili — 7 days ago
▲ 42 r/btrfs+1 crossposts

Benchmarking what modern filesystems promise, continuously

I started working on this recently because I found out that most if not all filesystem benchmarks still test the way it was done when ext2 was state of the art: one disk, default mkfs, raw throughput. But nobody picks btrfs, ZFS or bcachefs for throughput - you pick them for snapshots, redundancy, checksums, self-healing. Almost nobody publishes numbers on those.

So this suite benchmarks the machinery instead, across 17 configurations (btrfs/ZFS/bcachefs plus ext4/xfs over md/LVM as classic baselines, plus encryption variants): aging under 100 snapshots, corrupting a device behind the filesystem's back and checking whether scrub repairs it, failing a device and timing the rebuild, filling to hard ENOSPC, fsync tail latency, and "how long until my prompt comes back while a big cp runs in the background".

Yes, it runs on ephemeral GitHub runners with loop devices - I know what that means. Absolute MB/s is meaningless there, so the suite is built around shapes, ratios and verdicts, with per-VM calibration probes (lemon runners get auto-rerun) and conclusions drawn from trends over many runs. Real hardware with tiered topologies (NVMe cache over rotational disks, special vdevs) is the next step. I just need to gather hardware for it first.

What I'm really asking for is your eyes. Every number on the dashboard links to a description of exactly what ran, with what parameters, and to the code responsible - so if I picked a wrong mount option, an unfair default, a workload that misrepresents your favorite filesystem, or a broken measurement, you can find it and call it out. Several of the current tests exist because people poked holes in earlier results, and honestly that feedback improved this more than anything I did alone.

Dashboard: https://bartosz.fenski.pl/modern-fs-benchmark/
Repo: https://github.com/fenio/modern-fs-benchmark

reddit.com
u/bfenski — 10 days ago
▲ 9 r/btrfs+1 crossposts

readonly filesystem

Hi all,

For context I have a server on Endeavour (up to date from 07/07/26) with a SSD encrypted with LUKS for the system and 3 HDDs in RAID 5 for data. Nothing wrong with the HDDs but /dev/sda2 (encrypted partition) put itself in readonly few hours after boot. It worked perfectly for the past 2 years and suddenly this problem appeared since 2 months. I tried to clone with `dd` the SSD's filesystem an another working SSD, nothing changed. It's written `rw` in fstab, I ran a btrfs check on it but I admit I can't really read it, you'll find the result attached.

P.-S. : each time I write a command, fish mentions an error about readonly filesystem in french (my language)

P.-P.-S. : as english isn't my first language I hope I didn't made mistakes

u/HecArch — 10 days ago
▲ 6 r/btrfs+1 crossposts

Cloning a failing M.2 nvme ssd to a new one

So guys I have thinkpad t14 gen3 and the drive on it is failing (the maxwell controller is degrading) so I got a new drive and wanna clone it because all that’s on that drive is important (about 150GB out of 512GB).

I used ddrescue but it just runs for like 2mins before the drive drops off the bus and my os freeze which I have to restart the pc again to try to continue the process. And it’s tiring and frustrating and I don’t wanna corrupt or mess the pc up with that process.

Is there any solutions to cloning a failed drive to the new one. I have a live usb running fedora, a ssd enclosure housing the new drive which I plug in the pc. What can I do to make sure this is a successful clone. Both drives are 512GB too btw

reddit.com
u/RelevantTear6092 — 13 days ago
▲ 7 r/btrfs

How to recover from system going read-only after "no space left"?

Edit: It appears I was stuck because every time I tried to mount a balance that I had tried restarted which locked the drive because it didn't have enough room to proceed. I solved this by unmounting, then remounting with -o skip_balance. From there I deleted a file and then added a device and rebalanced to get some breathing room.

Just created a new BTRFS volume comprised of a 1TB and 2TB drive in RAID1 for both metadata and data. It has no snapshots and 7 subvolumes, some directories are compressed but not most.

From what I can tell it went read-only because I filled it. I don't know how to actually fix that though because when it's read-only I can't free up space on it.

sudo dmesg | grep -i btrfs:

[102895.930974] BTRFS: error (device sdi1 state A) in btrfs_run_delayed_refs:2247: errno=-28 No space left
[102895.930978] BTRFS info (device sdi1 state EA): forced readonly
[102895.931491] BTRFS info (device sdi1 state EA): 2 enospc errors during balance
[102895.931495] BTRFS info (device sdi1 state EA): balance: ended with status: -30

sudo btrfs fi show /mnt/betterStorage/:

Label: 'BetterStorage'  uuid: 79f9a7ca-e97b-461c-9123-c62b39b52661
	Total devices 2 FS bytes used 930.59GiB
	devid    1 size 1.82TiB used 931.51GiB path /dev/sdi1
	devid    2 size 931.51GiB used 931.51GiB path /dev/sda1

sudo btrfs device stats /mnt/betterStorage/:

[/dev/sdi1].write_io_errs    0
[/dev/sdi1].read_io_errs     0
[/dev/sdi1].flush_io_errs    0
[/dev/sdi1].corruption_errs  0
[/dev/sdi1].generation_errs  0
[/dev/sda1].write_io_errs    0
[/dev/sda1].read_io_errs     0
[/dev/sda1].flush_io_errs    0
[/dev/sda1].corruption_errs  0
[/dev/sda1].generation_errs  0

So, how do I resolve this issue?


Second Question

The above commands seem to indicate that it's full, but in Btrfs Assistant it says:

Filesystem Size: 2.73TiB
Allocated: 1.82TiB (66.67%)
Used: 1.82TiB (66.60%)
Free (Estimated): 466.30 GiB (16.69%)
Free (Minimum): 466.30 GiB (16.69%)
You have lots of free space, did you overbuy?

Is Btrfs Assistant just wrong or are these numbers saying something different than I think? Because it's presented as though I have free space which is why I didn't realize I filled it up at first.

It looks like that's pulling from the following from the command line:

sudo btrfs fi us -T /mnt/betterStorage:

Overall:
    Device size:		   2.73TiB
    Device allocated:		   1.82TiB
    Device unallocated:		 931.51GiB
    Device missing:		     0.00B
    Device slack:		   6.00KiB
    Used:			   1.82TiB
    Free (estimated):		 466.30GiB	(min: 466.30GiB)
    Free (statfs, df):		 557.80MiB
    Data ratio:			      2.00
    Metadata ratio:		      2.00
    Global reserve:		 512.00MiB	(used: 0.00B)
    Multiple profiles:		        no

             Data      Metadata System                                 
Id Path      RAID1     RAID1    RAID1     Unallocated Total     Slack  
-- --------- --------- -------- --------- ----------- --------- -------
 1 /dev/sdi1 929.48GiB  2.00GiB  32.00MiB   931.50GiB   1.82TiB 3.00KiB
 2 /dev/sda1 929.48GiB  2.00GiB  32.00MiB     1.04MiB 931.51GiB 3.00KiB
-- --------- --------- -------- --------- ----------- --------- -------
   Total     929.48GiB  2.00GiB  32.00MiB   931.51GiB   2.73TiB 6.00KiB
   Used      928.94GiB  1.66GiB 144.00KiB
reddit.com
u/CreativeGPX — 14 days ago
▲ 5 r/btrfs

Making a snapshot permanent/untagging it from automatic deletion?

I'm dealing with system issues (Either a kernel update doesn't like my system or I'm having cpu/gpu hardware failures) and I'd like to keep what seems to be the last known good snapshot from being automatically deleted. Would just changing its name from timeline to something else do it, or do I need to do something else to manually mark it to keep and not delete?

Edit: I'm using Snapper btw, in garuda.

reddit.com
u/DuendeInexistente — 12 days ago
▲ 5 r/btrfs

Snapshots to a different drive

Hello!

I am planning on switching my home server OS to opensuse. I already have a zfs pool for the main storage, the OS drive will be separate. My question is how I can leverage btrfs snapshots (with snapper?) to rebuild the OS in case of drive failure.

I was thinking that the snapshots could live in the zfs pool, both of the 'root' OS snapshots and the home snapshots for user config.

I am unsure how this works, if it is at all feasible, and what would the restore procedure be like if possible. Also open to other suggestions, the key is to be able to recover the OS on drive failure (with mirroring)

reddit.com
u/kurtlawrence92 — 14 days ago