5

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.

Justin Force
  • 338
  • 1
  • 5
  • 14

2 Answers2

4

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
Justin Force
  • 338
  • 1
  • 5
  • 14
Kevin
  • 56
  • 2
2

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.

Janne Pikkarainen
  • 31,454
  • 4
  • 56
  • 78
  • 1
    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. – Justin Force Apr 27 '11 at 19:32
  • found the same thing as @JustinForce, I did this and got I a little progress but still hitting errors 'touch /usr/share/locale/en/LC_MESSAGES/xfsprogs.mo' – Titi Wangsa bin Damhore Apr 09 '17 at 02:31