Managing Disk Space with LVM
Subject:   Alternate RAID-1 migration
Date:   2006-04-30 19:04:48
From:   jrzagar
Instead of ending up with four raid-1 devices, wouldn't it be easier to do the following?

Use mdadm to mark one drive of each of the RAID 1 mirrors as failed, and then remove them:

# mdadm --manage /dev/md0 --fail /dev/sda1
# mdadm --manage /dev/md0 --remove /dev/sda1
# mdadm --manage /dev/md0 --fail /dev/sdc1
# mdadm --manage /dev/md0 --remove /dev/sdc1

Pull out the sda and sdc hard drives and replace them with two of the new 800G drives. Create 800G partitions on each drive and create md2:

# fdisk /dev/sda
# fdisk /dev/sdc
# mdadm --create /dev/md2 --level=1 \
--raid-devices=2 /dev/sd[ac]1--add /dev/sda1

Once you've activated the array, you can extend the volume group, move the logical volumes to the new drives, and remove the old raid arrays from the volume group:

# vgextend datavg /dev/md2
# pvmove /dev/md0 /dev/md2
# vgreduce datavg /dev/md0
# pvmove /dev/md1 /dev/md2
# vgreduce datavg /dev/md1

Now you can replace the hard drives for md[01], delete md0, recreate md1 with the second pair of 800G drives, and add the new md1 to datavg.

Main Topics Oldest First

Showing messages 1 through 2 of 2.

  • Alternate RAID-1 migration
    2006-04-30 23:37:05  bryceharrington [View]

    Yes, there's definitely a few approaches to doing this, and like kees said, it's going to be driven by personal preference.

    Note that part of the reason we picked this approach was just that it could be explained more concisely than other options we were considering.
  • Alternate RAID-1 migration
    2006-04-30 19:45:07  keescook [View]

    Excellent observation! :)

    Doing it this way or the other is a matter of preference. Some people like maintaining the size of the original component devices, and some like maintaining the number of the original component devices.

    For the purposes of the article, showing how to end up with more devices seemed to serve as a better teaching example, as it tangentially demonstrates how to just plain add more disks. :)