Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

File Corruption after adding drive to BTRFS pool and converting to Raid0

Featured Replies

Hello!

Unfortunately I messed up when wanting to add a 1TB drive to my single drive 2TB btrfs pool. As I was running low on storage (only about 20GB left) I wanted to simply extend the pool by 1TB but when adding the drive Unraid converted it to Raid1 mode.

The WebUI now showed 1.5TB capacity even though I had more than 1.5TB on the first drive to begin with and looking at the balance status showed, that 1TB of the data is in Raid1 (maxxing out the new drive) and the rest on the old drive is in single mode.

As I wanted to use all storage, I tried to convert the pool to Raid0 using the WebUI, but the action just wouldn't start. Only after running a smart test on both drives, restarting the array and then waiting for a while did the conversion start.

Unfortunately this didn't seem to work, as the pool would not only be mounted as Read Only. Later I figured this was probably due to insufficient space on the drives, indicated by the error logs:

Jul 25 03:59:33 cassiopeia kernel: BTRFS info (device sdg1 state A): dumping space info:

Jul 25 03:59:33 cassiopeia kernel: BTRFS info (device sdg1 state A): space_info DATA has 1023295758336 free, is not full

Jul 25 03:59:33 cassiopeia kernel: BTRFS info (device sdg1 state A): space_info total=2957109493760, used=1933813538816, pinned=0, reserved=0, may_use=0, readonly=196608 zone_unusable=0

Jul 25 03:59:33 cassiopeia kernel: BTRFS info (device sdg1 state A): space_info METADATA has -187809792 free, is full

Jul 25 03:59:33 cassiopeia kernel: BTRFS info (device sdg1 state A): space_info total=4261412864, used=2719416320, pinned=475136, reserved=17121280, may_use=918077440, readonly=794132480 zone_unusable=0

Jul 25 03:59:33 cassiopeia kernel: BTRFS info (device sdg1 state A): space_info SYSTEM has 41664512 free, is not full

Jul 25 03:59:33 cassiopeia kernel: BTRFS info (device sdg1 state A): space_info total=41943040, used=278528, pinned=0, reserved=0, may_use=0, readonly=0 zone_unusable=0

Jul 25 03:59:33 cassiopeia kernel: BTRFS info (device sdg1 state A): global_block_rsv: size 536870912 reserved 536870912

Jul 25 03:59:33 cassiopeia kernel: BTRFS info (device sdg1 state A): trans_block_rsv: size 0 reserved 0

Jul 25 03:59:33 cassiopeia kernel: BTRFS info (device sdg1 state A): chunk_block_rsv: size 0 reserved 0

Jul 25 03:59:33 cassiopeia kernel: BTRFS info (device sdg1 state A): delayed_block_rsv: size 0 reserved 0

Jul 25 03:59:33 cassiopeia kernel: BTRFS info (device sdg1 state A): delayed_refs_rsv: size 55166631936 reserved 377012224

Jul 25 03:59:33 cassiopeia kernel: BTRFS: error (device sdg1 state A) in btrfs_run_delayed_refs:2215: errno=-28 No space left

Jul 25 03:59:33 cassiopeia kernel: BTRFS info (device sdg1 state EA): forced readonly

Jul 25 03:59:33 cassiopeia kernel: BTRFS info (device sdg1 state EA): balance: ended with status: -30

As everything was kinda messed up, I just decided to copy all data from the pool over to my array and then format the drives and start fresh.

Unfortunately I got thousands of errors during the copy process, like this: cpg: error reading '/path/to/file/image.JPG': Input/output error

As a result, thousands of images couldn't be copied and have 0B as size on the array, and for many images that seem to be openable correctly, their previews are corrupted.

During the copy process I got log lines like this:

