Article 57QDJ How do I update grub in a secondary disk?

How do I update grub in a secondary disk?

by
lucmove
from LinuxQuestions.org on (#57QDJ)
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?

TIAlatest?d=yIl2AUoC8zA latest?i=HGFmdLrrHxE:IuYk8M8fLUs:F7zBnMy latest?i=HGFmdLrrHxE:IuYk8M8fLUs:V_sGLiP latest?d=qj6IDK7rITs latest?i=HGFmdLrrHxE:IuYk8M8fLUs:gIN9vFwHGFmdLrrHxE
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments