Friends

Migrating from 6x250GB RAID5 to 2x1.5TB RAID1 with LVM

Alec / Swapoff.org - Thu, 2009-12-31 00:15

My file server has 6 250GB disks in a RAID5 volume, md2. Living on this volume are a whole bunch of LVM logical volumes (LVs). I want to replace all these drives with 2 1.5TB drives, preserving my data.

Step one was to simply replace one of the 250GB drives with one of the 1.5TB drives. This put the RAID5 volume md2 into degraded mode. I then created a new RAID1 volume with the 1.5TB drive as an active half of the mirror:

# mdadm --create /dev/md3 --chunk=64 --level=raid1 --raid-devices=2 /dev/sdd missing # mdadm -D --scan | grep md3 >> /etc/mdadm.conf
I then added the new drive to my existing LVM volume group:

# pvcreate /dev/md3
# vgextend vg00 /dev/md3

Next, move all logical volumes from the RAID5 volume to the RAID1 volume, a one-liner:

# pvmove -v /dev/md2 /dev/md3

This took hours. Very very easy, and a little bit scary.

The final step is to take out the remaining RAID5 drives and add the second 1.5TB drive to the mirror:

# mdadm /dev/md3 --add /dev/sdc

Permalink | Leave a comment  »

Categories: Friends
Syndicate content