0

I would like to migrate my centos 6.8 installation from one 250gb disk to a newer 500gb one.

Since it's using LVM, I'm reading that moving data should be easy as adding the new disk to the same volume group, then moving all away from the old disk via vgreduce just before physically removing the old disk.

The problem is that apart from LVM, the setup also presents a /boot standard partition as /dev/sda1 and I'm having difficulties understanding how to proceed for the consequent bootup. I've tried the whole procedure on the following setup (via a virtualbox installation used as testdrive):

/dev/sda1 = 512mb boot ext4 on old 250gb disk
/dev/sda2 = LVM root on old 250gb disk
/dev/sdb1 = 512mb boot ext4 on new 500gb disk
/dev/sdb2 = LVM root on new 500gb disk

then from the live centos system I have:

  • prepared /dev/sdb with the same /dev/sda structure (512mb as ext4 for boot and then remaining space for LVM)
  • done all the pvcreate, vgextend, pvmove and vgreduce stuff regarding LVM
  • copied the old /boot contents to the new-to-be boot (after mounting it as /tmp/boot and rsyncing)
  • edited the /etc/fstab line for boot stating the correct UUID of /dev/sdb1
  • launched "grub-install /dev/sdb" (which required the --recheck flag to complete)
  • rebooted

but obtained only a miserable "hard disk failure" message instead of startup. Can someone please refer what is wrong in this approach and/or how to accomplish this?

thanks everyone

  • 1
    A typo probably: you edited fstab and put the UUID of /dev/sdb1. A step is missing: did you remount /boot with the new partition before the grub-install step? Did you rebuild your initrd too? (I believe there are information in it that need to be updated) – xhienne Jan 8 '17 at 23:52
  • thanks, just corrected the typo you noted for the uuid at fstab, also skipped your other suggestions which i will try asap, thanks for now! – funkoolow Jan 9 '17 at 10:37
  • Did you mark the /dev/sdb1 partition as bootable, when you partitioned the new disk? – Mario Vitale Jan 9 '17 at 11:01
  • 1
    @MarioVitale This bootable flag is for Windows. Grub has never had any problem booting non-flagged-as-bootable partitions. – xhienne Jan 9 '17 at 11:39
  • How odd. I don't see a problem with your process. What's producing the "hard disk failure" message; BIOS, GRUB, Linux kernel (least likely)? – Emmanuel Rosa Jan 10 '17 at 1:19
1

Before executing grub-install /dev/sdb, you must remount /boot. It may also be necessary to rebuild your initrd image (I believe there are information in it that needs to be updated).

Note: indeed, following these suggestions, OP reported it worked

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.