xfs
[Top] [All Lists]

Re: hdd failure on xfs filesystem

To: GCS <gcs@xxxxxx>
Subject: Re: hdd failure on xfs filesystem
From: Eric Sandeen <sandeen@xxxxxxx>
Date: 25 Apr 2003 14:40:21 -0500
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20030425191705.GA5777@gcs.org.hu>
Organization:
References: <20030425191705.GA5777@gcs.org.hu>
Sender: linux-xfs-bounce@xxxxxxxxxxx
On Fri, 2003-04-25 at 14:17, GCS wrote:
> Hi all!
> 
>  I have a laptop, which has several partitions. I have two kind of Linux
> installed, Debian Sarge, and UHU Linux (Hungarian one). I was apt-get
> update the Debian, when I got uncorrectable errors on my hdd

>From this, the logs, and the "falling off a chair" story, it probably is
a bad drive now (get the drive-checker program from the drive
manufacturer, it can probably tell you for sure).

> Also, this partition is after the first third
> of the hdd, and why should only a middle partition be affected? 

Just lucky, I guess.  :)

> The
> first partition was checked with badblocks, without any errors.
> Is there anything I can try to get back some data? Is it possible to
> format this partition to XFS, but now register bad blocks, and do not
> write to that region?

XFS does not handle badblock registration, for various reasons.

Your best bet is to use dd to get what you can off the drive, then do
xfs_repair.

Of course dd will also get read errors, but it has an option,
"conv=noerror" to continue reading after errors.  However, you want to
replace the unreadable blocks with zeros, so use "conv=noerror,sync"

so, do something like this:

dd if=/dev/your/partition conv=noerror,sync of=imagefile bs=<blocksize>

Picking 512 for blocksize is safest, but will take longer, 4k will be
quicker, but you'll lose a minimum of 4k of data for each bad spot on
the disk that way.

Now you have an imagefile of your partition, try:

mount -o loop -t xfs imagefile /tmp/mountpoint

If that fails in log recovery, try 

xfs_repair -L -f imagefile

this will zero the log out, and it should be mountable.

Even if it mounts without xfs_repair -L, you still may need to run
xfs_repair on it, since there will be errors in it due to the bad
blocks.

Good luck!

-Eric

-- 
Eric Sandeen      XFS for Linux     http://oss.sgi.com/projects/xfs
sandeen@xxxxxxx   SGI, Inc.         651-683-3102


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