Install GRUB MBR on UEFI system from Debian installer

Help with issues regarding installation of Debian

Install GRUB MBR on UEFI system from Debian installer

Postby imrazor » 2018-01-16 22:21

I have a laptop with an extra drive bay. Windows 10 is installed on a GPT M.2 drive. I have another hard drive that has some pre-existing data and is formatted MBR. I want to install Debian to the MBR disk and then dual boot; Windows in UEFI mode and Debian in Legacy mode. I may have to manually access the BIOS' boot menu to do this, but it should be possible. The problem is that the Debian installer is having a hissy fit about there being no EFI partition on the MBR disk, and grub-install fails to install to "dummy". How can I make the installer put a master boot record and Grub in legacy mode on the MBR formatted disk?

I know I can back up the MBR disk and restore the data once it's formatted GPT, but it's a lot of data and that might take several hours, maybe even days. The MBR disk has already had the NTFS data partition resized and an EXT4 one created for Debian, I just can't get GRUB to install.
imrazor
 
Posts: 23
Joined: 2012-08-12 04:08

Re: Install GRUB MBR on UEFI system from Debian installer

Postby bw123 » 2018-01-16 22:32

I recall seeing that once from grub but I don't remember the details. Creating a 1M partition type 'bios boot' for grub was the solution though.

I didn't have any trouble going from mbr to gpt, gdisk handled it in about 5 seconds. A backup is probably a good idea though.
User avatar
bw123
 
Posts: 3385
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Install GRUB MBR on UEFI system from Debian installer

Postby imrazor » 2018-01-17 00:57

I figured out a workaround. I booted the laptop in legacy mode (instead of UEFI), installed GRUB to the MBR disk, and I didn't have any further trouble.
imrazor
 
Posts: 23
Joined: 2012-08-12 04:08

Re: Install GRUB MBR on UEFI system from Debian installer

Postby dotlj » 2018-01-21 02:01

Another way to do this, is to turn off Fast Boot in BIOS / UEFI. Windows on GPT will usually use fast boot so that a shutdown and reboot is really just a warm start, so you don't ever see the BIOS / UEFI.
Turn off fast boot and when you power on or reboot, you should see the screen from the manufacturer that briefly says Press F10 for Boot Menu, Press Del for startup options or something similar.
If you have windows on /dev/sda with the windows boot loader on /dev/sda and then install Debian on /dev/sdb, you can dual boot easily by using boot menu and startup and selecting the boot disk; /dev/sda for Windows (default if you do nothing), or /dev/sdb if you choose the other disk. In the boot menu you will usually get the disk type such as HGST1000 for Hitachi 1 TB or WD for Western Digital or Toshiba or Seagate depending on your disks.
User avatar
dotlj
 
Posts: 599
Joined: 2009-12-25 17:21

Re: Install GRUB MBR on UEFI system from Debian installer

Postby p.H » 2018-01-21 12:40

imrazor wrote:Windows in UEFI mode and Debian in Legacy mode.

May I ask why you don't want to install Debian in EFI mode ?
imrazor wrote:The problem is that the Debian installer is having a hissy fit about there being no EFI partition on the MBR disk, and grub-install fails to install to "dummy".

"dummy" means that the Debian installer was booted in EFI mode, and logically tries to install GRUB EFI, which requires an EFI partition. However it should be able to use the existing EFI partition on the Windows SSD. Or maybe it searches an EFI partition only on the installation disk. Does the installer see the SSD ? Anyway I would recommend that Debian has its own EFI partition on its own disk so that it does not depend on the SSD.
imrazor wrote:I know I can back up the MBR disk and restore the data once it's formatted GPT

Why would you do this ? GPT is not required for installation in EFI mode.
imrazor wrote:I figured out a workaround. I booted the laptop in legacy mode (instead of UEFI)

It is not a workaround. It is the way to go if you want to install Debian in BIOS/legacy mode.
bw123 wrote:Creating a 1M partition type 'bios boot' for grub was the solution though.

A "BIOS boot" partition can be created only on GPT. The OP wants to stick to DOS/MBR.
p.H
 
Posts: 595
Joined: 2017-09-17 07:12

Re: Install GRUB MBR on UEFI system from Debian installer

Postby imrazor » 2018-01-21 21:55

p.H wrote:May I ask why you don't want to install Debian in EFI mode ?

