Running fsck

Force a fsck on the next reboot

RHEL 6

shutdown -F -r now does not work anymore so you have to use touch /forcefsck or forcefsck at kernel command line on boot

  • The /fsckoptions file can be used for fsck options
  • You need to make sure the last field from /etc/fstab is not set to 0

RHEL 7

  • At boot time as a kernel command line parameters (does not work for XFS): fsck.mode=force fsck.repair=yes

Run fsck in rescue mode

RHEL 6

Method 1

Boot with installation CD in the rescue mode: linux rescue nomount

vgchange -ay VolGroup
fsck.ext4 /dev/VolGroup/lv_root or fsck.ext4 /dev/sda2

Method 2

Append init=/bin/bash to kernel command line at boot

fsck.ext4 /dev/VolGroup/lv_root or fsck.ext4 /dev/sda2

RHEL 7

Method 1

Boot with installation CD in the rescue mode: linux rescue

vgchange -ay /dev/rhel_<hostname>/root
xfs_repair /dev/rhel_<hostname>/root

Method 2

Append rd.break or rw init=/sysroot/bin/sh to kernel command line at boot

umount /sysroot
xfs_repair /dev/rhel_<hostname>/root
init 6