RAID+LVM migration, need help
Hi,
my current system (sarge) has basically the following set up:
RAID1 root on md0
RAID5 (4xHD) with LVM and the other mounts.
I now have 4 new drives and want to change the underlying RAID from RAID5 to
RAID01 (the newer disks are bigger and RAID01 is faster).
I have 2 HD controllers (MB and an PCI one) on which the current RAID5 has all
the disks as masters (hda,hdc,hde,hdg).
On the "old" HDs /dev/md0 is a RAID1 root raid, and /dev/md1 is controlled by
LVM (OLD = rootvg).
The 4 new disks are now connected as slaves (hdb,hdd,hdf,hdh)
I've made the *new* raids on the running system (FYI mirroring 150G takes a
while). To do this I had to use the "-c" option with a new config containing
the "desired" md setup. The RAID01 is now added contained in new VG "mainvg".
So I basically have all the HW and raids in place to migrate to the new HDs.
What I am thinking of doing now is:
Create new rootfs and mount to /new-disk (using new RAID1 on new HDs)
cp -ax / /newdisk
The creating new LVs on the "mainvg" and mounting them to into /newdisk.
e.g.
lv create +20G -nlv_usr mainvg
mkfs.ext3 /dev/mainvg/lv_usr
mount /dev/mainvg/lv_usr /new-disk/usr
cp -ax /usr /new-disk/usr
And then doing the above for each of the current LVs.
After that, adjusting "/new-disk/etc/[lvm|m|fs]tab" to match.
The binary files in "/etc/lvmtab.d/*" are my main worry ATM, the PV is using
md7 on the current setup, this would "eventually" become "md5" on the newly
booted system.
Can LVM handle the change from md7 to md5 between boots, and still find the
volumes ?
I obviously want to keep the old system in a working state until I can
physically remove the old HDs and boot from the new ones.
Am I doing this the hard way ?
Should/could I use LVM snapshots to do the same ?
Is using vgexport/vgimport a better way to go ?
The system as it is runs fine, I could also save an image of the current
system in the network and just do a reinstall on the server to get the file
system the way I want it then do a restore on top of it (using a boot CD or
something to access everything on the server).
Basically, what I want to know is the best way to migrate the disks to the new
RAID setup with all the data with out losing/breaking anything.
This is the 1st time I've done this type of LVM/RAID migration and I don't
want to mess it up :)
It may be a tall order but I am counting on the people here to give me some
pointers :)
--
Bill
Reply to: