From: Roland <devzero@web.de>
To: linux-lvm@redhat.com
Subject: Re: [linux-lvm] How to handle Bad Block relocation with LVM?
Date: Wed, 15 Mar 2023 17:00:16 +0100 [thread overview]
Message-ID: <8a702d08-5b71-b2fe-1137-9cef23d43150@web.de> (raw)
hello,
quite old thread - but damn interesting, though :)
> Having the PE number, you can easily do
> pvmove /dev/broken:PE /dev/somewhere-else
does somebody know if it's possible to easily remap a PE with standard
lvm tools,
instead of pvmoving it ?
trying to move data off from defective sectors can need a very long
time, especially
when multiple sectors being affected and if the disks are desktop drives.
let's think of some "re-partitioning" tool which sets up lvm on top of a
disk with bad
sectors and which scans/skips&remaps megabyte sized PE's to some spare
area, before the
disk is being used. badblock remapping at the os level instead at the
disks controller
level.
yes, most of you will tell it's a bad idea but i have a cabinet full of
disks with bad
sectors and i'd be really be curious how good and how long a zfs raidz
would work on top
of such "badblocks lvm". at least, i'd like to experiment with that.
let's call it
academical project for learning purpose and for demonstration of lvm
strength :D
such "remapping" could look like this:
# pvs --segments -ovg_name,lv_name,seg_start_pe,seg_size_pe,pvseg_start
-O pvseg_start -S vg_name=VGloop0
VG LV Start SSize Start
VGloop0 blocks_good 0 4 0
VGloop0 blocks_bad 1 1 4
VGloop0 blocks_good 5 195 5
VGloop0 blocks_bad 2 1 200
VGloop0 blocks_good 201 699 201
VGloop0 blocks_spare 0 120 900
VGloop0 blocks_good 200 1 1020
VGloop0 blocks_good 4 1 1021
VGloop0 blocks_bad 0 1 1022
blocks_good is LV with healty PE's, blocks_bad is LV with bad PE's and
blocks_spare is LV
where you take healthy PE's from as a replacement for bad PE's found in
blocks_good LV
roland
sysadmin
> linux-lvm] How to handle Bad Block relocation with LVM?
> Lars Ellenberg lars.ellenberg at linbit.com
> Thu Nov 29 14:04:01 UTC 2012
>
> Previous message (by thread): [linux-lvm] How to handle Bad Block
relocation with LVM?
> Next message (by thread): [linux-lvm] How to handle Bad Block
relocation with LVM?
> Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>
> On Thu, Nov 29, 2012 at 07:26:24AM -0500, Brian J. Murrell wrote:
> > On 12-11-28 08:57 AM, Zdenek Kabelac wrote:
> > >
> > > Sorry, no automated tool.
> >
> > Pity,
> >
> > > You could possibly pvmove separated PEs manually with set of pvmove
> > > commands.
> >
> > So, is the basic premise to just find the PE that is sitting on a bad
> > block and just pvmove it into an LV created just for the purpose of
> > holding PEs that are on bad blocks?
> >
> > So what happens when I pvmove a PE out of an LV? I take it LVM moves
> > the data (or at least tries in this case) on the PE being pvmoved onto
> > another PE before moving it?
> >
> > Oh, but wait. pvmove (typically) moves PEs between physical volumes.
> > Can it be used to remap PEs like this?
>
> So what do you know?
> You either know that pysical sector P on some physical disk is broken.
> Or you know that logical sector L in some logical volume is broken.
>
> If you do
> pvs --unit s --segment -o
vg_name,lv_name,seg_start,seg_size,seg_start_pe,pe_start,seg_pe_ranges
>
> That should give you all you need to transform them into each other,
> and to transform the sector number to PE number.
>
> Having the PE number, you can easily do
> pvmove /dev/broken:PE /dev/somewhere-else
>
> Or with alloc anywhere even elsewhere on the same broken disk.
> # If you don't have an other PV available,
> # but there are free "healthy" extents on the same PV:
> # pvmove --alloc anywhere /dev/broken:PE /dev/broken
> Which would likely not be the smartest idea ;-)
>
> You should then create one LV named e.g. "BAD_BLOCKS",
> which you would create/extend to cover that bad PE,
> so that won't be re-allocated again later:
> lvextend VG/BAD_BLOCKS -l +1 /dev/broken:PE
>
> Better yet, pvchange -an /dev/broken,
> so it won't be used for new LVs anymore,
> and pvmove /dev/broken completely to somewhere else.
>
> So much for the theory, how I would try to do this.
> In case I would do this at all.
> Which I probably won't, if I had an other PV available.
>
> ;-)
>
> I'm unsure how pvmove will handle IO errors, though.
>
> > > But I'd strongly recommend to get rid of such broken driver
quickly then
> > > you loose any more data - IMHO it's the most efficient solution
cost &
> > > time.
>
> Right.
>
> Lars
_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
next reply other threads:[~2023-03-15 16:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-15 16:00 Roland [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-02-14 8:52 [linux-lvm] Re: How to handle Bad Block relocation with LVM? Eric Hopper
2003-02-14 11:27 ` Joe Thornber
2012-11-28 13:27 ` [linux-lvm] " Brian Murrell
2012-11-28 13:57 ` Zdenek Kabelac
2012-11-29 12:26 ` Brian J. Murrell
2012-11-29 14:04 ` Lars Ellenberg
2012-11-29 22:53 ` Brian J. Murrell
2012-11-29 15:55 ` Stuart D Gathman
2012-11-30 0:10 ` Brian J. Murrell
2003-02-10 19:18 Rocky Lee
2003-02-11 8:24 ` Heinz J . Mauelshagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8a702d08-5b71-b2fe-1137-9cef23d43150@web.de \
--to=devzero@web.de \
--cc=linux-lvm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).