You are not logged in.

#1 2013-11-19 14:23:51

dsp
Member
Registered: 2013-03-12
Posts: 7
Website

[solved] howto change from UEFI to BIOS boot?

Hello,

I need some help to change from UEFI to BIOS booting.

a couple of weeks ago I had a go at installing archlinux on my late 2008 Macbook Pro (5.1). From all information I could find then the cleanest dualboot option was to use GPT partitioned disk and boot arch in EFI mode. Now everything is working fine (after some hassle I managed to get wifi working) except X wont start. This renders the system unsusable for everyday work for me. The included Graphics are NVIDIA 9400M and 9600M GT. The last two days I started to have a go at fixing this installation and found various sources that basically mentioned it would not be possible to use the nvidia driver in UEFI mode. Also the nouveau driver soesn't seem to be working. (with the nvidia driver i get the logo and then black screen, with the nouveau I stay on the commandline.)

So it seems the solution for me would be to boot in BIOS mode.

1) Is it possible to keep the installation and just change the way I boot?

2) what would be the necessary steps to perform?

I have read that in general it is possible to boot GPT disks with BIOS mode. So I reckon I can keep my partition layout. I assume I will have an unused small partition that now holds the archlinux efi entry.

I think I would need to istall rEFit, maybe reinstall grub (where to?), maybe change some bootable flag, change my grub.cfg (how?).

Can anyone please confirm and provide small details? Or hint me in a better direction?

I find a lot of information, for different approaches, that all deal with setting up new systems. Since I have already gone through some hassle to just install the system with wifi working (atm it is difficult for me to get proper internet over eth0) I would prefer not to start from zero again.

Thank you for reading,
Dominik

Last edited by dsp (2013-11-20 10:21:40)

Offline

#2 2013-11-19 14:41:08

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [solved] howto change from UEFI to BIOS boot?

UEFI and legacy bios setups can coexist.  Simply set up the bios booting how you would like. 

Now with a Mac this might be a bit wonkier, since I would have to imagine that it would default to EFI.  So you may find that you have to actually remove the EFI setup at some point.  But that won't in any way prevent you from still being able to install all the necessities in order to get it going.

Also, the way in which Macs decide that they will go into bios compatibility mode is by the presence of a MBR.  So you either have to make a hybrid MBR or covert the partition table from GPT to MBR.  Thankfully srs5694's gptfdisk provides both of these functions.


Edit:  Apparently just mentioning srs5694 will summon him smile

Last edited by WonderWoofy (2013-11-19 16:19:37)

Offline

#3 2013-11-19 15:32:46

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [solved] howto change from UEFI to BIOS boot?

Macs are weird. If you follow PC instructions on a Mac, you will run into problems.

Macs manage BIOS/CSM/legacy-mode booting by using the partition table as a cue: If the disk contains either an old-style Master Boot Record (MBR) Partition table or a hybrid MBR, and if a partition in that MBR has its boot flag set, the firmware activates its BIOS/CSM/legacy support, enabling it to boot in BIOS/CSM/legacy mode. If the disk contains a GPT with a conventional protective MBR, or if no MBR partition is marked as bootable, the firmware will boot only in EFI mode.

One big question mark in my mind about your post is whether you've installed Linux alone or are dual-booting. If you've got a Linux-only system, and if you never intend to install OS X on the computer, you can switch to BIOS/CSM/legacy booting as follows:

  1. Use gdisk to convert your partition table from GPT to MBR. This will activate the firmware's BIOS/CSM/legacy support, and is superior to using a hybrid MBR because the latter is dangerous and flaky. The gdisk documentation describes how to do the conversion. Note that there are caveats, particularly if you've got more than four partitions on the disk; see the documentation for details.

  2. Install the BIOS-mode boot loader of your choice (GRUB Legacy, GRUB 2, LILO, or SYSLINUX).

  3. Hope for the best and reboot. If all goes well, you'll end up booting in BIOS/CSM/legacy mode. If not, you'll have to debug problems.

If you're dual-booting with OS X, though, you'll need to create a hybrid MBR to activate BIOS/CSM/legacy support, because OS X requires GPT. (Well, technically, it is possible to boot OS X from an MBR disk, but that involves jumping through hoops and will complicate future OS X updates. I don't recommend it.) You can then install a BIOS-mode boot loader and, in theory, choose which to boot via the Mac's built-in boot manager, rEFIt, or rEFInd. (Note that rEFIt has been abandoned; I forked it to create rEFInd, which is under active development.) Note that neither OS X nor Linux actually uses the hybrid MBR partitions, although some BIOS-mode boot loaders may. Thus, if you go this route, I recommend adding the last partition on your disk, and maybe any partition(s) where secondary boot loader code resides, to the MBR, and leave the rest of the disk's partitions protected by the type-0xEE protective partition.

All that said, IMHO BIOS-mode booting on a Mac should be avoided if at all possible, at least when dual-booting with OS X. (In a Linux-only setup, BIOS/CSM/legacy-mode booting is simpler.) A hybrid MBR is ugly and dangerous. I can't tell you how many times I've run across posts from people who've hosed their hard disks because of hybrid MBR problems. If you can work around your graphics problems in EFI mode, I recommend you do so. I've had some recent dealing with somebody who was having problems with the proprietary Nvidia driver; using the open-source Nouveau driver instead got the system working. You might try that, assuming you've trying to use the proprietary driver.

Offline

#4 2013-11-19 19:31:39

dsp
Member
Registered: 2013-03-12
Posts: 7
Website

Re: [solved] howto change from UEFI to BIOS boot?

Thank you for you replies!

@srs5694
I am dualbooting with OSX.
And I also tried the nouveau driver. In fact I would prefer the open solution. Unfortunately I didn't read any Apple-nouveau success stories yet...

I used gptfdisk to make a hybrid MBR.

GPT          ->    MBR
/dev/sda2 -> /dev/sda4 OSX
/dev/sda5 ->  /dev/sda3 /boot   BOOT- Flag
/dev/sda6 ->  /dev/sda2 /

I installed grub to my boot partition (I used /dev/sda5) installed a /boot/grub/grub.cfg and rebooted. Apple's bootmanager hasn't changed. I only see the EFI boot option, which takes me to the EFI- grub.

Does the /boot partition need to be readable by the Apple Bootmanager? (it's now ext2)
Or is it possible, that since it finds a working GPT table it doesn't look at the MBR? Or should I install grub to /dev/sda instead of /dev/sda5?

I'm so looking forward to be able to use a proper linux again....

Offline

#5 2013-11-20 10:20:12

dsp
Member
Registered: 2013-03-12
Posts: 7
Website

Re: [solved] howto change from UEFI to BIOS boot?

Hello,

I did install rEFInd now and managed to boot using BIOS mode.
the nvidia driver works. very nice.

Thank you.

I was a bit hesitant installing rEFInd because I had bad memories with rEFIt. But this one seems to work nicely.

Only remaining question:
Should I try to revert the hybrid MBR? As far as I can see, also the BIOS boot seems to ignore it and uses my GPT Volumes instead.
How would I do that?

Dominik

Offline

#6 2013-11-20 16:03:53

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [solved] howto change from UEFI to BIOS boot?

srs5694 wrote:

Macs manage BIOS/CSM/legacy-mode booting by using the partition table as a cue: If the disk contains either an old-style Master Boot Record (MBR) Partition table or a hybrid MBR, and if a partition in that MBR has its boot flag set, the firmware activates its BIOS/CSM/legacy support, enabling it to boot in BIOS/CSM/legacy mode. If the disk contains a GPT with a conventional protective MBR, or if no MBR partition is marked as bootable, the firmware will boot only in EFI mode.

Offline

#7 2013-11-20 20:18:18

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [solved] howto change from UEFI to BIOS boot?

Converting the hybrid MBR to a conventional protective MBR will disable the BIOS/CSM/legacy support in the Mac's firmware.

Here is the thread I've encountered recently in which somebody had success with the Nouveau driver in EFI mode under OS X. (This is on a Gentoo system.) Unfortunately, the last couple of posts indicate some new problems, but I suspect bad RAM or some other hardware cause. In any event, the posts indicate the need to compile specific support into the kernel rather than as a module. I have no idea how the standard Arch kernel binaries are compiled in this respect. If they use modules, it could be you'd need to compile your own kernel from source code to get this to work. IMHO, it's worth the effort. Because you've got BIOS/CSM/legacy-mode booting working, you can experiment with this at your leisure, if you decide to try it; with rEFInd, you can easily try a new kernel in EFI mode and, if it doesn't work, switch right back to a BIOS/CSM/legacy boot.

Offline

#8 2013-11-21 08:59:53

dsp
Member
Registered: 2013-03-12
Posts: 7
Website

Re: [solved] howto change from UEFI to BIOS boot?

I will try to get the nouveau driver working. It will be something for a rainy day in the future though, otherwise I see the danger of using the computer mainly to maintain itself. It badly cries for some non maintainance work smile

Thank you for providing help and rEFInd. It's good to have the opportunity to change between EFI anf BIOS boot at will.

@WonderWoofy
I was aware of this. My machine, however, seemed to ignore my MBR. If I now launch cfdisk I can see the MBR with the BOOT-flag for sda3. Apple's bootmanager did not activate CSM support, but booted into my EFI grub.

Offline

#9 2013-11-21 14:31:23

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [solved] howto change from UEFI to BIOS boot?

dsp wrote:

@WonderWoofy
I was aware of this. My machine, however, seemed to ignore my MBR. If I now launch cfdisk I can see the MBR with the BOOT-flag for sda3. Apple's bootmanager did not activate CSM support, but booted into my EFI grub.

Aaahhh, now that makes a whole crap load more sense why you would want to take away the MBR portion... sorry about that.

Offline

#10 2014-01-27 21:01:37

blowfish711
Member
Registered: 2014-01-27
Posts: 7

Re: [solved] howto change from UEFI to BIOS boot?

Two questions, possibly (probably) related, and likely very noob-ish (sorry!):

(1) How exactly do you set up rEFInd to switch between EFI and BIOS boot "at will"?
(2) How do you install a BIOS boot loader?

For the record, I am trying to install Linux (Mint 16, but it can't be that different, can it?) on a mid-2010 Macbook Pro 13-inch (7,1). I'm pretty sure I've gotten the hang of creating a hybrid MBR, and it seems to work because I have no trouble running Windows (7). However, I have no idea how to go about booting Linux in CSM mode (I've tested it using the "dmesg" method suggested at the rEFInd website). I've tried using the Linux installer to create a BIOS boot partition (100MB) immediately before my Linux filesystem (ext4, mounted to '/'). I thought maybe I had to select the BIOS boot partition for installing the boot loader, but everything I've read says that you should only ever install the boot loader on the actual Linux filesystem.

And btw, yes, I am well aware of the dangers of the hybrid MBR, but I've been having terrible glitches with the nouveau driver to the point where the machine (booted to Linux) is barely usable.

Offline

#11 2014-01-27 23:08:31

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [solved] howto change from UEFI to BIOS boot?

@blowfish711, although it probably isn't all that different, you need to ask this on the Linux Mint boards.  Arch is a very DIY distribution which doesn't try to automate things for the user, while Mint does do these things.  As such there are probably more things to consider when doing this from a a distribution like that.

I will tell you that BIOS compatibility and UEFI setup can happily live on the same disk without interfering with each other though.

Offline

Board footer

Powered by FluxBB