Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] Install GRUB to MBR of two drives

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
ticojohn
Posts: 1284
Joined: 2009-08-29 18:10
Location: Costa Rica
Has thanked: 21 times
Been thanked: 44 times

[SOLVED] Install GRUB to MBR of two drives

#1 Post by ticojohn »

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 am not irrational, I'm just quantum probabilistic.

User avatar
ticojohn
Posts: 1284
Joined: 2009-08-29 18:10
Location: Costa Rica
Has thanked: 21 times
Been thanked: 44 times

Re: Install GRUB to MBR of two drives

#2 Post by ticojohn »

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 am not irrational, I'm just quantum probabilistic.

User avatar
ticojohn
Posts: 1284
Joined: 2009-08-29 18:10
Location: Costa Rica
Has thanked: 21 times
Been thanked: 44 times

Re: Install GRUB to MBR of two drives

#3 Post by ticojohn »

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 am not irrational, I'm just quantum probabilistic.

Bulkley
Posts: 6386
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

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

#4 Post by Bulkley »

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.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

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

#5 Post by p.H »

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.

User avatar
ticojohn
Posts: 1284
Joined: 2009-08-29 18:10
Location: Costa Rica
Has thanked: 21 times
Been thanked: 44 times

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

#6 Post by ticojohn »

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 am not irrational, I'm just quantum probabilistic.

Post Reply