I have set up a migration between two drives. fIrst I got Centos 5 working how I wanted on this drive, then set about copying it to another drive.
The Centos files on both drives are in sub-partitions in an LVM partition on their respective drives.
I first did a minimum install on the new drive and saved all those files to a separate directory.
The LVM partititons and sub-partitions all have unique names.
Well it has been a bit of a struggle to say it nicely. Seems the LVM names are buried all over the place.
Of course I had to change /boot/grub/grub.conf, /boot/grub/menu.lst, and /etc/fstab
But more than that was the contents of /etc/lvm So for those I just restored what was created in the minimum install.
Still I cannot get the new drive to boot.
If I boot with the latest kernel (which I copied to the new drive), I get a message finding the new LVM partition, could not find the old LVM partition then:
Mount: could no find filesystem /dev/root
and a kernel panic.
If I get the boot menu and select the kernel installed with the minimum install, it gets a little further.
It still tries to find the old LVM partition, cannot find /lib/modules.dep in the /lib/modules directory for this kernel (forget the whole filename), and then:
fsck.ext3 Unable to resolve 'label=/boot'
and then get dropped into a maintenance mode with the file system mounted in readonly mode.
So what Have I Missed?
Or is this a lost cause and I should just do a full install on the new drive and proceed from there????
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Robert Moskowitz wrote:
I have set up a migration between two drives. fIrst I got Centos 5 working how I wanted on this drive, then set about copying it to another drive.
Hi Robert.
It's a little late now, but the way I'd do this kind of thing is to install on the first drive, creating a partition for /boot and a partition for LVM under which I'd carve up into my other partitions.
Once I have installed to the first drive, I would add the second drive, and partition it so that there is a partition for /boot, which you'd then copy the data from the primary /boot to this one and then use 'grub' to make the second drive bootable.
Next, create a physical volume on the new disk's LVM partition and then add it into the existing volume group. Next, use the pvmove command to move the data from the pv on the first drive to the pv on the second drive. Once you've done that, you can pvremove the first pv (from the first drive) from the volume group. At this point, you should have all of your data on the second drive. Double-check that the LABEL on the /boot partition is correct and then shut down the computer. Remove the first drive and reboot.
I'm writing this off the top of my head (having done is a couple of months ago to upgrade my laptop hard drive), and I may be missing some of the LVM incantations, but this should be close and get you started, anyway.
Barry