Skip to content

Migrate LVM onto RAID1 using mdadm

2008 December 31
tags: , ,
by Philippe Delodder

Here is simple way to put lvm onto a RAID1:

First of the new hdd named here as sdb, needs to have atleast one partition sdb1 with ID type “fd”, you can do that with the use of fdisk.

Create and move the lvm:

mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 missing
pvcreate /dev/md0
vgextend VolumeGroupName /dev/md0
pvmove olddisk /dev/md0
vgreduce olddisk

Now create an partition of the oldisk with ID type “fd”. After that these are to add it to the array and rebuild array:

mdadm /dev/md0 --add /dev/sda1
mdadm /dev/md0 --rebuild

As noticed by an reader here is a more detailed version of what I explain above

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS

Bad Behavior has blocked 203 access attempts in the last 7 days.