Problem
When server hit XFS system error in /data1, ran xfs_repair.
After running ‘umount /data1’ succesfully, and then ‘xfs_repair /dev/sdb’, the command failed with this error message although ‘mount’ output didn’t show /data1 entry.
[root@sdw4 log]# xfs_repair /dev/sdb xfs_repair: /dev/sdb contains a mounted filesystem fatal error -- couldn't initialize XFS library
‘xfs_repair’ with -L option didn’t work neither.
[root@sdw4 log]# xfs_repair -L /dev/sdb xfs_repair: /dev/sdb contains a mounted filesystem fatal error -- couldn't initialize XFS library
Solution
- edit /etc/fstab file to comment /data1 entry.
- reboot server
- ran ‘xfs_repair /dev/sdb’ again, it succeeded.
- edit /etc/fstab file to uncomment /data1 entry.
- ran ‘mount -a’ to mount /data1 entry