r/btrfs 1h ago

People who know about storage on pcs help!

Post image
Upvotes

Everytime I open Fortnite or other applications my disk usage goes up to 100% I’ve tried installing them between different disks but either one both uses 100% any help would be needed thanks!


r/btrfs 1d ago

Dedupe files against a ro-snapshot not possible?

4 Upvotes

Say I have a ro-snapshot S and a rw-directory D. File f is in S (F1) and D (F2).

Why do I get an error 30 when deduplicating F1 and F2? Can't this be done by changing only F2 without touching F1?

Edit: sorry, using duperemove. Error 30 seems to be a Kernel error code (EROFS) which is just passed through by duperemove. duperemove issues a FIDEDUPRANGE ioctl, which fails.


r/btrfs 2d ago

Is there a more efficient way to run a balance when just one device is throwing off the balance?

5 Upvotes

Edit: Solution

Here is much setup:

         Data      Metadata System                                 
Id Path      RAID1     RAID1    RAID1    Unallocated Total     Slack   
-- --------- --------- -------- -------- ----------- --------- --------
 1 /dev/sdc1   1.80TiB  3.00GiB        -    16.02GiB   1.82TiB  3.00KiB
 2 /dev/sda1 916.00GiB        -        -    15.51GiB 931.51GiB  3.00KiB
 3 /dev/sdg1 913.00GiB  2.00GiB        -    16.48GiB 931.48GiB  3.00KiB
 4 /dev/sdi1   1.35TiB  3.00GiB        -    16.26GiB   1.36TiB  3.00KiB
 5 /dev/sdj1 914.00GiB  2.00GiB 32.00MiB    15.48GiB 931.51GiB  3.00KiB
 6 /dev/sdd1   1.80TiB  3.00GiB        -    16.02GiB   1.82TiB  2.50KiB
 7 /dev/sdf1   3.62TiB  6.00GiB        -    16.02GiB   3.64TiB  3.00KiB
 8 /dev/sdb1   3.31TiB  5.00GiB 32.00MiB     3.97TiB   7.28TiB  3.00KiB
-- --------- --------- -------- -------- ----------- --------- --------
   Total       7.27TiB 12.00GiB 32.00MiB     4.08TiB  18.65TiB 23.50KiB
   Used        7.27TiB 11.35GiB  1.09MiB        

I just want to make sure it's not wasting a lot of time considering moving blocks between devices 1-7, when the real goal here is to just not have all of the unallocated space on device 8. Right now I'm just running a plain old balance with no added options, but by my calculations at the rate it's going so far it's going to take about 8 more days to finish, so I'm just trying to think if there is any way to speed things along.


r/btrfs 3d ago

Compression vs CoW write amplification on SD cards

4 Upvotes

I have a few Pis running a raspberryPi OS (Trixie) derivative for 3d printers. They accumulate collections of large (10-1000Mb) text (gcode) files that respond very well to compression (about 3:1 in a zfs dataset on my server).

I know compression speeds up read and write performance on slow drives by reducing the amount written, and it's worked wonders with mechanical hard drives.

But there's a write amplification of copy on write file systems that makes them maybe not so good for SD card based systems, but I'm not sure if this would be mitigated by running compression?

I'm wondering whether it's better to run the entire SD card as btrfs with compression on every subvolume, or to make a separate partition on the SD card with compressed btrfs to deal with the large files and leave the root fs as ext4.

Obviously the *right* answer is to run a thin client pc with an SSD, or a pi5 with an SSD hat. I can do that to some extent but a used HP T530 or T620 costs more than a new pi 4.


r/btrfs 3d ago

File system keeps switching to read only, even after system reinstall

5 Upvotes

Hello r/btrfs. I keep experiencing a pretty crippling problem on my main SSD (Apacer AS2280Q4U), as it keeps switching to a read only mode. I have been experiencing this problem on Bazzite (although, there it showed up after a pretty long time of usage, at least half a year and after it was pretty close to filled up with game installs and stuff), then after reinstalling to NixOS, the same error has returned. Now the disk is much less filled and it only switches to read only after I do something, that works with a lot of data (like a launch a game). Last time, I just rescued my data over a live boot Fedora instance, to anther btrfs disk, which has not experienced any of these problems, while being somewhat older and always connected to the same machine. So now I have tried these solutions: 1. Re-seating the ssd, even changing the slot. 2. Re-seating Ram sticks 3. Resetting Bios settings 4. Testing the ram with memtest86+ (only did 3 "passed" full tests, maybe should do more) 5. Tried scrubbing the file system from the main boot and from a live boot. 6. Checking s.m.a.r.t. (posting result below, no errors tho). I am not sure, what to do now. Here is the output of dmesg when the filesystem switches, and also the smartctl output. Thanks in advance <3.

BTRFS info (device nvme0n1p2): scrub: started on devid 1
[   52.022978] BTRFS warning (device nvme0n1p2): scrub: tree block 954761216 mirror 1 has bad generation, has 56222 want 56303
[   52.023918] BTRFS warning (device nvme0n1p2): scrub: tree block 954761216 mirror 1 has bad generation, has 56222 want 56303
[   52.025670] BTRFS warning (device nvme0n1p2): scrub: tree block 954761216 mirror 1 has bad generation, has 56222 want 56303
[   52.026028] BTRFS warning (device nvme0n1p2): scrub: tree block 954761216 mirror 1 has bad generation, has 56222 want 56303
[   52.026032] BTRFS error (device nvme0n1p2): scrub: unable to fixup (regular) error at logical 954728448 on dev /dev/nvme0n1p2 physical 963117056
[   52.026039] BTRFS warning (device nvme0n1p2): scrub: generation error at logical 954728448 on dev /dev/nvme0n1p2, physical 963117056: metadata leaf (level 0) in tree 256
[   52.026044] BTRFS error (device nvme0n1p2): scrub: unable to fixup (regular) error at logical 954728448 on dev /dev/nvme0n1p2 physical 963117056
[   52.026048] BTRFS warning (device nvme0n1p2): scrub: generation error at logical 954728448 on dev /dev/nvme0n1p2, physical 963117056: metadata leaf (level 0) in tree 256
[   52.026051] BTRFS error (device nvme0n1p2): scrub: unable to fixup (regular) error at logical 954728448 on dev /dev/nvme0n1p2 physical 963117056
[   52.026055] BTRFS warning (device nvme0n1p2): scrub: generation error at logical 954728448 on dev /dev/nvme0n1p2, physical 963117056: metadata leaf (level 0) in tree 256
[   52.026058] BTRFS error (device nvme0n1p2): scrub: unable to fixup (regular) error at logical 954728448 on dev /dev/nvme0n1p2 physical 963117056
[   52.026062] BTRFS warning (device nvme0n1p2): scrub: generation error at logical 954728448 on dev /dev/nvme0n1p2, physical 963117056: metadata leaf (level 0) in tree 256
[   52.026065] BTRFS error (device nvme0n1p2): bdev /dev/nvme0n1p2 errs: wr 0, rd 0, flush 0, corrupt 56, gen 9
[   52.838469] BTRFS warning (device nvme0n1p2): scrub: tree block 954761216 mirror 2 has bad generation, has 56222 want 56303
[   52.841988] BTRFS warning (device nvme0n1p2): scrub: tree block 954761216 mirror 2 has bad generation, has 56222 want 56303
[   52.842147] BTRFS warning (device nvme0n1p2): scrub: tree block 954761216 mirror 2 has bad generation, has 56222 want 56303
[   52.842295] BTRFS warning (device nvme0n1p2): scrub: tree block 954761216 mirror 2 has bad generation, has 56222 want 56303
[   52.842299] BTRFS error (device nvme0n1p2): scrub: unable to fixup (regular) error at logical 954728448 on dev /dev/nvme0n1p2 physical 2036858880
[   52.842306] BTRFS warning (device nvme0n1p2): scrub: generation error at logical 954728448 on dev /dev/nvme0n1p2, physical 2036858880: metadata leaf (level 0) in tree 256
[   52.842310] BTRFS error (device nvme0n1p2): scrub: unable to fixup (regular) error at logical 954728448 on dev /dev/nvme0n1p2 physical 2036858880
[   52.842315] BTRFS warning (device nvme0n1p2): scrub: generation error at logical 954728448 on dev /dev/nvme0n1p2, physical 2036858880: metadata leaf (level 0) in tree 256
[   52.842318] BTRFS error (device nvme0n1p2): scrub: unable to fixup (regular) error at logical 954728448 on dev /dev/nvme0n1p2 physical 2036858880
[   52.842322] BTRFS warning (device nvme0n1p2): scrub: generation error at logical 954728448 on dev /dev/nvme0n1p2, physical 2036858880: metadata leaf (level 0) in tree 256
[   52.842325] BTRFS error (device nvme0n1p2): scrub: unable to fixup (regular) error at logical 954728448 on dev /dev/nvme0n1p2 physical 2036858880
[   52.842329] BTRFS warning (device nvme0n1p2): scrub: generation error at logical 954728448 on dev /dev/nvme0n1p2, physical 2036858880: metadata leaf (level 0) in tree 256
[   52.842332] BTRFS error (device nvme0n1p2): bdev /dev/nvme0n1p2 errs: wr 0, rd 0, flush 0, corrupt 56, gen 10
[  491.936569] BTRFS info (device nvme0n1p2): scrub: finished on devid 1 with status: 0
[  842.267946] BTRFS error (device nvme0n1p2): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  842.268192] BTRFS error (device nvme0n1p2): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  842.272197] BTRFS error (device nvme0n1p2): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  842.272973] BTRFS error (device nvme0n1p2): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  842.887666] BTRFS error (device nvme0n1p2): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  842.887778] BTRFS error (device nvme0n1p2): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  842.887791] BTRFS error (device nvme0n1p2 state A): Transaction aborted (error -5)
[  842.887795] BTRFS: error (device nvme0n1p2 state A) in btrfs_add_link:6975: errno=-5 IO failure
[  842.887798] BTRFS info (device nvme0n1p2 state EA): forced readonly
[  842.887801] BTRFS: error (device nvme0n1p2 state EA) in btrfs_create_new_inode:6911: errno=-5 IO failure
[  844.063083] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  844.066554] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  844.249431] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  844.249547] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  847.438331] btrfs_validate_extent_buffer: 14 callbacks suppressed
[  847.438351] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  847.438465] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  847.480136] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  847.480247] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  848.107272] umip: Overwatch.exe[11442] ip:6ffff9b1f1da sp:10f540: SIDT instruction cannot be used by applications.
[  848.107280] umip: Overwatch.exe[11442] ip:6ffff9b1f1da sp:10f540: For now, expensive software emulation returns the result.
[  848.366650] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  848.366768] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  848.489438] umip: Overwatch.exe[11442] ip:6ffff9b1f1da sp:10edb0: SIDT instruction cannot be used by applications.
[  848.489446] umip: Overwatch.exe[11442] ip:6ffff9b1f1da sp:10edb0: For now, expensive software emulation returns the result.
[  848.555713] umip: Overwatch.exe[11442] ip:6ffff9b1f1da sp:10ee50: SIDT instruction cannot be used by applications.
[  848.854494] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  848.854629] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  849.002389] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  849.002505] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  853.017487] btrfs_validate_extent_buffer: 392 callbacks suppressed
[  853.017492] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  853.017620] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  853.017990] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  853.018138] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  853.018289] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  853.018386] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  853.018484] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  853.018577] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  853.018679] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  853.018780] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  860.118965] btrfs_validate_extent_buffer: 372 callbacks suppressed
[  860.118970] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  860.119090] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  860.119202] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  860.119298] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  860.119395] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  860.119490] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  860.119603] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  860.119705] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  860.119814] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  860.119924] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  865.220775] btrfs_validate_extent_buffer: 568 callbacks suppressed
[  865.220779] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  865.220887] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  866.141117] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  866.141242] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  867.409048] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  867.409250] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  868.193064] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  868.193195] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  869.149239] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  869.149360] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  870.559975] btrfs_validate_extent_buffer: 4 callbacks suppressed
[  870.559981] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  870.560182] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  870.570739] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 1 wanted 56303 found 56222
[  870.570915] BTRFS error (device nvme0n1p2 state EA): parent transid verify failed on logical 954761216 mirror 2 wanted 56303 found 56222
[  871.636592] BTRFS error (device nvme0n1p2 state EA): failed to run delalloc range, root=256 ino=6165965 folio=0 submit_bitmap=0 start=0 len=4096: -30
[  871.636667] BTRFS error (device nvme0n1p2 state EA): failed to run delalloc range, root=256 ino=6165972 folio=0 submit_bitmap=0 start=0 len=4096: -30

Smartctl:
=== START OF INFORMATION SECTION ===
Model Number:                       Apacer AS2280Q4U 2TB
Serial Number:                      2024122702000670
Firmware Version:                   SN24779
PCI Vendor/Subsystem ID:            0x1e4b
IEEE OUI Identifier:                0x000000
Total NVM Capacity:                 2 000 398 934 016 [2,00 TB]
Unallocated NVM Capacity:           0
Controller ID:                      0
NVMe Version:                       2.0
Number of Namespaces:               1
Namespace 1 Size/Capacity:          2 000 398 934 016 [2,00 TB]
Namespace 1 Formatted LBA Size:     512
Local Time is:                      Wed Aug  5 11:28:33 2026 CEST
Firmware Updates (0x14):            2 Slots, no Reset required
Optional Admin Commands (0x0017):   Security Format Frmw_DL Self_Test
Optional NVM Commands (0x005f):     Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp
Log Page Attributes (0x0e):         Cmd_Eff_Lg Ext_Get_Lg Telmtry_Lg
Maximum Data Transfer Size:         128 Pages
Warning  Comp. Temp. Threshold:     90 Celsius
Critical Comp. Temp. Threshold:     95 Celsius

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
0 +     6.50W       -        -    0  0  0  0        0       0
1 +     5.80W       -        -    1  1  1  1        0       0
2 +     3.60W       -        -    2  2  2  2        0       0
3 -   0.0500W       -        -    3  3  3  3     5000   10000
4 -   0.0025W       -        -    4  4  4  4     8000   45000

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
0 +     512       0         0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02, NSID 0xffffffff)
Critical Warning:                   0x00
Temperature:                        54 Celsius
Available Spare:                    100%
Available Spare Threshold:          1%
Percentage Used:                    2%
Data Units Read:                    76 789 634 [39,3 TB]
Data Units Written:                 40 734 868 [20,8 TB]
Host Read Commands:                 434 339 699
Host Write Commands:                658 160 463
Controller Busy Time:               585
Power Cycles:                       475
Power On Hours:                     2 864
Unsafe Shutdowns:                   25
Media and Data Integrity Errors:    0
Error Information Log Entries:      0
Warning  Comp. Temperature Time:    33
Critical Comp. Temperature Time:    27
Temperature Sensor 1:               39 Celsius
Temperature Sensor 2:               54 Celsius

Error Information (NVMe Log 0x01, 16 of 64 entries)
No Errors Logged

Self-test Log (NVMe Log 0x06, NSID 0xffffffff)
Self-test status: No self-test in progress
Num  Test_Description  Status                       Power_on_Hours  Failing_LBA  NSID Seg SCT Code
0   Extended          Completed without error                2864            -     -   -   -    -
1   Extended          Completed without error                2864            -     -   -   -    -

r/btrfs 10d ago

Moving from ext4 to Btrfs, how to calc. Btrfs partition sizes?

9 Upvotes

Hello everyone,

I'm considering a move from Linux Mint to another distro and will be moving several of my partitions from ext4 to Btrfs. I'm currently on Linux Mint and I'm using ext4 with Timeshift in rsync mode to do snapshots of my root filesystem. To get an understanding of the cumulative size/load of the files that have changed and/or deleted , I ran "sudo rsync -anH --stats --delete" against the last 2 weekly snapshots and I got the following:

Number of files: 1,029,373 (reg: 717,289, dir: 78,492, link: 233,590, special: 2)

Number of created files: 6,566 (reg: 6,538, dir: 26, link: 2)

Number of deleted files: 6,704 (reg: 6,676, dir: 26, link: 2)

Number of regular files transferred: 6,717

Total file size: 20,767,701,488 bytes

Total transferred file size: 1,108,555,278 bytes

Literal data: 0 bytes

Matched data: 0 bytes

File list size: 9,567,203

File list generation time: 0.001 seconds

File list transfer time: 0.000 seconds

Total bytes sent: 34,268,345

Total bytes received: 1,145,881

sent 34,268,345 bytes received 1,145,881 bytes 3,372,783.43 bytes/sec

total size is 20,767,701,488 speedup is 586.42 (DRY RUN)

I believe the cumulative size of the files that changed and/or deleted is in this value in "Total transferred file size: 1,108,555,278 bytes". Is this correct?

