Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running a fully updated Ubuntu 9.04 "Jaunty" i686 server. I have an single XFS volume in an LVM group called /dev/mapper/vg0-bigthree.

If I boot to single user mode and ensure that the volume is unmounted, I still get the following every time I try to run xfs_check:

$ sudo xfs_check /dev/mapper/vg0-bigthree 
xfs_check: /dev/mapper/vg0-bigthree contains a mounted and writable filesystem

fatal error -- couldn't initialize XFS library

Just to be thorough, I started by trying to run

$ sudo fsck.xfs /dev/mapper/vg0-bigthree 
If you wish to check the consistency of an XFS filesystem or
repair a damaged filesystem, see xfs_check(8) and xfs_repair(8).

before turning to xfs_check.

Also, I can confirm that there is no occurrence in the output of mount or in /etc/mtab of the volume's device or mount point.

share|improve this question
    
If it is being particularly difficult you could boot off a livecd and try doing the check from a livecd. –  Zoredache Aug 12 '10 at 18:59
    
Would do, but It's an LVM on a RAID5, and it's not as trivial as it sounds. Thanks, though. –  sidewaysmilk Aug 12 '10 at 21:45

2 Answers 2

up vote 3 down vote accepted

This is how I got around this on my system. I saw the same issues as you when trying to run xfs_check. Clearly the fs is un-mounted. It appears as though either autofs or nfs was still holding onto the filesystem and once they were stopped the check ran.

[root@openfiler ~]# xfs_check /dev/backup2/backup2
xfs_check: /dev/backup2/backup2 contains a mounted and writable filesystem

fatal error -- couldn't initialize XFS library

[root@openfiler ~]# df

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdc2             35775912    804200  33125044   3% /
/dev/sdc1               101086     14410     81457  16% /boot
tmpfs                   512440         0    512440   0% /dev/shm

[root@openfiler ~]# cat /etc/mtab
/dev/sdc2 / ext3 rw 0 0
/proc /proc proc rw 0 0
/sys /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
/dev/sdc1 /boot ext3 rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/rpc_pipefs rpc_pipefs rw 0 0
automount(pid2644) /misc autofs rw,fd=4,pgrp=2644,minproto=2,maxproto=4 0 0
automount(pid2681) /net autofs rw,fd=4,pgrp=2681,minproto=2,maxproto=4 0 0
nfsd /proc/fs/nfsd nfsd rw 0 0

[root@openfiler ~]# service autofs stop
Stopping automount:                                        [  OK  ]

[root@openfiler ~]# cat /etc/mtab
/dev/sdc2 / ext3 rw 0 0
/proc /proc proc rw 0 0
/sys /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
/dev/sdc1 /boot ext3 rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/rpc_pipefs rpc_pipefs rw 0 0
nfsd /proc/fs/nfsd nfsd rw 0 0

[root@openfiler ~]# service nfs stop
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
[root@openfiler ~]# cat /etc/mtab
/dev/sdc2 / ext3 rw 0 0
/proc /proc proc rw 0 0
/sys /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
/dev/sdc1 /boot ext3 rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/rpc_pipefs rpc_pipefs rw 0 0
nfsd /proc/fs/nfsd nfsd rw 0 0

[root@openfiler ~]# xfs_check /dev/backup2/backup2
share|improve this answer
    
Thank you! I'd upvote you twice if I could. –  sidewaysmilk Nov 1 '11 at 17:25

Try strace -fF -o /tmp/debugfile sudo xfs_check /dev/mapper/vg0-bigthree and then grep open /tmp/debugfile.* to see what actually happens behind the scenes before xfs_check decides to throw out that error.

share|improve this answer
    
I will give this a try. Thanks. –  sidewaysmilk Aug 12 '10 at 21:45
    
I got this: 30540 open("/usr/share/locale/en/LC_MESSAGES/xfsprogs.mo", O_RDONLY) = -1 ENOENT (No such file or directory), so it looks like the lack of a localization file may be crashing it. I'm going to accept this answer. I never figured it out, by the way. But at least I can kind of see why it's crashing. –  sidewaysmilk Apr 27 '11 at 19:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.