====== 16 xfs_repair ====== CentOS7からファイルシステムがxfsになった。 今度はファイルシステム壊れた時に、xfs_repairを行う必要がありそう。 ===== チェックのみ ===== # xfs_repair -n /dev/sda ===== 通常実行 ===== # xfs_repair /dev/sda ===== 強制実行 ===== ログを強制的に消去(ゼロで初期化)する。ログが破損していて修復できない場合に使用 破損したファイルは/lost+found/に入る。 # xfs_repair -L /dev/sda ===== エラー ===== # mount /dev/sda /mnt mount: Structure needs cleaning ログが破損していて再生できない場合-Lオプションで実行するしか無い。 -L オプションは、ログを再生できない場合にのみ使用し、このオプションはログ内のすべてのメタデータの更新を破棄し初期化します。 その結果不整合が生まれinodeが不明なファイルは、/lost+found/に置かれます。 # xfs_check /dev/sdb 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. {{tag>xfs}}