PR

[Linux] XFS / スーパーブロックを修復

FAT かNTFS だろうと思っていたハードディスクは、どういうわけかLinux (XFS 6.2+)だった。そしてKNOPPIX からマウントしようと思ったら、スーパーブロックが論理障害らしいので修復した。

mount: /dev/sde1: can't read superblock

スーパーブロック(英: Superblock, Super block)とはファイルシステムの論理パーティションを管理するためのメタデータ(「スーパーブロック (ファイルシステム) – Wikipedia」より引用)

スポンサードリンク

XFS のチェック

knoppix@Microknoppix:~$ xfs_check /dev/sde1

ERROR: The filesystem has valuable metadata changes in a log which needs to
be replayed.  Mount the filesystem to replay the log, and unmount it before
re-running xfs_check.  If you are unable to mount the filesystem, then use
the xfs_repair -L option to destroy the log and attempt a repair.
Note that destroying the log may cause corruption -- please attempt a mount
of the filesystem before doing this.

んー。やはり参考文献同様のエラーのようだ。

XFS の修復

knoppix@Microknoppix:~$ xfs_repair -Lv /dev/sde1

xfs_repair: warning - cannot set blocksize 512 on block device /dev/sde1: 許可がありません
Phase 1 - find and verify superblock...
        - block cache size set to 240976 entries
Phase 2 - using internal log
        - zero log...
zero_log: head block 109150 tail block 109146
ALERT: The filesystem has valuable metadata changes in a log which is being
destroyed because the -L option was used.
 :
 :

修復コマンドを送ろうとしたところ、sudo を忘れた・・。

knoppix@Microknoppix:~$ sudo xfs_repair -Lv /dev/sde1

Phase 1 - find and verify superblock...
        - block cache size set to 240976 entries
Phase 2 - using internal log
        - zero log...
zero_log: head block 2 tail block 2
        - scan filesystem freespace and inode maps...
        - found root inode chunk
Phase 3 - for each AG...
        - scan and clear agi unlinked lists...
        - process known inodes and perform inode discovery...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
        - agno = 4
        - agno = 5
        - agno = 6
        - agno = 7
        - agno = 8
        - agno = 9
        - agno = 10
        - agno = 11
        - agno = 12
        - agno = 13
        - agno = 14
        - agno = 15
        - agno = 16
        - agno = 17
        - agno = 18
        - agno = 19
        - agno = 20
        - agno = 21
        - agno = 22
        - agno = 23
        - agno = 24
        - agno = 25
        - agno = 26
        - agno = 27
        - agno = 28
        - agno = 29
        - agno = 30
        - agno = 31
        - process newly discovered inodes...
Phase 4 - check for duplicate blocks...
        - setting up duplicate extent list...
        - check for inodes claiming duplicate blocks...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
        - agno = 4
        - agno = 5
        - agno = 6
        - agno = 7
        - agno = 8
        - agno = 9
        - agno = 10
        - agno = 11
        - agno = 12
        - agno = 13
        - agno = 14
        - agno = 15
        - agno = 16
        - agno = 17
        - agno = 18
        - agno = 19
        - agno = 20
        - agno = 21
        - agno = 22
        - agno = 23
        - agno = 24
        - agno = 25
        - agno = 26
        - agno = 27
        - agno = 28
        - agno = 29
        - agno = 30
        - agno = 31
Phase 5 - rebuild AG headers and trees...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
        - agno = 4
        - agno = 5
        - agno = 6
        - agno = 7
        - agno = 8
        - agno = 9
        - agno = 10
        - agno = 11
        - agno = 12
        - agno = 13
        - agno = 14
        - agno = 15
        - agno = 16
        - agno = 17
        - agno = 18
        - agno = 19
        - agno = 20
        - agno = 21
        - agno = 22
        - agno = 23
        - agno = 24
        - agno = 25
        - agno = 26
        - agno = 27
        - agno = 28
        - agno = 29
        - agno = 30
        - agno = 31
        - reset superblock...
Phase 6 - check inode connectivity...
        - resetting contents of realtime bitmap and summary inodes
        - traversing filesystem ...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
        - agno = 4
        - agno = 5
        - agno = 6
        - agno = 7
        - agno = 8
        - agno = 9
        - agno = 10
        - agno = 11
        - agno = 12
        - agno = 13
        - agno = 14
        - agno = 15
        - agno = 16
        - agno = 17
        - agno = 18
        - agno = 19
        - agno = 20
        - agno = 21
        - agno = 22
        - agno = 23
        - agno = 24
        - agno = 25
        - agno = 26
        - agno = 27
        - agno = 28
        - agno = 29
        - agno = 30
        - agno = 31
        - traversal finished ...
        - moving disconnected inodes to lost+found ...
Phase 7 - verify and correct link counts...

        XFS_REPAIR Summary    Sun Sep 30 12:58:50 2012

Phase        Start        End        Duration
Phase 1:    09/30 12:58:41    09/30 12:58:41    
Phase 2:    09/30 12:58:41    09/30 12:58:46    5 seconds
Phase 3:    09/30 12:58:46    09/30 12:58:50    4 seconds
Phase 4:    09/30 12:58:50    09/30 12:58:50    
Phase 5:    09/30 12:58:50    09/30 12:58:50    
Phase 6:    09/30 12:58:50    09/30 12:58:50    
Phase 7:    09/30 12:58:50    09/30 12:58:50    

Total run time: 9 seconds
done

これでマウント可能になり、ファイルに無事アクセスできた。

ふぅ・・。

参考文献

コメント

タイトルとURLをコピーしました