Rebuilding grub2 after moving system to a new drive

asked 2017-03-06 01:50:28 -0600

sideburns gravatar image

updated 2017-03-11 21:31:25 -0600

I've just finished moving my desktop's Fedora 21 system to a new hard drive using Clonzilla, and I can't get it to boot. I've made sure that grub2 is installed in the right place, but it just complains that it find the specified device, even though the UUID is correct. I've tried using the Fedora Project's instructions for booting from the grub prompt, but they're wrong. Using a different set, I learned about using set to get it to accept such things as the kernel and initramfs to use. Alas, it's stuck in grub rescue, doesn't understand normal to get out of rescue, or boot to try booting the system. I don't really want to install F 25 and trying to reinstall all of the programs I've got, but I may have to. I do have /home on its own partition, so I won't lose everything, but it's still a PITA. Does anybody know how to either rebuild grub from a Live System, or to get grub to do what it's supposed to, so that I don't need to use the nuclear option of complete reinstall


I suppose that I should also mention that this whole thing started because I had to move to a new mobo, that didn't have the right connectors for the old drives. Also, the new mobo doesn't have nVidia graphics as the old one does. At one point, it almost booted but failed because of the nVidia drivers. I rebooted from the flash drive, used chroot to the root of the old system and used dnf remove -y \*nvidia\* to get rid of them. Still can't boot, but at least they're not an issue any longer.

EDIT #2:

Recent attempts to boot have reported a kernel panic and that it's failing to sync. It's told me that there's no working init and that I should try passing init= on the command line, and sometimes that it can't execute /bin/sh.

edit retag flag offensive close merge delete


Could the following work: Boot Fedora 21 Live, chroot into your "broken" installation, reinstall grub. Are you on a BIOS system?

florian gravatar imageflorian ( 2017-03-06 09:12:40 -0600 )edit

That was the first thing I tried, although I used a flash drive with a full install of F25.

sideburns gravatar imagesideburns ( 2017-03-06 13:04:07 -0600 )edit

The first thing I did was use grub2-install. That failed, because it couldn't find the right UUID at boot. Then, I tried rebuilding grub.conf, specifying the /boot/grub2 folder on that hard drive, to make sure it was in the right place. No better. Using chroot failed because it couldn't find /dev/sda1. And, trying to boot from a grub rescue> CLI fails as I wrote above.

sideburns gravatar imagesideburns ( 2017-03-06 15:12:50 -0600 )edit

I downloaded BootRepair, got to the point that I sometimes get to a proper grub> prompt, and can almost get it to boot when that happens. Otherwise, it keeps complaining that there's no init specified, or if I edit the command line to add one, it fails.

sideburns gravatar imagesideburns ( 2017-03-06 23:52:36 -0600 )edit

Are you sure the data you restored using Clonezilla is not corrupt? Have you attempted another restore?

florian gravatar imageflorian ( 2017-03-11 21:56:06 -0600 )edit