The system will check the disk before booting, and you can check mannually in case any errors occurs. The post will show you how to check hard disk consistence and repair the disk errors
Table of Contents 1. Umount the file system 2. Check if the disk has errors 3. Repair the file system if any errors 4. Repair with data loss Note
1. Umount the file system
1 2 3 4 sudo umount /data1 sudo umount /dev/sdb1
2. Check if the disk has errors
1 2 3 4 sudo xfs_repair -n /dev/sdb1 sudo xfs_check /dev/sdb1
3. Repair the file system if any errors
1 2 3 4 sudo xfs_repair /dev/sdb1 sudo fsck /dev/sdb1
4. Repair with data loss
Finally, if xfs_repair /dev/sdb1
fails, you might use the following to repair the file system with losing some data
1 2 3 4 5 6 sudo xfs_repair -L /dev/sdb1 sudo xfs_repair /dev/sdb1 sudo xfs_repair -n /dev/sdb1
Note
Execute xfs_metadump /dev/sdb1
to backup the meta data in case repairation fails