repair root xfs filesystem

Posted on Sat 03 January 2015 in misc • 1 min read

I have a lot of kvm virtual machines with xfs on the root filesystem. XFS is a great filesystem from SGI. On the last years its performance and stability has been improved and linux distros like Redhat think on it like default filesystem.

Today one VM report incorrect free space, so

df -h S.ficheros Tamaño Usados Disp Uso% Montado en /dev/vda1 40G 28G 13G 68% /

give diferent numbers than

du -sch /*

Is not a good idea to repair a filesystem while it is mounted and how i have the root fs on xfs , so I have to reboot, enter on grub to choose the recovery mode

Now you have to enter the root password and must use xfs_repair and like the root fs is mounted, you have to pass the parameter -d to repair the mounted fs. This is only possible on recovery mode or if you prefer single user mode.

if finish ok reboot the VM.