linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Re: How to handle Bad Block relocation with LVM?
@ 2003-02-14  8:52 Eric Hopper
  2003-02-14 11:27 ` Joe Thornber
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Hopper @ 2003-02-14  8:52 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 1816 bytes --]

I manually relocated a few bad blocks on a bad IBM drive I had when I
replaced the drive.  It took a lot of time and effort.  I had to run the
dd command many times very carefully to make it work.

One big problem for me was that read-ahead obscured which actual sectors
were in error.  I needed a 'raw' LVM device, but I don't think such a
thing exists for LVM1 on Linux 2.4.x.

What I did was used pvmove to move the PE containing the bad block to a
different spot on the hard drive, then allocated a new LV that was one
LE long, and forced it to allocate the PE containing the bad block. 
Then I used dd to carefully copy over the LE in sections, narrowing down
the location of the bad sectors until I had copied everything that could
possibly be read.

After that, I ran fsck on the filesystem that had originally contained
the bad block, and I was fine.  I checked carefully, and it didn't even
seem that I had lost any data.

Long, time consuming process though.

Actually, it may have been even ickier than I first thought.

It could be that pvmove wouldn't work, and I had to shorten the LV
containing the bad block (the BLV) to contain all PEs prior to the bad
one, allocate a new LV (the NLV) containing all the bad PE, lengthen the
BLV by 1 PE, using a brand new PE, then lengthen it to its original
length so it would contain all the PEs after that bad PE, the do the
procedure I outlined above.

Now that I think of it, I'm nearly positive that pvmove didn't work.  I
had dearly wished for some kind of option to pvmove that would force it
to try as hard as it could to get good reads of all the sectors in a PE,
then move the LE to a new PE, even if there were errors.

Have fun (if at all possible),
-- 
Eric Hopper <hopper@omnifarious.org>
Omnifarious Software

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] Re: How to handle Bad Block relocation with LVM?
  2003-02-14  8:52 Eric Hopper
@ 2003-02-14 11:27 ` Joe Thornber
  0 siblings, 0 replies; 3+ messages in thread
From: Joe Thornber @ 2003-02-14 11:27 UTC (permalink / raw)
  To: linux-lvm

Eric,

We would like to automate the process that you have described in LVM2
at some point.  So if you get an error on an LV and new PE will be
allocated, as much data as possible copied from the bad PE to the new
PE, and then remap the LV so that it's using the new PE (very much
like a small pvmove).

The EVMS team are writing a bad block relocator target for device
mapper, but I don't feel it's neccessary to add yet another device
layer to the LVs.  If I have a bad block I don't mind loosing a whole
PE (people may not agree with me on this ?)

- Joe

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] Re: How to handle Bad Block relocation with LVM?
       [not found] <20030218012102.12299.65097.Mailman@hermes.sistina.com>
@ 2003-02-18  8:08 ` Eric M. Hopper
  0 siblings, 0 replies; 3+ messages in thread
From: Eric M. Hopper @ 2003-02-18  8:08 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 1459 bytes --]

On Mon, 2003-02-14 at 17:26, Joe Thornber <joe@fib011235813.fsnet.co.uk> wrote:
> Eric,
> 
> We would like to automate the process that you have described in LVM2
> at some point.  So if you get an error on an LV and new PE will be
> allocated, as much data as possible copied from the bad PE to the new
> PE, and then remap the LV so that it's using the new PE (very much
> like a small pvmove).
> 
> The EVMS team are writing a bad block relocator target for device
> mapper, but I don't feel it's neccessary to add yet another device
> layer to the LVs.  If I have a bad block I don't mind loosing a whole
> PE (people may not agree with me on this ?)

I actually quite agree.  Here are a few points:

o A PE is typically less than 0.01% of my total disk space.

o Corruption on a drive tends to spread, especially if sectors near the
corruption are accessed frequently, so it's best to avoid a whole
section of a drive around a bad spot.

o In general, I would want to throw away a drive that had so many bad
sectors that it's firmware relocation software could no longer handle
them.  So, my main purpose in relocating the PE is to recover as much
data from it as I can before junking the drive.

Have fun (if at all possible),
-- 
The best we can hope for concerning the people at large is that they
be properly armed.  -- Alexander Hamilton
-- Eric Hopper (hopper@omnifarious.org  http://www.omnifarious.org/~hopper) --

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 185 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-02-18  8:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20030218012102.12299.65097.Mailman@hermes.sistina.com>
2003-02-18  8:08 ` [linux-lvm] Re: How to handle Bad Block relocation with LVM? Eric M. Hopper
2003-02-14  8:52 Eric Hopper
2003-02-14 11:27 ` Joe Thornber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).