teketeke_55の日記

技術メモとか

btrfs使ってるfedoraが起動失敗

fedora19でrootボリュームにbtrfsを使っているのだが、電源が落ちて強制終了後にOS起動が失敗するようになった。

レスキューモードで起動してマウントを試みたところ以下のエラーが。

# sudo mount -t btrfs /dev/sdb /mnt/sysimage
mount: wrong fs type, bad option, bad superblock on /dev/sdb,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

demsgには、

[ 1043.660260] BTRFS error (device sdb) in open_ctree:2816: errno=-22 unknown (Failed to recover log tree)

logtreeが壊れている?

ひとまずrepairを試みてみる。

# btrfsck --repair /dev/sdb
enabling repair mode
Checking filesystem on /dev/sdb
UUID: 9a1ef990-cd73-4b98-b57d-72901991e064
checking extents
checking free space cache
cache and super generation don't match, space cache will be invalidated
checking fs roots
checking csums
checking root refs
found 3945306293 bytes used err is 0
total csum bytes: 11398148
total tree bytes: 382119936
total fs tree bytes: 346251264
total extent tree bytes: 20398080
btree space waste bytes: 111504768                                                                                       
file data blocks allocat                                                                                                 

まだ同じメッセージが出てマウントできない。
logを作り直してみる。

# btrfs-zero-log /dev/sdb   


今度はうまくマウントできた。
中身も無事な模様。
log作り直してるのでどこかおかしいかもしれないけどまあ何とかなるだろう。。。


参考ページ;
https://btrfs.wiki.kernel.org/index.php/Problem_FAQ