How do I update grub in a secondary disk?
Let's say I have everything running hunky-dory on /dev/sda.
Then Grub gets damaged.
I boot up from another disk and connect the damaged one over USB. What used to be sda is now sdb.
I run:
# update-grub2
# grub-install /dev/sdb
The problem is, the two disks have differences between them and grub is going to reinstall itself on sdb with information scanned from sda. When I put the old disk back in its place and boot from it, Grub is going to complain that it couldn't find the root partition etc.
How do I tell update-grub2 ("a stub for grub-mkconfig" according to the man page) to scan sdb so that grub-install /dev/sdb updates sdb accordingly?
One way to do that is booting up from a Grub rescue CD, but that is very inconvenient when I am preparing a secondary disk to be ready to boot in case something evil happens to the primary one. I want to do the job right from the same command line, without having to reboot from a CD.
How do I do that?
TIA
|