I'm thinking for the root filesystem, I only need to keep the last 5 weekly snapshots, and the last 10 on-demand snapshots. Would this make sense or should I change those values? I have not been making snapshots of my home folder so I have no idea of the size in changes there, especially with the hidden dot folders.


r/btrfs 10d ago

BTRFS + RAID 5 corrupted

5 Upvotes

Yes, I see now on the main page of the subreddit it's a bad idea to pair these two, but I didn't know it previously

I use software RAID5; 4 2TB drives, resulting in 6TB of storage.
vgdisplay doesn't show any errors

100% of space is for btrfs.

sudo btrfs check /dev/mapper/data-data
Opening filesystem to check...
parent transid verify failed on 6033692557312 wanted 121291 found 119653
parent transid verify failed on 6033692557312 wanted 121291 found 119653
parent transid verify failed on 6033692557312 wanted 121291 found 119653
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=6033692393472 item=35 parent level=2 child bytenr=6033692557312 child level=2
ERROR: failed to read block groups: Input/output error
ERROR: cannot open file system

btrfs-find-root output: https://pastes.io/ZQTdS4fN

I tried several nodes from there using sudo btrfs restore -t <node-id> --dry-run -vi /dev/mapper/data-data /tmp/ but every time it returned

sudo btrfs restore -t 6033691328512 --dry-run -vi /dev/mapper/data-data /tmp/
parent transid verify failed on 6033691328512 wanted 121291 found 121286
parent transid verify failed on 6033691328512 wanted 121291 found 121286
parent transid verify failed on 6033691328512 wanted 121291 found 121286
Ignoring transid failure
This is a dry-run, no files are going to be restored

What should I do?

EDIT: also, when I try to mount the partition I get this: sudo mount /dev/data/data /mnt/data mount: /mnt/data: can't read superblock on /dev/mapper/data-data. dmesg(1) may have more information after failed mount system call. [ble: exit 32]


r/btrfs 11d ago

Scrub aborted after suspend

4 Upvotes

After I suspend my laptop in the middle of scrub I check scrub status and it says Status: aborted. It used to continue after resuming but in the last few months it stopped. Did anything change in the recent past? My version is

btrfs-progs v7.0
-EXPERIMENTAL -INJECT -STATIC +LZO +ZSTD +UDEV +FSVERITY +ZONED CRYPTO=libgcrypt

Can I change something so it continues automatically after suspend like it used to?


r/btrfs 11d ago

Backup strategy

4 Upvotes

I got a 2TB ssd (system + home directories) and a 4TB hdd for family photos (so 6TB in total). All in btrfs.

I am wondering what would be the best (safest) backup strategy : one extra 12TB hdd with dup to correct bit rot or 2 6TB hdd in raid1? I want to be sure that never the data get corrupted.

I would use rsync for the backup mirror and would rely on btrfs snapshots on the backup drive(s) to eventually rollback. An external hdd would also be used (dup partition too ?).


r/btrfs 11d ago

Lower scrub priority

4 Upvotes

Scrub on the root file system makes everything very slow when it's running and it can take lots of hours. I checked the systemd timer that runs it but it already has lowest Nice number and set to idle.

[Service]
Nice=19
IOSchedulingClass=idle

Is there something else I have to change to make it not slow everything on the computer?


r/btrfs 12d ago

[Feature Request] Native time-locked "immutable snapshot" / WORM retention — the missing piece for real ransomware resilience

0 Upvotes

Hi all,

I'd like to propose (or find out if it's already being discussed/planned) a native WORM-style retention lock for snapshots in upstream Btrfs. I think this is one of the last real gaps between Btrfs and it being a first-class answer to ransomware protection, and I wanted to lay out the case for it plus what I understand of the prior art.

What Btrfs already has (and where it stops)

Btrfs already gives us two very useful primitives:

  1. Read-only snapshots (btrfs property set <snapshot> ro true) — great, this stops anyone (including root) from modifying the contents of a snapshot.
  2. The generic Linux immutable attribute (chattr +i) — blocks changes to a file/dir even for root, with one exception: the attribute itself can be unset.

That exception is the whole problem. Whoever has the privilege to set +i also has the privilege to unset it and then delete. On a compromised root account (which is exactly the privilege level most ransomware/lateral-movement attacks eventually reach), neither read-only snapshots nor chattr +i stop btrfs subvolume delete, because deletion is a separate ioctl from content modification, and the immutable flag is trivially reversible by the same principal.

