Windows to Linux MBR, UEFI, Boot manager and other stuff

captain-sensible

Well-Known Member
Joined
Jun 14, 2019
Messages
2,910
Reaction score
1,973
Credits
18,114
Notes to myself.To be edited and corrected pending input from others

I find it good to distil down info and have it in its simplest form ; it makes it easier to remember. Basically these are notes to myself; if you find it patronizing that just means you have a healthy EGO.

If you think about a car for a second its engine is not the first thing that starts. To kick things off cars use a starter motor. Computers are a bit similar they don’t just launch full on into their OS.

Historically computers used firmware as a starting point. To give you another metaphor ever wondered where are the instructions that make washing machines run for an hour then rinse ? Well basically instructions with choices (code) is present on a computer chip.

BIOS is firmware which is just instructions that are present on a chip a chip.

When a computer is powered on code in the BIOS , reads some instruction in whats called the Master Boot Record (MBR) this only consists of 512 bytes and is located on the first sector of a hard drive disk. The MBR basically points to where the main operating system software is, so that it can be used.

As computers evolved 512 bytes was somwaht limiting so , then the MBR
pointed to some more detailed instruction to what and where should boot as the main O.S

This is where Grub and Lilo boot managers came in. In computers and ICT in general nothing stays still and as things further developed the MBR and BIOS system was found limiting ; for instance you could only have 4 primary partitions. A fix was of course to extend using “logical” partitions.

Then UEFI came on the scene which is just another firmware (code on the motherboard) and is associated with EFI partition and GPT table.

I now digress here to say in the process of moving from Windows to Linux there are a few bits of information that would be helpful. First lets mention the CPU (central processing unit) the main chip on the motherboard. The CPU processes information in 0 and 1’s. The amount it can handle at a time is usually distinguished by its a 32 bit processor or a 64 bit processor.

Its important to know because an operating system say Slackware comes in two forms 32 bit and 64 bit; similarly software to be installed as extra later also comes in 32 bit and 64 bit forms. One way of describing what a CPU is is to say its “Architecture” is either 32 bit or 64.

So you have your Windows PC ;how do you find out what Architecture is it running on?

Well a simple way is to hit the keyboard with the Windows Icon on it and key R, then you type in:
msinfo32

I checked this works by using my wifes HP Windows 10 laptop . IN the general summary it stated:
System type x64
BIOS MODE UEFI
X64 means its a 64 bit computer.

BIOS MODE is a term only the idiots at MICROSOFT come come up with since a computer boots using either BIOS or UEFI. Basically the two are mutually exclusive.

To know which boot system your PC is currently using when it comes to installing a Linux distro.

So for instance when I installed Slackware it gave me a choice of install boot loader to MBR which is the old system of using Lilo (a boot manager) with BIOS and MBR or Elilo ( the slackware new bootloader) which uses UEFI on motherboard , needs an EFI partition and in this mode will not use MBR nor BIOS.

When a computer boots that uses UEFI, it scans all bootable devices for a valid GUID i.e GPT table. Secure boot is an extension of UEFI; you can use it without secure boot. I have to since currently Slackware Linux can not work with secure boot.

A quick mention of Debian my understanding is if installing on a PC to use MBR and BIOS you need
grub-pc and if your PC is going to use UEFI you need grub-efi.

Now for the command line nerds here are a few commands.

bash-5.0$ ls /sys/firmware/efi/
config_table esrtfw_vendor runtime-mapvars
efivars fw_platform_sizeruntime systab
bash-5.0$ cat /sys/firmware/efi/fw_platform_size
outputs : 64

# parted dev/sda

Model: ATA BHT WR202I0064G (scsi)
Disk /dev/sda: 62.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 106MB 105MB fat32 efi boot, esp
2 106MB 4401MB 4295MB linux-swap(v1) swap
3 4401MB 62.5GB 58.1GB ext4


Model: Generic- SD/MMC/MS PRO (scsi)
Disk /dev/sdb: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 15.9GB 15.9GB primary ntfs

bash-5.0# efibootmgr

BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001,9999
Boot0000* SlackwareHD(1,GPT,192a9aa1-9848-4329-8171-9253ffc0f920,0x800,0x32000)/File(\EFI\Slackware\elilo.efi)
Boot0001* Windows Boot ManagerHD(1,GPT,14e3012e-310b-42fd-961b-19272d6995fb,0x800,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS..
(edited down)

efibootmgr is a command that can be used to tweak the UEFI boot menu
 
Last edited:


The first time I used UEFI was a couplefew of years ago. I was about to install Kubuntu 16.04 LTS on fresh hand-built desktop PC. I kinda fretted over it for a while, there was a lot of good/bad info on the internets about it. I found some great resources (Rod Smith's ebooks), and then a good synopsis or two on the Kubuntu forums.

For the most part, it's easy, unless the motherboard maker makes it hard. Gigabyte makes it easy.

1) Disable Secure boot.
2) set SATA to AHCI, not any of those fake hardware RAIDs that some use for Windows.
3) Make sure it's pure UEFI, not CSM, not Legacy
4) Attach your USB drive with the Live/Installer, and make that USB the first boot device.
5) Save your changes, And boot.

Use your installer how you want to use it.

Bada bing, and done.

You may find at some later time (I haven't yet) that some peculiar piece of hardware will only run with Secure boot enabled. Not a big deal, change it and run it. The Ubuntu/Mint and other relatives in the family come with an installed binary that has a security key that works with the UEFI security key. But, typically it's not a problem.

And that is the really long explanation.
 
I'm just a watching and learning :cool:
 

Members online


Latest posts

Top