[SOLVED] Install GRUB to MBR of two drives

Kernels & Hardware, configuring network, installing services

[SOLVED] Install GRUB to MBR of two drives

Postby ticojohn » 2021-02-23 19:29

I have two drives, a SSD and an HDD, installed in my desktop. Both drives have Debian Buster installed in the legacy mode. The fstab of the SSD has it mounting as /dev/sda1 and fstab of the HDD mounts as /dev/sdb1. GRUB is currently installed on the SSD.

What I would like to do, if possible, is to have GRUB installed to the MBR of both drives so that if the SSD fails I can simply select the HDD in the BIOS boot order and then boot from that drive. As it stands, if I try to boot directly to the HDD I get a GRUB_calloc error. Maybe I am misunderstanding the problem but I am assuming that error is because GRUB is not installed to the MBR of the HDD. So, is it possible to have both drives bootable by selecting the appropriate boot order in the BIOS?

What I have tried is to install grub on the HDD and while that makes that drive boot when selected in BIOS, then the SSD is no longer bootable when selected in the BIOS.
Last edited by ticojohn on 2021-02-24 20:26, edited 2 times in total.
I'm not irrational, I'm just quantum probabilistic.
User avatar
ticojohn
 
Posts: 880
Joined: 2009-08-29 18:10
Location: Costa Rica

Re: Install GRUB to MBR of two drives

Postby ticojohn » 2021-02-23 20:23

By the way, I do have a work-around of sorts. I have Debian Stretch installed on a USB device (EFI mode) and with that thumb drive I am able to boot to boot either the SSD or HDD. But I would really like to have grub in the MBR of both drives if possible.
I'm not irrational, I'm just quantum probabilistic.
User avatar
ticojohn
 
Posts: 880
Joined: 2009-08-29 18:10
Location: Costa Rica

Re: Install GRUB to MBR of two drives

Postby ticojohn » 2021-02-23 21:18

After thinking through my question, and doing a lot of searching, I am beginning to think that my desire to have the grub boot loader on two separate drives (both Debian) is not a very good idea. It might work but whenever I do an upgrade it may cause problems. Not sure. Would be nice to hear some opinions and/or suggestions. However, at this time I am thinking that my usb thumb drive solution is probably the safest and easiest solution. Thanks to all that have viewed this post.
I'm not irrational, I'm just quantum probabilistic.
User avatar
ticojohn
 
Posts: 880
Joined: 2009-08-29 18:10
Location: Costa Rica

Re: [resolved] Install GRUB to MBR of two drives

Postby Bulkley » 2021-02-23 23:05

The problem I foresee is not knowing which drive is mounted and proceeding to do something dumb. One needs an indicator such as different wallpaper or a Conky warning on one or both of them.
Bulkley
 
Posts: 6069
Joined: 2006-02-11 18:35

Re: [resolved] Install GRUB to MBR of two drives

Postby p.H » 2021-02-24 13:23

ticojohn wrote:if I try to boot directly to the HDD I get a GRUB_calloc error. Maybe I am misunderstanding the problem but I am assuming that error is because GRUB is not installed to the MBR of the HDD.

No, GRUB is installed in the MBR of the HDD but you get this error because there is a version mismatch between the part installed in the MBR and the part installed in the /boot/grub location it points to (which may be on either disk). This can happen when one part is updated and not the other.

There are two ways of installing GRUB on both drives :
a) Install GRUB in the MBR on both drives from the same Debian instance. Both MBRs point to the same /boot/grub location of that instance. This means that the disk of the other Debian instance will not boot properly if the other disk is missing or failed.

b) Install GRUB in the MBR of each drive from the Debian instance installed on that drive. Each MBR points to the /boot/grub location on its own disk and does not depend on the other disk.

How you boot a Debian instance from GRUB installed by the other Debian instance is a separate issue.
p.H
 
Posts: 1681
Joined: 2017-09-17 07:12

Re: [SOLVED] Install GRUB to MBR of two drives

Postby ticojohn » 2021-02-24 20:32

Thanks p.H !! I obviously erred when installing Buster to the HDD and grub apparently didn't get properly written to the MBR, if at all. I just installed grub and updated. Both drives are now bootable when selected as first drive in the BIOS. I feel kinda dumb all over. But, we learn by asking questions AND by getting good answers. I appreciate your help. Kudos!

UPDATE: I think I know what happened. It's been over a year since I installed Buster on the HDD, but I seem to remember a prompt during the installation that asked if I wanted to install grub on the drive, and I think I answered NO. Not sure why but I was probably concerned that doing so would somehow effect grub on the SSD. Ignorance is NOT bliss. Again, thank you p.H for enlightening me.
I'm not irrational, I'm just quantum probabilistic.
User avatar
ticojohn
 
Posts: 880
Joined: 2009-08-29 18:10
Location: Costa Rica


Return to System configuration

Who is online

Users browsing this forum: No registered users and 14 guests

fashionable