I'm about to convert my 2x3TB LVM setup to use software RAID1 with 2 additional drives. I'm just wondering if the following will be safe and if there is a way to recover at various steps.
So I have /dev/sdb1 and /dev/sdc1 making up my vg_media volume group.
I'm adding disks /dev/sdd and /dev/sde, but first setting up a degraded RAID on them.
So here is my plan:
# use parted to create GPT partitions on /dev/sdd and /dev/sde
mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdd1 missing
mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sde1 missing
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
vgextend vg_media /dev/md0
vgextend vg_media /dev/md1
pvmove /dev/sdb1 /dev/md0
pvmove /dev/sdc1 /dev/md1
vgreduce vg_media /dev/sdb1
vgreduce vg_media /dev/sdc1
It is my understanding that pvmove really just copies everything then updates some metadata so the new physical location is used.
I'm just wondering if I could undo the pvmove at this point and go back to the data on /dev/sdb1 and /dev/sdc1, if something were to go wrong with my degraded RAID.
When I've verified that things seem to be working at this point, I will just do this to finish the RAID
sfdisk -d /dev/sdd | sfdisk /dev/sdb
sfdisk -d /dev/sde | sfdisk /dev/sdc
mdadm --manage /dev/md0 --add /dev/sdb1
mdadm --manage /dev/md1 --add /dev/sdc1