Because I thought it would involve backing up and nuking the entire hard drive, creating a new GPT partition table, restoring the data, then installing Debian. From one of the above posts, it seems that "gdisk" (a tool I'm not familiar with) can non-destructively convert the drive.
p.H wrote:"dummy" means that the Debian installer was booted in EFI mode, and logically tries to install GRUB EFI, which requires an EFI partition. However it should be able to use the existing EFI partition on the Windows SSD. Or maybe it searches an EFI partition only on the installation disk. Does the installer see the SSD ? Anyway I would recommend that Debian has its own EFI partition on its own disk so that it does not depend on the SSD.

I agree, I don't want interdependent drives. Booting in legacy mode and installing GRUB to my MBR drive seems to be working fine.
p.H wrote:Why would you do this ? GPT is not required for installation in EFI mode.

Because I did not realize this. I thought UEFI mode required a GPT disk, and similarly that legacy mode required an MBR disk.
p.H wrote:It is not a workaround. It is the way to go if you want to install Debian in BIOS/legacy mode.

Agreed. It seems to be working fine. Can you recommend any FAQs or tutorials on partitioning GPT disks? Up to this point I have only been using older systems and have not had to deal very much with UEFI or GPT.
imrazor
 
Posts: 23
Joined: 2012-08-12 04:08

Re: Install GRUB MBR on UEFI system from Debian installer

Postby p.H » 2018-01-22 11:44

http://rodsbooks.com/, the author of gdisk and rEFInd's website, has been an unvaluable source of information for me.

I use GPT on old BIOS machines with small capacity drives to get rid of the infamous extended and logical partitions.

I thought UEFI mode required a GPT disk, and similarly that legacy mode required an MBR disk.

AFAIK this is only a Windows requirement.
p.H
 
Posts: 595
Joined: 2017-09-17 07:12

Re: Install GRUB MBR on UEFI system from Debian installer

Postby Head_on_a_Stick » 2018-01-22 16:52

p.H wrote:
I thought UEFI mode required a GPT disk, and similarly that legacy mode required an MBR disk.

AFAIK this is only a Windows requirement.

The OpenBSD installer also defaults to a UEFI system if a GPT disk is used but will install a non-UEFI system to an MBR disk.

It is probably worth noting that whilst UEFI booting should be possible with an MBR disk, this depends on a fully-functional UEFI firmware implementation — I myself have one laptop that won't boot by that method and I have encountered several others in support threads.
User avatar
Head_on_a_Stick
 
Posts: 7994
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Install GRUB MBR on UEFI system from Debian installer

Postby p.H » 2018-02-11 11:09

Head_on_a_Stick wrote:The OpenBSD installer also defaults to a UEFI system if a GPT disk is used but will install a non-UEFI system to an MBR disk.

This is plain stupid. If the machine is not EFI-capable and has a GPT disk or is EFI-only and has a DOS disk, then it will result in an unbootable system.

Also, this is not the same as Windows. Let me rephrase : Windows installation mode depends on the boot mode and requires a GPT disk when booting in EFI mode or a DOS disk when booting in BIOS mode, otherwise the only option offered by the installer is to reset the disk with the "proper" format. This is not just a default setting, you cannot override it.

In any case, this is again a (stupid IMO) OS-dependent restriction.

Head_on_a_Stick wrote:It is probably worth noting that whilst UEFI booting should be possible with an MBR disk, this depends on a fully-functional UEFI firmware implementatio

If you rely on a fully-functional UEFI firmware implementation, then better not use UEFI at all. Most UEFI implementations I have come across were flawed in some way.
p.H
 
Posts: 595
Joined: 2017-09-17 07:12

Re: Install GRUB MBR on UEFI system from Debian installer

Postby Head_on_a_Stick » 2018-02-11 11:22

p.H wrote:
Head_on_a_Stick wrote:It is probably worth noting that whilst UEFI booting should be possible with an MBR disk, this depends on a fully-functional UEFI firmware implementatio

If you rely on a fully-functional UEFI firmware implementation, then better not use UEFI at all. Most UEFI implementations I have come across were flawed in some way.

I just meant that some UEFI machines that I have encountered will not boot a non-GPT disk in UEFI mode, that's all.

But yes, I prefer not to use UEFI, especially given the security concerns.
User avatar
Head_on_a_Stick
 
Posts: 7994
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Install GRUB MBR on UEFI system from Debian installer

Postby p.H » 2018-02-11 12:41

What security concerns ?
p.H
 
Posts: 595
Joined: 2017-09-17 07:12

Re: Install GRUB MBR on UEFI system from Debian installer

Postby Thorny » 2018-02-11 12:53

p.H wrote:What security concerns ?

Perhaps this from July 2017, which I easily found with a search engine.
http://www.uefi.org/sites/default/files ... .13.17.pdf

I do not know if it has been revised.
User avatar
Thorny
 
Posts: 542
Joined: 2011-02-27 13:40

Re: Install GRUB MBR on UEFI system from Debian installer

Postby p.H » 2018-02-11 13:08

I do not see how it is different from usual BIOS security concerns.
p.H
 
Posts: 595
Joined: 2017-09-17 07:12

Re: Install GRUB MBR on UEFI system from Debian installer

Postby Thorny » 2018-02-11 13:33

I don't have any power over what you see or understand and I have no intention of arguing something OT with you in someone else's thread. Now that's it out here, people can decide for themselves. Just wanted to mention that there could be some security concerns.

Phoenix Technologies, appears to recognise some.
User avatar
Thorny
 
Posts: 542
Joined: 2011-02-27 13:40


Return to Installation

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable