2

I have LVM configured on top of RAID, but I was wondering how one would do RAID on top of LVM.

Here's the scenario:

I have a RAID 6 array with 4 X 3TB drives. 1 drive failed, badblocks reported 73 bad blocks (concentrated in a roughly 400 block span).

I'd like to create a partition before and after the spot where the bad blocks are, and create a logical volume to try and add it to the array.

My questions are: 1) is this possible? 2) do I need to create a full logical volume, or can I just make it a volume group and use it? 3) what to do with extents? leave the default, or make an extent equal to the entire combined disk size?

Also, this is pretty much a WORM type situation for archival, so optimal performance isn't really important (but would be nice).

And, since I know I'm going to get an "only if you want to lose your data" reply, the data is backed up offsite nightly.

1 Answer 1

0

First a warning - a few bad blocks can be a sign of a failing drive. I wouldn't put the effort in to fixing it because the drive could well fail again on different blocks.

Yes, if you do want to do it, it's possible, but I would approach it a different way. You don't need to use LVM to do this task; use raid linear mode (see https://raid.wiki.kernel.org/index.php/RAID_setup#Linear_mode)

Create disk partitions on the faulty drive that don't include the bad area, then combine them by creating a raid using a command like:

mdadm --create /dev/mdx --level=linear --raid-devices=2 /dev/sdy1 /dev/sdy2

Next you can add the mdx as a component into your existing raid array. Likely you will need to shrink the size of the array a little since your mdx device is a little smaller than the original disk was.

1
  • I'm actually thinking this might be over kill and simply adding the drive back with a full single partition might work. This question seems to indicate that running checkarray will have mdadm notice the bad blocks and relocate them.
    – Rob
    Commented Jun 19, 2014 at 4:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .