I have a (non-UEFI) Gentoo Linux system, and I am preparing a hard drive for another system. I have prepared partitions for the new system, and now I want to make it bootable. I remembed that in legacy GRUB, I used these commands:
# grub grub> root (hd0,0) grub> setup (hd1)
This made a bootsector on current (hd1), which pointed to (hd0). Then, when I booted the system, the new disk became the first device (i.e. hd0) and everything worked.
The only thing I was able to find for GRUB2 is
grub2-install /dev/sdb, which installs the MBR pointing to UUID of some current volume, which of course fails when I move the disk to a new machine.
So, how do I make a bootable HDD with GRUB2?