View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 5 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun Jul 20, 2008 12:33 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
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 Inconsistencies

Again, 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

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Last edited by graysky on Thu Jul 24, 2008 1:03 pm, edited 1 time in total.


Top
 Profile  
 
PostPosted: Sun Jul 20, 2008 4:20 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
graysky wrote:
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).

Well that's the best reason I've heard yet not to use XFS. Any FS developer who can't be bothered to make their FS utilities plug into the _very_ general and standard fsck framework just doesn't know how to play well with others. WTH were they thinking? :?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 20, 2008 4:43 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
I could be mistaken, but I read this in several places including within fsck when I attempted to use it on that partition:
Code:
fsck /dev/hda3
fsck 1.40.6 (09-Feb-2008)
If you wish to check the consistency of an XFS filesystem or
repair a damaged filesystem, see xfs_check(8) and xfs_repair(8).


I was a bit surprised when I read this myself. But since I already made the entire /myth XFS I don't really care at this point. That said, from what I've read, either JFS or XFS are the recommended FS's to use when dealing with large files.

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 20, 2008 5:13 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
I'd already done that investigation myself and verified that it was indeed the case. My response was as much an exclamation of disgust and annoyance with developers who can't be bothered to follow standards as anything.

This is like a stereo receiver which requires some bizarre custom connectors instead any of the standard types (RCA phone, bare wire, banana plugs, ...) You'd take one look and say "WTH were they thinking?!?" and spend your money elsewhere if you weren't a total tech victim. http://ars.userfriendly.org/cartoons/?id=20080618


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 20, 2008 5:34 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
@tjc - too right!

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu