You are not logged in.

#1 2013-09-07 12:22:28

sounonyma
Member
Registered: 2012-06-24
Posts: 9

[solved]BTRFS input output error

Hello;
I have my /home partition in BTRFS but after a bug/reboot I couldn't mount BTRFS anymore.
I searched on the net and after using btrfs-zero-log I am now able to mount the partition.

But once mounted, all the files are unreadable due to Input/output error

If I run btrfsck on the partition I get:

>btrfsck /dev/sda7 
Checking filesystem on /dev/sda7
UUID: f7538cea-035a-487c-a191-072caca4b0bd
checking extents
checking extents
ref mismatch on [4444160 4096] extent item 1, found 0
Backref 4444160 root 7 not referenced back 0x239a910
Incorrect global backref count on 4444160 found 1 wanted 0
backpointer mismatch on [4444160 4096]
owner ref check failed [4444160 4096]
ref mismatch on [4444160 4096] extent item 1, found 0
Backref 4444160 root 7 not referenced back 0x239a910
Incorrect global backref count on 4444160 found 1 wanted 0
backpointer mismatch on [4444160 4096]
owner ref check failed [4444160 4096]
Errors found in extent allocation tree
checking fs roots
Errors found in extent allocation tree
checking fs roots
root 5 inode 357 errors 1000
root 5 inode 361 errors 1000
root 5 inode 362 errors 1000
root 5 inode 365 errors 1000
root 5 inode 366 errors 1000
root 5 inode 367 errors 1000
root 5 inode 368 errors 1000

....etc

root 5 inode 456157 errors 1000
root 5 inode 456159 errors 1000
root 5 inode 456162 errors 1000
root 5 inode 456165 errors 1000
found 72200581120 bytes used err is 1
total csum bytes: 0
total tree bytes: 229040128
total fs tree bytes: 197218304
btree space waste bytes: 59215437
file data blocks allocated: 958185730048
 referenced 75833200640
Btrfs v0.20-rc1-253-g7854c8b

Last edited by sounonyma (2013-09-08 06:21:04)

Offline

#2 2013-09-07 20:34:27

andy123
Member
Registered: 2011-11-04
Posts: 169
Website

Re: [solved]BTRFS input output error

What about "mount -o recovery" or "btrfsck --repair"? Are you using the latest btrfs-progs from git? Also, btrfs has its own wiki, that might be helpful…


i'm sorry for my poor english wirting skills…

Offline

#3 2013-09-07 20:48:30

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [solved]BTRFS input output error

Read the btrfs wiki.  You should be doing this anyway if you have chosen to use btrfs.  An alternative to using the btrfs-progs from git (which is easy with WorMzy's btrfs-progs-git from the AUR) you could just use the [testing] version, as Tom Gunderson has updated it just yesterday… or maybe two days ago.

I follow the linux-btrfs mailing list.  Much of it is patch submission that is pretty far over my head.  But there is also general support and discussion that is quite interesting and valuable as well.  Just recently, it was asked what the process for recovery/repair should be, since it is often indicated that btrfsck (or btrfs check) should be towards the end of the recovery options.  Here was Hugo Mill's response:

Hugo Mills, on the linux-btrfs mailing list wrote:

On Mon, Aug 26, 2013 at 01:10:54PM -0600, Chris Murphy wrote:
>
> On Aug 26, 2013, at 11:41 AM, Nick Lee <email@nickle.es> wrote:
>
> > There was a discussion on IRC a few days ago that the problem with the tree root's bloco was likely the result of either an issue with the disk itself, or the chunk tree/logical mappings. I ran the chunk recover, looked over the errors it found, and hit write. (If it failed, I was going to run something photorec, loss of organization as a side effect.)
> >
> > I can write something more clear after my flight lands tomorrow if you want.

> I'm just curious about when to use various techniques: -o recovery,
> btrfsck, chunk-recover, zero log.

   Let's assume that you don't have a physical device failure (which
is a different set of tools -- mount -odegraded, btrfs dev del
missing).

   First thing to do is to take a btrfs-image -c9 -t4 of the
filesystem, and keep a copy of the output to show josef. smile

   Then start with -orecovery and -oro,recovery for pretty much
anything.

   If those fail, then look in dmesg for errors relating to the log
tree -- if that's corrupt and can't be read (or causes a crash), use
btrfs-zero-log.

   If there's problems with the chunk tree -- the only one I've seen
recently was reporting something like "can't map address" -- then
chunk-recover may be of use.

   After that, btrfsck is probably the next thing to try. If options
-s1, -s2, -s3 have any success, then btrfs-select-super will help by
replacing the superblock with one that works. If that's not going to
be useful, fall back to btrfsck --repair.

   Finally, btrfsck --repair --init-extent-tree may be necessary if
there's a damaged extent tree. Finally, if you've got corruption in
the checksums, there's --init-csum-tree.

   Hugo.


Edit: It should be noted that WorMzy's btrfs-progs-git package just builds the main tools (just a simple "make"), but there are other tools available that can be built from the git checkout.  One of these tools is actually the btrfs-select-super that is mentioned above.  Tom Gunderson has chosen to include this in the [testing] package.

Last edited by WonderWoofy (2013-09-07 20:51:43)

Offline

#4 2013-09-08 06:20:34

sounonyma
Member
Registered: 2012-06-24
Posts: 9

Re: [solved]BTRFS input output error

Well I used the git version but that didn't help;
But I finally found a way to recover the data (by using btrfs restore )
So I guess it's solved.
Thank you for your time

Offline

Board footer

Powered by FluxBB