I have a hard disk that's failing, so before it dies completely and I have to resort to backups I want to copy everything (OS and all) onto a new disk, and put that back in the machine the failing disk came from so I don't even have to do an OS reinstall. I am doing all this on my normal Linux desktop machine (with the new disk connected via SATA hotswap), although the disk will eventually be booted by, and run in, another machine (one of my home Linux servers.)
I have partitioned and formatted the new disk, and copied all the files across. The only thing left is to install GRUB on the new disk, so I can boot from it once it is installed in the target machine.
Unfortunately I can't figure out how to do this from my desktop PC. If I use
grub-install, it complains that the disk has no BIOS ID in my BIOS, which is pointless as my PC is never going to boot this disk.
$ grub-install --root-directory=/mnt/newdisk /dev/sdh /dev/sdh does not have any corresponding BIOS drive.
It's going to be the only disk in the server, so presumably the BIOS ID will always be 0x80.
How can I tell GRUB to install itself on this disk, and to act as if it's the only disk in the system? (without stuffing up the GRUB config on my desktop PC in the process!)