xfs
[Top] [All Lists]

Re: xfs_repair dies with a fatal error

To: Jeff Snyder <jeff@xxxxxxxxxxxxxxxxx>
Subject: Re: xfs_repair dies with a fatal error
From: Olaf Weber <olaf@xxxxxxx>
Date: 24 Mar 2004 09:27:01 +0100
Cc: sandeen@xxxxxxxxxxxxxxxxxxxxxxxx, linux-xfs@xxxxxxxxxxx
In-reply-to: <200403240530.25783.jeff@xxxxxxxxxxxxxxxxx>
References: <200403240530.25783.jeff@xxxxxxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Academic Rigor)
Jeff Snyder writes:

> Hi, 
> I've been having some problems getting xfs_repair to work on one of my xfs 
> filesystems.. after talking to Eric Sandeen on #xfs irc for a bit he 
> suggested that I post my findings to the list, so here goes (:

> the case: http://oss.sgi.com/archives/linux-xfs/2002-08/msg00243.html is 
> similar to mine, the error message and the xfs_db stuff.

> I'm getting the error "fatal error -- can't read block 0 for directory inode 
> xxxxxxxx" when i try to run xfs_repair. The filesystem is on an evms volume, 
> which is part of an LVM which is on a raid1 array. full output of xfs_repair 
> is at:
>     http://caffeinated.me.uk/~jeff/xfs_repair_script

We have open bugs for this, but unfortunately at present no clean
solution.  A quick and dirty solution is to use xfs_db to junk the
inode, so xfs_repair can finish.  Files in the directory will end up
in lost+found, named after their inode numbers.  To make it easier to
get those files back to their original names, you may want to use
xfs_db first to get as much of the filename->inode mapping in the
directory as possible.  A small awk or perl script can then help
restoring the original names.

To destroy the directory, you'd use the -x option of xfs_db to enable
writes, and overwrite the first couple of fields, in particular
core.magic, core.mode, core.version, and core.format.

E.g,

xfs_db -x /dev/....
xfs_db: inode 8713174
xfs_db: write core.magic 0
xfs_db: write core.mode 0
xfs_db: write core.version 0
xfs_db: write core.format 0

-- 
Olaf Weber                 SGI               Phone:  +31(0)30-6696777
                           Veldzigt 2a       Fax:    +31(0)30-6696899
Tech Support Engineer      3454 PW de Meern  Vnet:   955-7151
Global Product Support     The Netherlands   Email:  olaf@xxxxxxx


<Prev in Thread] Current Thread [Next in Thread>