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

 

 

 

Install GRUB MBR on UEFI system from Debian installer

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
imrazor
Posts: 23
Joined: 2012-08-12 04:08

Install GRUB MBR on UEFI system from Debian installer

#1 Post by imrazor »

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.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Install GRUB MBR on UEFI system from Debian installer

#2 Post by bw123 »

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.
resigned by AI ChatGPT

imrazor
Posts: 23
Joined: 2012-08-12 04:08

Re: Install GRUB MBR on UEFI system from Debian installer

#3 Post by imrazor »

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.

User avatar
dotlj
Posts: 646
Joined: 2009-12-25 17:21

Re: Install GRUB MBR on UEFI system from Debian installer

#4 Post by dotlj »

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.

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

Re: Install GRUB MBR on UEFI system from Debian installer

#5 Post by p.H »

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.

imrazor
Posts: 23
Joined: 2012-08-12 04:08

Re: Install GRUB MBR on UEFI system from Debian installer

#6 Post by imrazor »

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.

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

Re: Install GRUB MBR on UEFI system from Debian installer

#7 Post by p.H »

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.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Install GRUB MBR on UEFI system from Debian installer

#8 Post by Head_on_a_Stick »

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.
deadbang

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

Re: Install GRUB MBR on UEFI system from Debian installer

#9 Post by p.H »

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.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Install GRUB MBR on UEFI system from Debian installer

#10 Post by Head_on_a_Stick »

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.
deadbang

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

Re: Install GRUB MBR on UEFI system from Debian installer

#11 Post by p.H »

What security concerns ?

User avatar
Thorny
Posts: 542
Joined: 2011-02-27 13:40

Re: Install GRUB MBR on UEFI system from Debian installer

#12 Post by Thorny »

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.

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

Re: Install GRUB MBR on UEFI system from Debian installer

#13 Post by p.H »

I do not see how it is different from usual BIOS security concerns.

User avatar
Thorny
Posts: 542
Joined: 2011-02-27 13:40

Re: Install GRUB MBR on UEFI system from Debian installer

#14 Post by Thorny »

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.

Post Reply