First off, here are two related threads for those of us new to XFS:
How and why - create an XFS partition
How to defragment XFS partitions and keep them that way
You must periodically check your XFS partition(s) for error manually since fsck will NOT run automatically as it does with your ext3 partition(s).
There are two utils on your system to do this:
xfs_check and
xfs_repair
Checking for Inconsistencies
Note that you MUST unmount your XFS partition to use either of these.
Do NOT run either of them on a mounted filesystem! In my system, only my /myth is XFS (it is /dev/hda3). In order to unmount your partition, you must exit myth-frontend since it'll be using it.
After you exited the frontend and/or mythwelcome, drop into single user mode and umount your partition (again mine is /dev/hda3 but substitute your XFS partition for hda3):
Code:
# telinit 1
# umount /dev/hda3
If you get a "umount: /myth: device is busy" error, do this:
Code:
$ fuser -m /dev/hda3
/dev/hda3: 3560
Mine returned one process (3560) using it. You can see what it is by issueing the following:
Code:
$ ps auxw|grep 3560
mythtv 3560 4.5 11.1 164128 53660 ? SLl 14:17 0:03 mythfrontend
mythtv 3594 0.0 0.1 1780 596 ttyp0 S+ 14:19 0:00 grep 3560
It's mythfrontend (I didn't exit to illustrate this point). I killed it using the kill command followed-up a umount:
Code:
# kill 3560
# umount /dev/hda3
Now you can run xfs_check or xfs_repair safely
Code:
# xfs_check /dev/hda3
# xfs_check /dev/hda3
If there is nothing wrong with the file system, you won't see anything. From the xfs_check man page"
Quote:
Any output that is produced when xfs_check is not run in verbose mode indicates that the filesystem has an inconsistency.
If you get no errors, just mount the partition and return to multiuser mode.
Code:
# mount /dev/hda3
# telinit 5
$ pkill xinit
Attempt to Repair InconsistenciesAgain, ONLY do the following on an unmounted partition!
If you do get errors, you can run xfs_repair:
Code:
# xfs_repair /dev/hda3
Phase 1 - find and verify superblock...
Phase 2 - using internal log
- zero log...
- scan filesystem freespace and inode maps...
- found root inode chunk
Phase 3 - for each AG...
- scan and clear agi unlinked lists...
- process known inodes and perform inode discovery...
- agno = 0
- agno = 1
- agno = 2
- agno = 3
- process newly discovered inodes...
Phase 4 - check for duplicate blocks...
- setting up duplicate extent list...
- check for inodes claiming duplicate blocks...
- agno = 0
- agno = 1
- agno = 2
- agno = 3
Phase 5 - rebuild AG headers and trees...
- reset superblock...
Phase 6 - check inode connectivity...
- resetting contents of realtime bitmap and summary inodes
- traversing filesystem ...
- traversal finished ...
- moving disconnected inodes to lost+found ...
Phase 7 - verify and correct link counts...
done
In my case, I had no errors, but wanted to show you the output of xfs_repair. So all is well. Now go back and remount your /dev/hda3 and swtich back to multiuser mode and finally restart your frontend with a pkill xinit:
Code:
# mount /dev/hda3
# telinit 5
$ pkill xinit
Please see the man page for xfs_repair for a more detailed description of those Phases (referenced below).
References
docs.cray.com -
Checking XFS File System Consistency with xfs_check and xfs_repair
linux.die.net -
man page for xfs_check and
man page for xfs_repair
ocaoimh.ie -
How to umount when the device is busy