LoginSignup
2
1

More than 5 years have passed since last update.

CentOS7 シングルモード xfs_repair

Last updated at Posted at 2018-06-12

カーネル選択メニューで 'e' を押します。

CentOS Linux (3.10.0-862.3.2.el7.x86_64) 7 (Core)

linux16 の行を編集

console, crashkernel があると起動できない場合があるので、必要なもの以外消します。
必要な記述は
1. 起動するカーネル /vmlinuz-3.10.0-862.3.2.el7.x86_64
2. マウントする root ポイント root=/dev/mapper/VolGroup00-LogVol00 ro
3. lvm の場合は、ルートパーティションの論理ボリュームをアクティベート rd.lvm.lv=VolGroup00/LogVol00 (rd.lvm.lv=ボリュームグループ/論理ボリューム)
4. init 上書き。/sbin/init の代わりに /sysroot にマウントした /bin/sh を実行します。 init=/sysroot/bin/sh

  • 変更前

    linux16 /vmlinuz-3.10.0-862.3.2.el7.x86_64 root=/dev/mapper/VolGroup00-LogVol00 ro crashkernel=auto rd.lvm.lv=VolGroup00/LogVol00 rd.lvm.lv=VolGroup00/LogVol01 biosdevname=0 net.ifnames=0 console=tty0 console=ttyS0,115200n8 LANG=en_US.UTF-8

  • 変更後

    linux16 /vmlinuz-3.10.0-862.3.2.el7.x86_64 root=/dev/mapper/VolGroup00-LogVol00 ro rd.lvm.lv=VolGroup00/LogVol00 init=/sysroot/bin/sh

Ctrl-x で起動

mount で /sysroot がマウントされていることを確認し、umount する

# mount
/dev/mapper/VolGroup00-LogVol00 on /sysroot type xfs (ro,relatime,attr2,inode64,noquota)
# umount /sysroot

lvm のアクティブ化に失敗してマウントで出来ていない場合は、
手動で有効にします。

# lvm lvscan
  inactive            '/dev/VolGroup00/LogVol00' [23.50 GiB] inherit
  inactive            '/dev/VolGroup00/LogVol01' [4.00 GiB] inherit
# lvm lvchange -ay /dev/VolGroup00/LogVol00
# lvm lvscan
  ACTIVE            '/dev/VolGroup00/LogVol00' [23.50 GiB] inherit

xfs_repair 実行

# xfs_repair /dev/VolGroup00/LogVol00
Phase 1 - find and verify superblock...
Phase 2 - using internal log
Phase 3 - for each AG...
Phase 4 - check for duplicate blocks...
Phase 5 - rebuild AG headers and trees...
Phase 6 - check inode connectivity...
        - resetting contents of realtime bitmap and summary inodes
        - traversing filesystem ...
fixing type mismatch (1/2) in directory/child inode 51382004/50331932 entry "2030232432./log" in dir 51382004 points to an already connected directory inode 50331932
bad hash table for directory inode 51382004 (no leaf entry): rebuilding
rebuilding directory inode 51382004
        - traversal finished ...
        - moving disconnected inodes to lost+found ...
Phase 7 

再度実行して修復済みであることを確認
# xfs_repair /dev/VolGroup00/LogVol00
...
Phase 6 - check inode connectivity...
        - resetting contents of realtime bitmap and summary inodes
        - traversing filesystem ...
        - traversal finished ...
        - moving disconnected inodes to lost+found ...
...

reboot を実行して完了

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1