0

Foreword

This is technically not a Ubuntu-specific question but I suspect it's a valid question for Ubuntu users.

Actual question

Is it really worth booting a non-Ubuntu OS via grub, if it lives on a different physical drive than Ubuntu?

Context

Setup

My setup looks (or rather looked) as follows:

  • Desktop computer
  • Ubuntu on a SATA hybrid SSD
  • Windows 10 on a M2 SSD
  • I boot(ed) both Ubuntu and Windows 10 from the hybrid SSD where Ubuntu was, in a dedicated boot partition, via grub2
  • Everything EFI if that is relevant

I use Windows for things that only work with Windows due to market dominance, Ubuntu for literally everything else.

Background

A couple of days ago, my SATA hybrid SSD drive, where Ubuntu was sitting on, suffered a catastrophic failure, and became eminently unusable.

(note: in hindsight, this was doomed to happen - one of those infamous Samsung EVO 870s from 2021...)

I soon realized I could not even boot with Windows, since the drive was just gone, and the BIOS would not know how to boot from the drive where Windows was sitting.

Elaborated question

After a 2-day crunch buying a new hard drive, reinstalling and setting everything up (which is not nearly over), I've come to wonder what is the actual advantage of booting Windows or any non-Ubuntu OS for that matter via grub, on the drive where Ubuntu lives.

The alternative being, choose which drive to boot from by going to the BIOS settings when starting the machine.

If I had gone without grub and booted each OS on their own drive, I could have still used Windows without having to reinstall it as well.

The only thing I could think of was convenience - it's easier to navigate grub's menus rather than moving drive boot priorities in the BIOS.

However, I may be missing something technical that makes it a requisite to boot different OSes from the same drive and partition, regardless of the fact those OSes are sitting in different physical drives.

This is what I would like to better understand, in order to make an informed decision on the setup I am painfully rebuilding.

Mena
  • 721
  • @user68186 thanks, this sort of makes sense and I'd be happy if you could write an answer. But I haven't the first clue how I'd somehow "replicate" the partition grub is using save from manually creating one in the Windows drive and copying the efi folder content. And even then, I wonder how I could keep that in sync other than manually when ever e.g. a new kernel is installed. – Mena Mar 09 '24 at 20:08

1 Answers1

1

Question

Is it really worth booting a non-Ubuntu OS via grub, if it lives on a different physical drive than Ubuntu?

Answer

Yes. Grub is very flexible and easy to configure. It can easily work with Windows in a dualboot setup. The Windows bootloader [BCDEdit?] does not care about Ubuntu. In my opinion replacing grub with the Windows bootloader is asking from trouble.

I will not go into other OSes, such as installing multiple distros of Linux and the merits and demerits of using Grub from Ubuntu, Grub from another distro, or another bootloader from another distro.

To be clear, when we use Grub in an Ubuntu-Windows dual boot system, we keep both the bootloaders. Grub gets the leadership role and loads first. If Windows is selected from within Grub, it passes the job of booting Windows to the Windows bootloader.

What About the BIOS (UEFI) Boot Menu?

It is not as convenient and it keeps both Grub and Windows bootloader. The UEFI Boot Option just lets you choose between Grub and the Windows bootloader. You will still have Grub (for Ubuntu only) though it may not show you the menu and boot straight to Ubuntu.

Digging Deeper...

The main issue (as I understand it) is: What is the best way to handling booting when I have two disks with one OS in each?

UEFI and ESP

Computers these days come with UEFI the successor of BIOS. While in the olden days of floppy drives and Cathode Ray Tubes BIOS didn't need a separate partition, UEFI needs a dedicated partition called (U)EFI System Partition (ESP). Each computer should have (at least) one ESP in one of the disks. One ESP is sufficient to handle multiple OSes in multiple disks. However, it is possible to have two ESPs, one in each disk.

ESPs and Bootloader

