Re: EXT2 and BadBlock updating.....

From: Andreas Dilger (adilger@home.com)
Date: Tue Apr 11 2000 - 22:16:34 EST


Bert Hubert writes:
> On Tue, Apr 11, 2000 at 04:20:26PM -0600, Andreas Dilger wrote:
> > correctly for all filesystems, as well as raw devices via MD. Even better
> > would be if LVM could do mirroring, so you could do mirroring and relocation
> > at the PP/PE level instead of a whole partition at a time.
>
> If you do LVM on top of md, you can still do that. You only need to figure
> out where the error occured, and in which PE is, and move that. There
> appear to be good reasons not to do mirroring within LVM.

I don't see how that can work (unless I misunderstand something)...

If LVM is not doing the mirroring as you suggest, but rather MD is doing
it, then you can do nothing but replace the whole disk, or live with
the possibility of the other disk failing in the same spot. You also
HAVE to mirror all of the LEs created on the MD device, which isn't
always necessary.

If you "move the PE" as you suggest, you would by necessity stop using
both the good disk and the bad disk where that PE was located, as the
mirroring is "hidden" from LVM by the MD layer. If the mirroring was
done in the LVM layer (ala AIX, and HP I think) then you only relocate
the PE from the bad disk (making a copy from the good PE if necessary).

Consider (Linux left, AIX/HP right):

         LE LE
         | / \
         PE PE PE
         | | |
         md dA dB
        / \
       dA dB

If either dA or dB go bad in the Linux case, you have to stop using the
other half of the MD disk where that PE is located, or you risk data loss.
With MD, there is no way to correct a partially bad disk (I think) without
replacing the whole disk. With (non-Linux) LVM mirroring, you only need
to relocate the one bad PE, and you can still keep using the other one.
It is easy to mark a single PE bad, and LVM will no longer use it.

The other benefit of having mirroring in the LVM layer is that it
greatly simplifies PE migration on a live filesystem (or at least it
isn't any overhead compared to having safe migration in there already).
The reason is that to easily do migration on a live system, simply mirror
the existing LE to a new PE, sync it, and then delete the old copy.
This is much safer than simply "moving" the PE, because if that fails
in mid-stream you may not have a complete set of valid data in either
the old or the new PE. If you CAN handle this safely, then you are 99%
of the way to having mirroring in LVM already anyways.

Cheers, Andreas

-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:17 EST