Grub Success at Last
I did it! It works!
Okay. Here's the short story. I read some more stuff
about building a boot drive for another system than the one being
used for the rescue. In this thread were the usual tales of woe
which I have also experienced when misusing grub such as "Oh
#%^*! Now I've got 2 systems that won't boot." a poster on that
thread states:
I'm not a grub2 expert (sorry) but try adding --skip-fs-probe to your
grub-install line, I have found this prevents creation of
/boot/grub/device.map which can cause booting to a grub prompt. I think
that without this parameter grub-install, instead of doing what you
tell it, thinks it is cleverer than you, and may do something
different.
Another thing is to be sure you are using the right grub-install (i.e.
for grub2 and not for original grub). This isn't a problem if you are
inside Centos but with SystemRecoveryCD both versions are available and
so you have to use grub2-install. I learned the hard way...
And as @wurtel pointed out (kudos), you should specify a drive not a
partition. Grub2 installs in sector 0 of the whole disk drive, and this
'stub' is what runs at boot time, but it needs to know whereabouts on
the disk it should install the files for the next stage of booting -
this is what the --root-directory parameter is for. (I think.)
Reading man grub-install and googling I see that --root-directory is
not really meant to be used for grub2 versions 1.99++, though it does
work in my experience. You are meant to use --boot-directory and refer
to the actual boot directory, so this would give you:
grub-install /dev/sdb --skip-fs-probe --boot-directory=/media/new_drive/boot
End of quote
I did the following:
#!/bin/sh
#mount the drive being repaired. Uncomment lines as needed.
sudo mount /dev/sdd1 /mnt
cd /mnt/boot
#installing to the mounted disk
sudo grub-install \
--skip-fs-probe \
--boot-directory=/mnt/boot/ /dev/sdd
When you boot your disk that starts out on /dev/sda1,
it's the first partition, in this case, so it will be /dev/sda1
not /dev/sdd1 . This was quite a long thread and people were
remarking on how it is easy to get confused and do the wrong
thing.
Anyway, It booted right up and then I discovered there
was no network.
The network issue was only tangentially related because
the update-upgrade process also install some more strict and
modified ethernet interface naming rules and eth2 just doesn't
cut it any more. Now, it's enp0s17 on the system that just got
revived and enp0s18 or something similar on the system that got
the same upgrades but is a little newer and took the tharapy much
easier. Everything's working again at least in the Linux world.
I saw this ad on TV for some product that is supposed to
improve brain function and memory but I can never remember it's
name. I could use a few more IQ points and things would flow a
little faster around here.
Thanks for all the help, everybody.
Martin
Reply to: