# unable to mount btrfs

## Adel Ahmed

I had a raid 5 array of 3 disks using btrfs (raid provided by btrfs)

one of the disks was damaged and I replaced the disk via :

btrfs device add /dev/sdc /media/raid/

btrfs device delete missing /media/raid/

which forced a rebalance accross the disks, after which the FS was fine

one reboot later:

[11152.188020] BTRFS info (device sdb): enabling auto defrag

[11152.188028] BTRFS info (device sdb): disk space caching is enabled

[11152.189762] BTRFS: failed to read chunk tree on sdb

[11152.196224] BTRFS: open_ctree failed

pc ~ # mount -a 

mount: wrong fs type, bad option, bad superblock on /dev/sde,

       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try

       dmesg | tail or so.

the OS started by commenting out that line in fstab, I've uncommented that line afterwards

LABEL="raid"    /media/raid             btrfs   compress=lzo,noatime,autodefrag

----------

## massimo

Does it mount when adding degraded to mount options?

----------

## Adel Ahmed

no  :Sad: 

I've tried btrfs rescue chunk-recover /dev/sdb -v

got plenty of :

	Chunk: start = 1461400371200, len = 2147483648, type = 81, num_stripes = 3

	    Stripes list:

	    [ 0] Stripe: devid = 4, offset = 299575017472

	    [ 1] Stripe: devid = 3, offset = 119194779648

	    [ 2] Stripe: devid = 1, offset = 119214702592

	Chunk: start = 1463547854848, len = 2147483648, type = 81, num_stripes = 3

	    Stripes list:

	    [ 0] Stripe: devid = 4, offset = 300648759296

	    [ 1] Stripe: devid = 3, offset = 118121037824

	    [ 2] Stripe: devid = 1, offset = 118140960768

	Chunk: start = 1465695338496, len = 2147483648, type = 81, num_stripes = 3

	    Stripes list:

	    [ 0] Stripe: devid = 4, offset = 301722501120

	    [ 1] Stripe: devid = 3, offset = 117047296000

	    [ 2] Stripe: devid = 1, offset = 117067218944

and plenty of:

	Device extent: devid = 4, start = 413391650816, len = 1073741824, chunk offset = 1689033637888

	Device extent: devid = 4, start = 414465392640, len = 1073741824, chunk offset = 1691181121536

	Device extent: devid = 4, start = 415539134464, len = 1073741824, chunk offset = 1693328605184

but ended with:

Floating point exception

----------

## ATpwwu

just restore from backup

----------

## Adel Ahmed

I have no backup, I was hoping raid 5 would protect me from all this

----------

## ct85711

raid systems are not a replacement for a backup.  A raid is only there to provide some redundancy in case of a hardware failure.  Raid 0 is an exception in that it provides no redundancy either.  Most times, the other raids may protect you from 1-2 device failures (depending on raid level, and number of devices) and could still end up causing you to loose everything (when rebuilding the raid, causing more drives to die)

----------

## Adel Ahmed

well is there anyway to recover the raid?

if not, any way to recover the data?

----------

## massimo

Did you try to run btrfs check --repair /dev/sdb? If all fails try to get help at the btrfs mailing list.

----------

## Adel Ahmed

enabling repair mode

warning, device 4 is missing

checksum verify failed on 1699771072512 found 35F941C0 wanted D11AFC76

checksum verify failed on 1699771072512 found 35F941C0 wanted D11AFC76

bytenr mismatch, want=1699771072512, have=65536

Couldn't read chunk root

Couldn't open file system

----------

## Adel Ahmed

any way I can at least recover the data on the device?

pc ~ # btrfs restore /dev/sdb /media/hdd/ -o

warning devid 2 not found already

parent transid verify failed on 1699771121664 wanted 270069 found 270891

parent transid verify failed on 1699771121664 wanted 270069 found 270891

checksum verify failed on 1699771121664 found 267F2F7E wanted C29C92C8

parent transid verify failed on 1699771121664 wanted 270069 found 270891

Ignoring transid failure

Error mapping block -2

Error copying data for /media/hdd/downloads/The.Butterfly.Effect.2004.DC.1080p.BluRay.AAC.x264-tomcat12[ETRG]/Torrent Downloaded From ExtraTorrent.cc.txt

Error searching /media/hdd/downloads/The.Butterfly.Effect.2004.DC.1080p.BluRay.AAC.x264-tomcat12[ETRG]/Torrent Downloaded From ExtraTorrent.cc.txt

Error searching /media/hdd/downloads/The.Butterfly.Effect.2004.DC.1080p.BluRay.AAC.x264-tomcat12[ETRG]/Torrent Downloaded From ExtraTorrent.cc.txt

----------

