Barry L. Kline
2006-Jan-03 16:57 UTC
[CentOS] How to upgrade hard drive in a single drive (with LVM2) computer
This one has me stumped and I'm sure I must be missing something trivial. What is is eludes me. I have a 20G drive that will be replaced with a 160G drive. The /boot partition is just a standard type 83, and the swap is an 82. The system root partition is in a LV, as is the /home partition. I've upgraded hard drives dozens of times without incident, but never ona system with LVM. I did this (booted into single-user mode): 1) Create the appropriate partitions on the new drive 2) Created an EXT3 partition and copies over /boot, ran GRUB to make it bootable. 3) did the mkswap on the second partition. 4) did a pvcreate on the third partition on the new drive, then created th VG (vg1) and LV for the two paritions. 5) Mounted the new partitions under /mnt, then used tar to copy the files from the old to the new (excluding tmp mnt sys & proc) 6) Edited grub.conf (on the new drive) to point to VG1 instead of VG0 for sysroot. Edited /mnt/etc/fstab to point to the new locations (I changed the names of the logical volumes slightly.) 6) Disconnected the old drive, then booted. The system booted, but got only as far as 'Red Hat nash' ... then complained that it couldn't find vg0. (the volume group on the other disk). I can't get into single-user mode when booting this single drive. I'm trying to do this whole thing non-destructively so that the original drive is a backup, until we confirm that the new drive is behaving well. Are these steps correct (and they should be without LVM) or is there something much easier and obvious that I'm missing? I could, I suppose, add the new parition into the original volume group, and do the 'pvmove' dance to get things over (as explained briefly in the LVM-HOWTO on Red Hat's site) but it wouldn't leave a bootable system on the original drive. Any suggestions would be greatly appreciated! TIA, Barry
Bryan J. Smith
2006-Jan-03 17:08 UTC
[CentOS] How to upgrade hard drive in a single drive (with LVM2) computer
"Barry L. Kline" <blkline at attglobal.net> wrote:> 6) Edited grub.conf (on the new drive) to point to VG1 > instead of VG0 for sysroot. > Edited /mnt/etc/fstab to point to the new locations (I > changed the names of the logical volumes slightly.) > 6) Disconnected the old drive, then booted.When did you re-install GRUB (grub-insall)? And when you did, did you have it use the _new_ grub.conf?> The system booted, but got only as far as 'Red Hat nash' > ... then complained that it couldn't find vg0. (the volume > group on the other disk). I can't get into single-usermode> when booting this single drive. > I'm trying to do this whole thing non-destructively so that > the original drive is a backup, until we confirm that thenew> drive is behaving well.Consider booting the CentOS CD #1 in "rescue" mode. Let it find your root and then chroot and run grub-install.> Are these steps correct (and they should be without LVM) or > is there something much easier and obvious that I'mmissing?> I could, I suppose, add the new parition into the original > volume group, and do the 'pvmove' dance to get things over(as> explained briefly in the LVM-HOWTO on Red Hat's site) butit> wouldn't leave a bootable system on the original drive.It's best to treat the two sets of discs/volumes as different, and never put them in the same system. Again, use CD #1 to boot into "rescue" mode, chroot and run grub-install with only the new discs/volumes connected. -- Bryan J. Smith Professional, Technical Annoyance b.j.smith at ieee.org http://thebs413.blogspot.com ---------------------------------------------------- *** Speed doesn't kill, difference in speed does ***