btrfs磁區壞軌檔案救援 - Linux

By Yuri
at 2018-05-11T22:31
at 2018-05-11T22:31
Table of Contents
問題大概是這樣,個人有個1TB硬碟平分成兩個磁區,分別代稱A和B好了
之前用到一半突然變成唯獨,重開檢查以後發現壞軌,B可以唯獨掛載後備份檔案
把B用badblock掃過之後再用低階格式化後已無壞軌
A則仍然無法掛載,所以用dd把A整個備份到原先B的位置嘗試修復,但是仍然無法掛載
qoopichu@QP-P2P:~$ sudo mount -o recovery,ro /dev/sdb1 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
missing codepage or helper program, or other error
qoopichu@QP-P2P:~$ dmesg | tail
[749736.867905] BTRFS info (device sdb1): enabling auto recovery
[749736.867914] BTRFS info (device sdb1): disk space caching is enabled
[749736.867917] BTRFS: has skinny extents
[749736.915400] BTRFS info (device sdb1): bdev /dev/sdb1 errs: wr 205, rd 6,
flush 0, corrupt 0, gen 0
[749736.927646] BTRFS error (device sdb1): parent transid verify failed on
900661248 wanted 48881 found 48633
[749736.934362] BTRFS error (device sdb1): parent transid verify failed on
900661248 wanted 48881 found 48633
嘗試使用btrfs的相關指令修復
qoopichu@QP-P2P:~$ sudo btrfs check --repair /dev/sdb1
enabling repair mode
Checking filesystem on /dev/sdb1
UUID: 0a46f8a2-1d00-4dbd-82b6-5ed7cc0aa46e
checking extents
parent transid verify failed on 841056256 wanted 48852 found 48591
parent transid verify failed on 841056256 wanted 48852 found 48591
parent transid verify failed on 843628544 wanted 48852 found 48593
parent transid verify failed on 843628544 wanted 48852 found 48593
parent transid verify failed on 843628544 wanted 48852 found 48593
parent transid verify failed on 843628544 wanted 48852 found 48593
Ignoring transid failure
bad block 843628544
Errors found in extent allocation tree or chunk allocation
Fixed 0 roots.
checking free space cache
cache and super generation don't match, space cache will be invalidated
checking fs roots
root 5 missing its root dir, recreating
Failed to find [29573120, 168, 16384]
btrfs unable to find ref byte nr 900956160 parent 0 root 5 owner 2 offset 0
parent transid verify failed on 900661248 wanted 48881 found 48633
parent transid verify failed on 900661248 wanted 48881 found 48633
parent transid verify failed on 900661248 wanted 48881 found 48633
parent transid verify failed on 900661248 wanted 48881 found 48633
Ignoring transid failure
Failed to find [29573120, 168, 16384]
btrfs unable to find ref byte nr 900661248 parent 0 root 5 owner 1 offset 1
cmds-check.c:2965: check_inode_recs: Assertion `ret` failed.
btrfs[0x41e6f5]
btrfs[0x41e719]
btrfs[0x40dc5b]
btrfs(cmd_check+0x172a)[0x425c82]
btrfs(main+0x139)[0x40ec30]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f3de809c830]
btrfs(_start+0x29)[0x40ec69]
qoopichu@QP-P2P:~$ sudo btrfs restore -v /dev/sdb1 ./
parent transid verify failed on 900661248 wanted 48881 found 48633
parent transid verify failed on 900661248 wanted 48881 found 48633
parent transid verify failed on 900661248 wanted 48881 found 48633
parent transid verify failed on 900661248 wanted 48881 found 48633
Ignoring transid failure
Error searching -1
qoopichu@QP-P2P:~$ sudo btrfs rescue zero-log /dev/sdb1
Clearing log on /dev/sdb1, previous log_root 0, level 0
qoopichu@QP-P2P:~$ sudo btrfs rescue super-recover /dev/sdb1
All supers are valid, no need to recover
不管跑啥看起來log都差不多,chunk-recovery也跑過好像沒啥用
請問這樣還能做什麼嗎?
--
--
之前用到一半突然變成唯獨,重開檢查以後發現壞軌,B可以唯獨掛載後備份檔案
把B用badblock掃過之後再用低階格式化後已無壞軌
A則仍然無法掛載,所以用dd把A整個備份到原先B的位置嘗試修復,但是仍然無法掛載
qoopichu@QP-P2P:~$ sudo mount -o recovery,ro /dev/sdb1 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
missing codepage or helper program, or other error
qoopichu@QP-P2P:~$ dmesg | tail
[749736.867905] BTRFS info (device sdb1): enabling auto recovery
[749736.867914] BTRFS info (device sdb1): disk space caching is enabled
[749736.867917] BTRFS: has skinny extents
[749736.915400] BTRFS info (device sdb1): bdev /dev/sdb1 errs: wr 205, rd 6,
flush 0, corrupt 0, gen 0
[749736.927646] BTRFS error (device sdb1): parent transid verify failed on
900661248 wanted 48881 found 48633
[749736.934362] BTRFS error (device sdb1): parent transid verify failed on
900661248 wanted 48881 found 48633
嘗試使用btrfs的相關指令修復
qoopichu@QP-P2P:~$ sudo btrfs check --repair /dev/sdb1
enabling repair mode
Checking filesystem on /dev/sdb1
UUID: 0a46f8a2-1d00-4dbd-82b6-5ed7cc0aa46e
checking extents
parent transid verify failed on 841056256 wanted 48852 found 48591
parent transid verify failed on 841056256 wanted 48852 found 48591
parent transid verify failed on 843628544 wanted 48852 found 48593
parent transid verify failed on 843628544 wanted 48852 found 48593
parent transid verify failed on 843628544 wanted 48852 found 48593
parent transid verify failed on 843628544 wanted 48852 found 48593
Ignoring transid failure
bad block 843628544
Errors found in extent allocation tree or chunk allocation
Fixed 0 roots.
checking free space cache
cache and super generation don't match, space cache will be invalidated
checking fs roots
root 5 missing its root dir, recreating
Failed to find [29573120, 168, 16384]
btrfs unable to find ref byte nr 900956160 parent 0 root 5 owner 2 offset 0
parent transid verify failed on 900661248 wanted 48881 found 48633
parent transid verify failed on 900661248 wanted 48881 found 48633
parent transid verify failed on 900661248 wanted 48881 found 48633
parent transid verify failed on 900661248 wanted 48881 found 48633
Ignoring transid failure
Failed to find [29573120, 168, 16384]
btrfs unable to find ref byte nr 900661248 parent 0 root 5 owner 1 offset 1
cmds-check.c:2965: check_inode_recs: Assertion `ret` failed.
btrfs[0x41e6f5]
btrfs[0x41e719]
btrfs[0x40dc5b]
btrfs(cmd_check+0x172a)[0x425c82]
btrfs(main+0x139)[0x40ec30]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f3de809c830]
btrfs(_start+0x29)[0x40ec69]
qoopichu@QP-P2P:~$ sudo btrfs restore -v /dev/sdb1 ./
parent transid verify failed on 900661248 wanted 48881 found 48633
parent transid verify failed on 900661248 wanted 48881 found 48633
parent transid verify failed on 900661248 wanted 48881 found 48633
parent transid verify failed on 900661248 wanted 48881 found 48633
Ignoring transid failure
Error searching -1
qoopichu@QP-P2P:~$ sudo btrfs rescue zero-log /dev/sdb1
Clearing log on /dev/sdb1, previous log_root 0, level 0
qoopichu@QP-P2P:~$ sudo btrfs rescue super-recover /dev/sdb1
All supers are valid, no need to recover
不管跑啥看起來log都差不多,chunk-recovery也跑過好像沒啥用
請問這樣還能做什麼嗎?
--
推 yeangigi : 88虎:我是上線來做功德的.....01/04 19:12
推 apple00 : KV5:我是重坦裡最軟的一塊01/04 19:30
推 ccc101419 : CDC:我們相信自走砲會自律01/04 19:47
推 MyBIGteeth : 40t:我證明了pay=win01/04 19:50
推 benny70104 : is-6:我是來做功德的01/04 20:13
→ colapola : 1357:你要自己去跟WG談啊~公雞變飼主耶01/04 20:40
--
Tags:
Linux
All Comments

By Iris
at 2018-05-13T04:02
at 2018-05-13T04:02

By Jessica
at 2018-05-13T07:40
at 2018-05-13T07:40

By James
at 2018-05-13T13:33
at 2018-05-13T13:33

By Kelly
at 2018-05-14T13:26
at 2018-05-14T13:26

By Hedwig
at 2018-05-15T16:00
at 2018-05-15T16:00

By Hedda
at 2018-05-17T23:19
at 2018-05-17T23:19

By Mason
at 2018-05-18T11:01
at 2018-05-18T11:01
Related Posts
CentOS 安裝硬碟分配請教

By Donna
at 2018-05-11T16:14
at 2018-05-11T16:14
在共用主機上安裝東西 不動到其他人

By Elma
at 2018-05-09T18:04
at 2018-05-09T18:04
開機畫面theme跑不出來

By Lauren
at 2018-05-08T17:30
at 2018-05-08T17:30
神奇的機房技術!?

By Ina
at 2018-05-07T13:49
at 2018-05-07T13:49
安裝elementary一直卡在logo

By Frederic
at 2018-05-05T13:59
at 2018-05-05T13:59