In the olden days bootloaders were installed in the boot disk's system partition. With UEFI parts of the bootloader get installed in the ESP. Therefore, as much as it matters which bootloader, Grub, or Windows, you use, you need to understand in which disk the ESP is (or if each disk has its own) and thus where the bootloaders are installed.

2 Disks 1 ESP

Typically a computer comes with Windows installed. That means the ESP is usually in the same physical disks as the Windows. Until version 23.04, the Ubuntu installation process would put Grub in the first ESP it found (that is the one in the Windows disk) when you installed Ubuntu in a second disk.

In this setup if your Ubuntu disk died, you could still boot the computer by getting into UEFI setup and making the Windows bootloader the top choice.

What would happen if the Windows disk stops working? Well, in that case you can't boot either Windows or Ubuntu as the ESP would be gone with the disk.

The other disadvantage of a single ESP is that from time to time during a routine Windows update/upgrade it would notice that the Windows bootloader is not the default and make it the default. After that the computer would boot straight to Windows without showing the Grub boot menu. Though lately I have not seen this happen as much. This is easy to fix by going into the UEFI setup and changing the default or using an utility like boot-repair.

2 disk, 2 ESP

In this setup each physical disk gets its own ESP. That way the Grub goes into the ESP of the Ubuntu disk, and the Windows bootloader goes into the ESP of the Windows disks. Grub would still be in control. That is, you would still see the familiar Grub boot menu and select Ubuntu or Windows as before. Grub is smart enough (using the OS_prober) to find out Windows bootloader is in another ESP in another disks. Windows on the other hand would remain blissfully ignorant of the other ESP, Grub, and Ubuntu. Therefore, a Windows upgrade will not mess with the default bootloader.

Second. If either of the two disks dies, the computer can still be booted using the other disk and the other OS.

See Installing Ubuntu without touching Windows for more on how to setup a 2 disk 2 ESP dualboot system.

Bottom Line

Whether you have two ESPs or one, you should make Grub the default bootloader.

Hope this helps

user68186
  • 33,360
  • This is a very informative answer, thanks for that. But it doesn't explain one thing I might have not been explicit enough about: in my previous setup once I got grub to recognize my windows system, as far as I can tell it moved the windows ESP to the linux drive, which is why windows was not bootable without the drive where grub/ubuntu were located (I didn't do anything to have it that way, so I assume that's the default behavior). (part 1 of 2) – Mena Mar 09 '24 at 22:01
  • So this answers my question because it opens the opportunity to have grub still in charge, but of two separate ESPs. But doesn't explain how that's feasible in the scenario where you have one OS per drive, let grub discover windows, and at that point - I assume, since that's what happened with me - grub "takes the windows' ESP home where it lives", thus depriving windows of bootability should the other drive fail. Wondering if I'm making any sense... (part 2 of 2) – Mena Mar 09 '24 at 22:04
  • Grub never would have moved Windows boot files from one ESP to another. The only possibility may have been if default drive was the HDD when you installed Windows to SSD, that it then put its boot files in an ESP on HDD. Windows almost alwys has its ESP on same drive as Windows install. – oldfred Mar 09 '24 at 22:09
  • @Mena I have been using Ubuntu for more than 20 years. I have never experienced or heard of grub "taking Windows ESP where it lives". From your comments it looks like you ended up with a single ESP in the Ubuntu drive. Was this the original Windows drive, and did you reinstall Windows in the other drive? Grub or Ubuntu installation does not move ESPs. You may check each disk whether they have ESP by using the "disks" utility that comes with Ubuntu. – user68186 Mar 09 '24 at 22:09
  • Looks like some chaos happened and since it was back in 2021, no idea how it managed to get there. Thanks both for letting me know this is not how it's supposed to happen. Will test this again once I discover my reinstalled windows' drive with grub, by trying to boot directly from the windows drive via BIOS right after. – Mena Mar 09 '24 at 22:21