How to install grub on multiple disks?

15,167

Solution 1

I think you can just do

grub-install /dev/sda
grub-install /dev/sdb
grub-install /dev/sdc
grub-install /dev/sdd
grub-install /dev/sde
grub-install /dev/sdf
grub-install /dev/sdg

I can't really foresee what kind of problems you'll be having with grub's HD addressing, though, if your disks are mixed up.

Solution 2

You didn't write anything like, which distro you use (Am I blind?). Today I almost destroyed my server, because I was really pi**ed off of not working grub-install. I used to have GRUB error 17, when trying to do that.

So I have better solution, how to install very easily and very quickly grub to multiple drives in raid. If you can boot your system (after install or from live distro), and have Debian Wheezy (in my case ver 7.2), you can just type following command:

dpkg-reconfigure grub-pc

(you must be root when doing this!!!)

I was pressing just enter, enter, enter and last screen, there was a question, into which devices I want to install the GRUB! :-) Just by your space choose all physical drives (do not choose /dev/md devices, just /dev/sdb /dev/sdc and so on and neither don't choose /dev/sdb1 or /dev/sdb2, just only devices without numbers!) In my example /dev/sdb /dev/sdc dev/sdd /dev/sde not /dev/sdb1... Then you go next and wait few seconds (about 30 or 45 seconds to finish) and get a next bier for a celebretion, because YOU DID IT! ;-)

Ubuntu-server 12.04 LTS ask you at the ending of installation, if you want to install grub into all devices. Debian does not have it.

After this solution, it does not matter on which hard drive boots earlier or later, it will boot everytime.

Enjoy ;-)

Share:
15,167

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    I have weird situation - order of disks as reported by BIOS, is different than order of disks that Linux sees.

    Which makes for problematic run - grub installs to sda, but bios boots from sdd or something like this (this machine has 7 disks, 4 on internal controller, and 3 on external.

    Is it possible to make grub install (and later on update) to all disks, and not just /dev/sda? I have no idea which disk is the one that bios wants to boot (all disks are the same, and since I have raid over it, I can't remove them at will), so the only solution I see is to make grub install on all sda-sdg.

    This is Debian stable, with Grub2.

  • Gabriel
    Gabriel over 12 years
    ok. but how to make it happen every time that I install new kernel? or will that not be necessary?
  • Halfgaar
    Halfgaar about 12 years
    Sorry for the very late reply; I'm not used to not getting e-mail about it... Anyway, you don't need to do that for every new kernel. The bootloader dynamically looks up the kernel.