You are not logged in.

#1 2015-06-15 03:50:45

lawliet
Member
Registered: 2010-08-29
Posts: 18

[SOLVED] How to repair broken btrfs of raid1

Hi guys,

I got some error of my btrs raid1

can help me to fix(or mount) the only one hard disk, i want mount without raid after backup my data to other disk.

my root not in the btrfs raid1, so my arch still working

# dmesg | tail
[ 8199.287231] BTRFS: failed to read the system array on sdb
[ 8199.304945] BTRFS: open_ctree failed
[ 8407.417160] BTRFS info (device sdb): disk space caching is enabled
[ 8407.417163] BTRFS: has skinny extents
[ 8407.417410] BTRFS: failed to read the system array on sdb
[ 8407.431167] BTRFS: open_ctree failed
[ 8435.776296] BTRFS info (device sdb): disk space caching is enabled
[ 8435.776300] BTRFS: has skinny extents
[ 8435.776538] BTRFS: failed to read the system array on sdb
[ 8435.791537] BTRFS: open_ctree failed
# btrfs filesystem show
warning, device 1 is missing
warning devid 1 not found already
Label: none  uuid: 003eca6f-e284-4a99-844d-528d95e4f256
        Total devices 2 FS bytes used 31.95GiB
        devid    2 size 1.82TiB used 34.03GiB path /dev/sdb
        *** Some devices missing

if need more information, please let me know, this my first time using btrfs

thanks lot

Last edited by lawliet (2015-06-18 09:49:27)

Offline

#2 2015-06-15 12:14:11

nstgc
Member
Registered: 2014-03-17
Posts: 393

Re: [SOLVED] How to repair broken btrfs of raid1

btrfs-zero-log

Offline

#3 2015-06-16 01:02:31

lawliet
Member
Registered: 2010-08-29
Posts: 18

Re: [SOLVED] How to repair broken btrfs of raid1

# btrfs-zero-log
btrfs-zero-log: too few arguments
usage: btrfs-zero-log dev
btrfs-progs v4.0.1
# btrfs-zero-log dev
check_mounted(): Could not open dev
Could not check mount status: No such file or directory

Offline

#4 2015-06-16 12:27:25

nstgc
Member
Registered: 2014-03-17
Posts: 393

Re: [SOLVED] How to repair broken btrfs of raid1

https://btrfs.wiki.kernel.org/index.php/Btrfs-zero-log

[edit] Also, if someone just tells you a command, it's best not to just blindly use it, especially if you are going to run it as root. You can usually find out what a command does with "command --help" or "man command".

Try running "man btrfs-zero-log".

Last edited by nstgc (2015-06-16 12:30:46)

Offline

#5 2015-06-16 12:33:23

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,570
Website

Re: [SOLVED] How to repair broken btrfs of raid1

Disregard btrfs-zero-log for now. Can you mount with -odegraded? From 'man mount':

Mount options for btrfs
[...]
       degraded
              Allow mounts to continue with missing devices.  A read-write mount  may  fail  with
              too many devices missing, for example if a stripe member is completely missing.

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#6 2015-06-17 01:37:11

lawliet
Member
Registered: 2010-08-29
Posts: 18

Re: [SOLVED] How to repair broken btrfs of raid1

ok, thank you for you help

this is the btrfs-zero-log messenger

# btrfs-zero-log /dev/sdb
warning, device 1 is missing
warning devid 1 not found already
Unable to find block group for 0
extent-tree.c:289: find_search_start: Assertion `1` failed.
btrfs-zero-log[0x41139e]
btrfs-zero-log(btrfs_reserve_extent+0xa35)[0x4161a5]
btrfs-zero-log(btrfs_alloc_free_block+0x5f)[0x41626f]
btrfs-zero-log(__btrfs_cow_block+0xc1)[0x408211]
btrfs-zero-log(btrfs_cow_block+0x35)[0x408825]
btrfs-zero-log[0x40d666]
btrfs-zero-log(btrfs_commit_transaction+0x8e)[0x40ee7e]
btrfs-zero-log(main+0x122)[0x4073f2]
/usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7f56565f7790]
btrfs-zero-log(_start+0x29)[0x407509]
WorMzy wrote:

Disregard btrfs-zero-log for now. Can you mount with -odegraded? From 'man mount':

Mount options for btrfs
[...]
       degraded
              Allow mounts to continue with missing devices.  A read-write mount  may  fail  with
              too many devices missing, for example if a stripe member is completely missing.

hi,

mount with -odegraded no got any messenger, and check df -h, mount failed i guess

Offline

#7 2015-06-17 07:45:46

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,570
Website

Re: [SOLVED] How to repair broken btrfs of raid1

Post the output of dmesg following a failed degraded mount, and hope zero-log didn't cause more problems.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#8 2015-06-17 10:12:50

lawliet
Member
Registered: 2010-08-29
Posts: 18

Re: [SOLVED] How to repair broken btrfs of raid1

WorMzy wrote:

Post the output of dmesg following a failed degraded mount, and hope zero-log didn't cause more problems.

[205147.095483] BTRFS info (device sdb): allowing degraded mounts
[205147.095486] BTRFS info (device sdb): disk space caching is enabled
[205147.095488] BTRFS: has skinny extents
[205147.124706] BTRFS: bdev (null) errs: wr 25, rd 2, flush 1, corrupt 0, gen 0

Offline

#9 2015-06-17 10:39:19

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,570
Website

Re: [SOLVED] How to repair broken btrfs of raid1

I think that (null) with write and read errors is the missing disk. It shouldn't be blocking the mount. Arte you sure that it's not mounted following that?

Try mounting with -oro,degraded,recovery.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#10 2015-06-18 07:13:04

lawliet
Member
Registered: 2010-08-29
Posts: 18

Re: [SOLVED] How to repair broken btrfs of raid1

WorMzy wrote:

I think that (null) with write and read errors is the missing disk. It shouldn't be blocking the mount. Arte you sure that it's not mounted following that?

Try mounting with -oro,degraded,recovery.

Hi,

Thank you very mush, my hard disk can mountd now

i dont know why yesterday cant mount it

but my data look is well, can read/write

if my using new hard disk replace the broken hard disk

how am i rebuild the btrfs raid1?


thanks, have a nice day

Offline

#11 2015-06-18 09:45:38

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,570
Website

Re: [SOLVED] How to repair broken btrfs of raid1

You should just need to use "btrfs device add" to add the new device to the array, then remove the missing device.

https://btrfs.wiki.kernel.org/index.php … ed_devices


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#12 2015-12-12 22:22:53

Bfg
Member
From: Italy
Registered: 2004-04-03
Posts: 15

Re: [SOLVED] How to repair broken btrfs of raid1

WorMzy wrote:

Disregard btrfs-zero-log for now. Can you mount with -odegraded? From 'man mount':

Mount options for btrfs
[...]
       degraded
              Allow mounts to continue with missing devices.  A read-write mount  may  fail  with
              too many devices missing, for example if a stripe member is completely missing.

Thankyou WorMzy. Has worked also to me. smile

Offline

Board footer

Powered by FluxBB