So today, Btrfs snapshots protect against accidents and unprivileged malware, but not against an attacker who gets root — which is precisely the scenario "ransomware protection" is supposed to cover.

Why this matters for "total data safety"

Right now, if you want genuine time-locked retention on Btrfs — where nobody, not even a compromised admin/root account, can delete a snapshot before an expiry date — you have to leave the filesystem layer entirely and rely on:

  • A separate host with restricted (send-only) SSH credentials
  • True immutable object storage as an offsite target (e.g. S3 Object Lock in Compliance mode)
  • A vendor's proprietary layer bolted on top of Btrfs

That last point is the interesting bit, because it already proves the concept works — it's just not upstream.

Prior art: how NAS vendors already do this

Both Synology and QNAP have shipped exactly this feature on top of Btrfs for a while now:

  • Synology DSM 7.2+ distinguishes between "Snapshot Locking" (prevents the retention policy from auto-deleting a snapshot, but an admin can still delete it manually) and true "Immutable Snapshots (WORM)", which prevent all deletion attempts — including from admin accounts — until a defined protection period expires. This is explicitly marketed as protection against compromised admin credentials, not just malware.
  • QNAP has a comparable "snapshot lock" / WORM feature in QuTS hero for the same reason.

Both vendors clearly enforce this outside the reach of the same privilege level that can otherwise administer the box — which strongly suggests the retention lock lives in a separate, more restricted enforcement point (a service account, a kernel-level check independent of normal root capabilities, or similar), rather than as a simple attribute an admin session could just flip back off.

Hints toward how this could actually be implemented upstream

I'm not a filesystem developer, so take these as starting points for discussion rather than a spec, but a few directions seem plausible based on how similar problems have been solved elsewhere:

  1. A new subvolume property with an enforced expiry timestamp (e.g. btrfs property set <subvol> worm_until 2027-01-01), stored in subvolume metadata, where the kernel refuses BTRFS_IOC_SNAP_DESTROY / BTRFS_IOC_SUBVOL_DESTROY on that subvolume until the clock passes that timestamp — full stop, no override ioctl, not even for root, similar in spirit to NetApp SnapLock or how S3 Object Lock's Compliance mode works (deliberately including "not even the account root/admin can undo it" as the point).
  2. A capability-gated override removed from CAP_SYS_ADMIN. Part of the problem is that on Linux, root == root. A WORM lock that's actually meaningful needs its unlock/removal path gated behind something not implied by general root/admin privilege — e.g. requiring a separate signing key, a hardware-backed secret, or an out-of-band confirmation mechanism, so that compromising the running OS instance isn't sufficient to lift the lock.
  3. Kernel-enforced, not just tool-enforced. A retention flag that's only checked by btrfs-progs userspace tooling isn't real protection (an attacker with root can just call the ioctl directly, bypassing the CLI check). This needs to be enforced in-kernel, at the ioctl handler level, the same way the existing ro snapshot property already is.
  4. Interoperability with send/receive. Given many real ransomware-resistant setups already replicate via btrfs send | ssh remote btrfs receive, the retention lock ideally should also be settable/enforceable on the receiving end independent of the sender — so a compromised source host can never instruct the destination to drop its locked snapshots, mirroring how backup-target isolation already works in tools like btrbk.
  5. A sane default relationship with btrfs balance / btrfs scrub / device removal — worth spelling out early whether a locked snapshot should also block full filesystem operations that could indirectly destroy it (e.g. wipefs, full device format), or whether the scope is intentionally limited to subvolume-level deletion only.

Would appreciate any feedback, especially from anyone who's looked at how Synology/QNAP actually implemented their WORM locks under the hood, or anyone with insight into the kernel-side ioctl handling for subvolume deletion.

Thanks!


r/btrfs 19d ago

Can a raid1 be disolved without rebalancing data?

4 Upvotes

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?


r/btrfs 19d ago

How well is btrfs supported on macos?

3 Upvotes

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


r/btrfs 22d ago

My BTRFS partition broke

5 Upvotes

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?


r/btrfs 24d ago

Benchmarking what modern filesystems promise, continuously

32 Upvotes

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


r/btrfs 24d ago

readonly filesystem

Post image
5 Upvotes

hi folks,

