You are not logged in.

#1 2013-04-30 18:19:12

stratabum
Member
Registered: 2012-09-05
Posts: 5

can uefi and bios be mixed?

Hello,
I've got one of those nice Samsung laptops (NP350E5C) that came with Windows 8 preinstalled, where if you install linux using UEFI it will brick because of a buggy firmware implementation.

In order to install Arch on it, I've made room on the C: partition reducing it to the bare minimum, planning to use the saved space for a big linux partition with everything in (boot, root, swap(file), home).
Not a nice practice I know, unfortunately the GPT partition table is full because of several multiple partitions used for factory recovering.

I'll accept the burden to switch from fastboot+secureboot+UEFI to CSM-only, using UEFI to boot win8 or BIOS (GRUB) to boot linux.

Will it boot whatsoever?
Should I put the GRUB bootloader on the disk (as usual) or on the linux partition?
Is it ok to have two partitions marked as boot (uefi and linux partition) or will the UEFI or GRUB boot loaders rant on it?

Last edited by stratabum (2013-04-30 19:23:47)

Offline

#2 2013-04-30 22:29:41

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

Re: can uefi and bios be mixed?

If you look into the bug a bit more, the bricking is something that is not unique to Linux.  It is entierly possible to brick your system from userspace using your windows install as well.  The difference is that the Linux kernel devs have publicly done something about it and have fixed (or maybe temporarily done away with?) the module that was responsible for this happening.

To answer your question more directly, yes it is possible to have UEFI and BIOS booting side by side.  In fact, they don't even interfere with each other, as they each use a different part of the hard drive.  The BIOS booting uses the first 446 bytes of the MBR, while UEFI boots from the EFI System Partition (ESP).  Linux (and your new machine) are also entirely capable of using a GPT/BIOS system as well, so there is no need for dangerous hybrid MBR crap either.

Offline

#3 2013-04-30 23:23:32

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,662

Re: can uefi and bios be mixed?

How many recovery partitions does the thing have? By default, GPT supports 128 partitions although a larger, non-default table can support more.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#4 2013-04-30 23:30:29

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

Re: can uefi and bios be mixed?

cfr wrote:

How many recovery partitions does the thing have? By default, GPT supports 128 partitions although a larger, non-default table can support more.

Wow, I totally skipped a line while reading the first post... this is also true.  You are not limited to the four partitions like the old MBR stype partitioning.  THe olad limitation was really a limitation of space.  The MBR (both the part that booted the machine and the partition table) took 512 bytes, of which oonly bytes 447-512 were for partitioning.  Now with GPT you are using the space that is after the MBR until the first sector of the first partition (2048).

Offline

#5 2013-04-30 23:46:25

stratabum
Member
Registered: 2012-09-05
Posts: 5

Re: can uefi and bios be mixed?

Thanks for the partition advice, it works (of course).

I've wrongly assumed not to be able to have more than 6 partitions as I've tried unsuccessfully to make one from a spare 1Gb present on the original disk layout using gparted from a live system.
This before resizing the C: partition.

Now that I have a proper linux partition schema in place it should be safe to deploy Arch there, setting also the boot partition as boootable (other than the EFI one) and installing the MBR on /dev/sda as usual, right?

I'm asking this only as I haven't fully undestood the "hybrid MBR crap" part.

Last edited by stratabum (2013-05-01 00:02:51)

Offline

#6 2013-05-01 16:48:45

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

Re: can uefi and bios be mixed?

Do not set the "boot flag" on any Linux partition using GParted. On a GPT disk, the "boot flag" is GParted's (or parted's, or other libparted-based tools') way of identifying the EFI System Partition. The ESP must be a FAT partition. This is admittedly confusing if you're used to MBR partitioning. Blame the libparted developers for re-using the "boot flag" terminology for a concept that's only loosely (at best) related to its purpose on MBR disks.

Do not create a hybrid MBR. Linux sees only the GPT side on such disks, and Windows sees only the MBR side. Windows also ties its boot mode to the partition table type, and on MBR disks, Windows will boot only in BIOS mode. Thus, if you convert your existing partition table to a hybrid MBR, Windows will stop booting, since you'll be trying to boot in EFI mode on what Windows will see as an MBR disk. If you want to convert Windows to BIOS-mode booting to avoid the Samsung EFI bug, that's perfectly reasonable; but in this case it's better to convert the disk to a full-up conventional MBR and install both Linux and Windows in BIOS mode.

Offline

#7 2013-05-05 02:50:14

stratabum
Member
Registered: 2012-09-05
Posts: 5

Re: can uefi and bios be mixed?

Blend!
it's three days I'm enjoing linux and windows on this system (just booted it twice to see if the annoying pest was still alive)!

Audience:
the "lucky" owners of selected Samsung laptops with buggy firmware that could brick them hard, should *any* program fill half of the NVRAM space.

Actually the bug was exposed during last year linux installations leading to infamous mainstream press news telling that installing linux would brick (samsung) laptops.
Since then the developer of the one interested kernel module fixed it but to date no one can still lightly recommend to install linux in UEFI mode on these systems as only a firmware upgrade from the manufacturer is The Real Fix.

To recap what I've done:
- booted Windows8 in recovery mode (press F4 while showing the Samsung logo)
- performed a factory reset AND resized the main C: partition from 400+ Gb to the minimum allowed size (64 Gb, fear not you'll still have plenty of place)
- read *carefully* the Archlinux Installation Guide and the Archlinux Beginner's Guide, keep them handy, expecially the partitioning section
- kept the factory setup GPT partitioning
- using "gdisk", created a tiny (less than 1M) partition at the start of the disk (suggested 1007K, mine is 1004K, anything over 32K should be ok) setting the type to EF02: this is a "BIOS boot partition" required during the subsequent bootloader install and used then by grub on GPT partitioned disks
- created 1 swap, 1 root (and everything else) and 1 home partition in the free space regained in the step above and mounted them
- installed "base" (and base-devel) packages
- installed "grub-bios" and run "grub-install" as well (as suggested in the Beginner's Guide but not in the Installation Guide)
- as I've said, just follow the Guide(s) and you'll be ok

Now to boot the preinstalled Windows8 (UEFI) just enable the settings "FastBios" and "SecureBoot" into the firmware menu, to boot Archlinux (BIOS) disable them and select "CSM only" in the subsequent menu.

It shouldn't happen too often ... wink

Last edited by stratabum (2013-05-05 08:52:04)

Offline

Board footer

Powered by FluxBB