Jul 25 07:47:07 cassiopeia kernel: BTRFS error (device sdg1 state EA): level verify failed on logical 2543208398848 mirror 1 wanted 1 found 0
Jul 25 07:47:07 cassiopeia kernel: BTRFS error (device sdg1 state EA): level verify failed on logical 2543208398848 mirror 2 wanted 1 found 0
Jul 25 07:47:07 cassiopeia kernel: BTRFS error (device sdg1 state EA): level verify failed on logical 2543208398848 mirror 1 wanted 1 found 0
Jul 25 07:47:07 cassiopeia kernel: BTRFS error (device sdg1 state EA): level verify failed on logical 2543208398848 mirror 2 wanted 1 found 0
Jul 25 07:47:08 cassiopeia kernel: _btrfs_printk: 68 callbacks suppressed

Is there any possibility to save the btrfs config and restore the corrupted files? They are very important to me.

Thank you so much for your help!

cassiopeia-diagnostics-20260725-1502.zip

Edited by mephisto1335

  • Community Expert

It's normal for the balance to fail with not enough space, but that should not corrupt data, possibly an unrelated issue.

See if you can mount the pool with skip_balance, and if yes, scrub it and post the results.

With the array stopped type

mkdir /x

mount -t btrfs -o skip_balance /dev/sdg1 /x

the type

btrfs balance cancel /x

umount /x

Then restart the array and post new diags.

  • Author

Thanks for your reply!

I ran the code you provided and after restarting the array the btrfs scrub reported no errors.

This is the status after running:

UUID:             5c65006f-a1d4-41c0-8546-2c48b83f3e81
Scrub started:    Sun Jul 26 01:11:30 2026
Status:           finished
Duration:         0:54:24
Total to scrub:   1.76TiB
Rate:             566.61MiB/s
Error summary:    no errors found

But apparently this only checked the /dev/sdg1 not /dev/nvme0n1p1.

btrfs file system usage now reports this:

Overall:
    Device size:		   2.73TiB
    Device allocated:		   1.78TiB
    Device unallocated:		 967.49GiB
    Device missing:		     0.00B
    Device slack:		     0.00B
    Used:			   1.76TiB
    Free (estimated):		 985.51GiB	(min: 501.76GiB)
    Free (statfs, df):		 985.51GiB
    Data ratio:			      1.00
    Metadata ratio:		      2.00
    Global reserve:		 512.00MiB	(used: 0.00B)
    Multiple profiles:		       yes	(data, metadata, system)

                  Data      Data      Metadata Metadata  System    System                              
Id Path           single    RAID0     RAID1    DUP       RAID1     DUP      Unallocated Total     Slack
-- -------------- --------- --------- -------- --------- --------- -------- ----------- --------- -----
 1 /dev/sdg1      494.00GiB 663.51GiB  1.97GiB   4.00GiB  32.00MiB 16.00MiB   699.49GiB   1.82TiB     -
 2 /dev/nvme0n1p1         - 661.51GiB  1.97GiB         -  32.00MiB        -   268.00GiB 931.51GiB     -
-- -------------- --------- --------- -------- --------- --------- -------- ----------- --------- -----
   Total          494.00GiB   1.29TiB  1.97GiB   2.00GiB  32.00MiB  8.00MiB   967.49GiB   2.73TiB 0.00B
   Used           478.70GiB   1.29TiB  1.95GiB 594.22MiB 160.00KiB 32.00KiB                 

Now a test transfer of a subfolder (~2000 files, 20GB) which definetly had input/output errors during the last copies ran just fine.

I'll run another full copy of the files over the night and report the results.

What would be the safest way to now fully convert the Pool (Data/Metadata/System) to Raid0/Single, so that I can use the full 3TB?

Would you recommend Single or Raid0 for my purposes?

Thanks!

cassiopeia-diagnostics-20260726-0210.zip

  • Community Expert
5 hours ago, mephisto1335 said:

But apparently this only checked the /dev/sdg1 not /dev/nvme0n1p1.

It will check the whole pool.

With different-sized devices btrfs can now use raid0, but not sure that was supported with the kernel in 7.2, so best to use single, with the array running type

btrfs balance start -dconvert=single,soft -mconvert=raid1,soft /mnt/home

Any there are any issues during the balance and it aborts, post new diags.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.