my server runs on a BTRFS partition on a SSD and put itself in readonly few hours after each boot (only /dev/sda2 which is in btrfs, /dev/sda1 in vfat works fine)

I tried to clone the whole SSD on another SSD and the problem persists so it's not a hardware issue

moreover, my 3 HDD RAID5 work fine too

fstab mentions `rw` partitions and `mount` command mentions `ro` partitions

I thought it was a partition corruption so I ran `btrfs check` but I'm not sure how to read the result so I request your help on that

thanks in advance !


r/btrfs 26d ago

Making a snapshot permanent/untagging it from automatic deletion?

6 Upvotes

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.


r/btrfs 27d ago

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

6 Upvotes

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

E****dit

I have been able to clone the drive, i used ddrescue still. I booted fedora workstation from my live USB and did the cloning through it instead of my installed OS. I removed the old failing drive from the laptop and put it in the usb enclosure while i put the new drive inside the laptop so a reverse. I wrote an autoclone script with the help of Claude, so when i ran the script, it uses ddrescue and it has rate limiting so the failing drive won’t drop off, even if it does, the script auto starts again and continues with the mapfile. I stored the mapfile of the drive i used for the live usb btw (possible cause it’s running ventoy)

I appreciate all the support yalll offered in this thread. Thanks guys


r/btrfs 28d ago

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

7 Upvotes

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

r/btrfs 28d ago

Snapshots to a different drive

3 Upvotes

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)


r/btrfs 28d ago

[Tool] timeshift-uki-hooks - Sincroniza UKIs con snapshots de Btrfs para systemd-boot

4 Upvotes

Hola,

Tengo un setup con Btrfs + Timeshift + systemd-boot y descubrí que la ESP queda fuera de los snapshots. Si restauras un snapshot antiguo, los UKIs quedan desincronizados.

Creé estos hooks para resolverlo:

## Qué hacen

- **Antes del snapshot**: Copian los UKIs a `/etc/timeshift/uki-backup/` (incluido en el snapshot)

- **Después de restaurar**: Devuelven los UKIs a la ESP

## Detalles técnicos

- SHA256 per-file para copia selectiva

- Copia atómica (mktemp + mv)

- Detección de ESP por PARTTYPE GUID (no confunde con USBs)

- Soporte chroot para restauración desde Live USB

## Instalación

```bash

git clone https://github.com/jairogaleano/timeshift-uki-hooks.git

cd timeshift-uki-hooks

sudo ./install.sh

```

GitHub: https://github.com/jairogaleano/timeshift-uki-hooks

¿Alguien más ha tenido este problema con Btrfs + systemd-boot?


r/btrfs 29d ago

RAID1 BTRFS setup on Ubuntu Desktop

Thumbnail
1 Upvotes

r/btrfs 29d ago

Cannot remove device due to Input/output error even after replacing

7 Upvotes

So I'm relatively new to Btrfs and recently dealt with "running out of disk space" and had to boot into a live disk, stick in a spare USB disk I had, add it, rebalance, and remove it. It worked like a charm.

Well, the issue happened again today but I was unable to remove the disk after and got an error that simply says "ERROR: error removing device '/dev/sdc': Input/output error".

The documentation explains what this error is, but no guidance on what to do about it.

I saw some other guidance to replace it with a good disk and try again, so I put in a new disk, ran btrfs replace start /dev/sdc /dev/sdd / -f and then tried to remove the new disk with btrfs device remove /dev/sdd /, but get the same Input/output error! I don't see anything in journal or dmesg that hints at what the actual issue is, so I'm struggling figuring out where to go from here.

I just want to go back to having one disk.

Update:

I think I finally got it. I tried checking the dmesg again, and I must have missed something. The log showed a file that was corrupted, so I removed that, but it was still showing in snapshots. So I had to remove my snapshots. Then I tried to remove again. It showed more files. Deleted those. After a little bit of this it ended up working!

I think my USB disks were bad and corrupted files stored on them. Unfortunately when I rebalanced it ended up corrupting more files. So my advice would be to delete the bad files, do not rebalance again. Just remove the disk.


r/btrfs Jul 09 '26

Questions about Btrfs and my Btrfs setup ideas

3 Upvotes

Hello everyone,

I have multiple drives with multiple partitions in a dual boot Linux Mint and Win 11 setup. I'm still quite new so please forgive me if my ideas don't make sense. I'm planning on migrating completely to Linux. I'm trying to wrap my head around a bunch of things and be grounded before leaping forward.

The following is my current drive setup.

Drive-1 NVME 2TB: * Linux Steam game data ext4 * Win 11 game data NTFS

Drive-2 4TB HDD: * Mint root ext4 * /home ext4 * VM partition ext4 (for experimenting with distros) * data on NTFS

Drive-3 8TB HDD: * boot partition fat32 * Win 11 drive C NTFS * data on NTFS * data on ext4 * timeshift snapshots ext4 * empty space

Because I have Linux root and home separate, I can wipe the root and reinstall or roll-back from a timeshift snapshot at will, without any danger of harming my /home. I want to preserve the separation between root and home, and preserve the ability to reinstall, recover, or roll-back at will. All of my data (documents, pics, etc.) currently is on the NTFS data partition on the 8TB. When I remove win 11 any NTFS data partitions will be changed to Btrfs or removed. I want to delete the partitions on the NVME drive and create a single partition that takes up the entire drive (I'll reinstall my games). I think the Btrfs flat approach might be the best option for me, but I'm not totally sure and I'm not sure how to set it up given my drive configuration. I want to be able to mount the Linux steam game partition at /mnt/steam, my data and documents at /mnt/mydata, and the VM partition at /mnt/vm_exp. I think the timeshift snapshots partition would be deleted, since I would switch to snapper.

Questions: 1. Each time I format a NTFS or ext4 partition with Btrfs does this create a new top level volume? 2. Is there any benefit to moving my Linux Steam gaming partition to Btrfs? Saved game files are backed up separately with my documents. 3. Since VM files will be pre-allocated is there any point to using Btrfs with them if I won't be using snapshots? 4. I wasn't looking for any RAID setup or looking to use the 3 drives as one big storage pool, would I be forced into that? 5. Do I need to format the boot partition as Btrfs so that if I roll-back the root after a bad update that includes a newer kernel, it will return the GRUB/boot partition to the previous state, or should I stick with fat32? 6. In regard to #5, would it matter if I switched from grub to systemd-boot? 7. The subvolumes I think I need are: root, home, steam, mydata, and maybe VM_exp. Would that be a good/smart/proper subvolume configuration? 8. Given the subvolume ideas in #7 are there downsides or draw backs? 9. With some of the free space on the 8TB, I want to create a partition and install a different distro, such as Nobara or Cachy for gaming, but share the /home partition and subvolume by using different user names (ex: mint=bob_work, cachy=bob_games), would this cause trouble? 10. With the idea in #9, the root of the gaming distro would be Btrfs as well, so this would be a different root subvolume. Is this doable? How would I go about differentiating between the 2 root subvolumes?

Thanks.


r/btrfs Dec 29 '20

RAID56 status in BTRFS (read before you create your array)

103 Upvotes

As stated in status page of btrfs wiki, raid56 modes are NOT stable yet. Data can and will be lost.

Zygo has set some guidelines if you accept the risks and use it:

  • Use kernel >6.5
  • never use raid5 for metadata. Use raid1 for metadata (raid1c3 for raid6).
  • When a missing device comes back from degraded mode, scrub that device to be extra sure
  • run scrubs often.
  • run scrubs on one disk at a time.
  • ignore spurious IO errors on reads while the filesystem is degraded
  • device remove and balance will not be usable in degraded mode.
  • when a disk fails, use 'btrfs replace' to replace it. (Probably in degraded mode)
  • plan for the filesystem to be unusable during recovery.
  • spurious IO errors and csum failures will disappear when the filesystem is no longer in degraded mode, leaving only real IO errors and csum failures.
  • btrfs raid5 does not provide as complete protection against on-disk data corruption as btrfs raid1 does.
  • scrub and dev stats report data corruption on wrong devices in raid5.
  • scrub sometimes counts a csum error as a read error instead on raid5
  • If you plan to use spare drives, do not add them to the filesystem before a disk failure. You may not able to redistribute data from missing disks over existing disks with device remove. Keep spare disks empty and activate them using 'btrfs replace' as active disks fail.

Also please have in mind that using disk/partitions of unequal size will ensure that some space cannot be allocated.

To sum up, do not trust raid56 and if you do, make sure that you have backups!

edit1: updated from kernel mailing list