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

 

 

 

[Revised]HOWTO: AMD64 Debian GNU/Linux and UEFI

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Message
Author
milomak
Posts: 2159
Joined: 2009-06-09 22:20
Been thanked: 1 time

Re: [Updated 5x]HOWTO: AMD64 Debian GNU/Linux and UEFI

#16 Post by milomak »

i've installed a testing version on uefi.

had to disable secure mode in my bios and left it at uefi rather than legacy mode (this was a mistake on my part having not properly read the literature)

grub installed, os-prober even found win8. however it was failing.

The below is an example of getting grub2 to work

Code: Select all

#!/bin/sh
exec tail -n +3 $0
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "Windows (UEFI)" {
   search --set=root --file /EFI/Microsoft/Boot/bootmgfw.efi
   chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/40_custom ###
i'm sure i changed the -set= part to point to the drive

i'll update when i am at my laptop tomorrow
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid

nsigesv
Posts: 1
Joined: 2013-05-15 12:58

Re: [Updated 6x]HOWTO: AMD64 Debian GNU/Linux and UEFI

#17 Post by nsigesv »

pier wrote:Re: [Updated 5x]HOWTO: AMD64 Debian GNU/Linux and UEFI

Post by pier » 2013-04-18 20:55
Many thanks for the very useful HOWTO hkoster1!
I have ALMOST succesfully installed wheezy in UEFI double boot on my new acer V5 571G (the other system is windows 8, which I only intend to use for compelling work-related reasons, if any)....
Hi hkoster1 and pier,

I also have an Acer, a Predator, that I'm trying to install Debian on. On my box the UEFI partition is on SDA2 too and I shrinked that partition to make room for Linux. In the Debian installer the newly created partition is sda5 ext4 mounted as /. In your posting you mentioned installing the grubx64.efi entry using efibootmgr. Did you mount sda2 with the DI, and how did you copy that file there? You also mention the "windows manager" accessed with <ESC><F12>. How to access the Boot Manager and Boot Maintenance Manager with keys?

Thanks!

shmerl
Posts: 302
Joined: 2009-07-30 21:41

Re: [Updated 6x]HOWTO: AMD64 Debian GNU/Linux and UEFI

#18 Post by shmerl »

I just got a new computer, and want to try installing Debian testing (KDE) in gpt / UEFI boot flavor (regular, no secure boot) I'll be using Wheezy live KDE image with installer and then upgrading to testing. Is this HOWTO still relevant? I.e. I need to make gpt partitions by other tools first (for example I can use SystemRescueCD image), and the uefi-bios step is still needed as I understood from the discussion above, right?

And just to clarify, regular /boot partition should be a separate one from the EFI parition?

UPDATE: That method worked, though my computer didn't want to boot in legacy (BIOS) mode, no matter what. I had to insert the harddrive in the older machine to perform the steps for enabling UEFI based GRUB. Everything else worked otherwise, except the new GRUB complained something about not being able to set a mode (not sure what that was). But it least it booted properly.

Also, it's good to note that Debian installer from Wheezy uses mkfs.xfs which creates 512 bytes sectors for XFS for hybrid hard drives with 4096 B physical sectors (i.e. which use 512 B logical sectors). Newer mkfs.xfs sets the sector size to 4 KB for such drives, for more optimal performance. Since I used SystemRescueCD for partitioning, it already shipped with recent mkfs.xfs, so it formatted it appropriately.

hkoster1
Posts: 1264
Joined: 2006-12-18 10:10

Re: [Updated 6x]HOWTO: AMD64 Debian GNU/Linux and UEFI

#19 Post by hkoster1 »

I see you've been having fun trying various options on your new computer...

Wheezy will use UEFI as long as there is a GUID partition table (GPT) present, but how to get that GPT if the computer doesn't boot in legacy BIOS mode?
Remember that liveCDs like PartitionMagic and GParted require BIOS booting... a question of chicken-or-egg being first. Do I infer from your post that you provided that GPT by using a SystemRescueCD on your computer? Great, I didn't know that.

The Wheezy installer pretty much parallels my HOWTO, by putting the grubx64.efi as bootx64.efi in the EFI partition. The whole 4K-sector size issue becomes moot if you choose MB-alignment, which (g)parted does by default... but your SystemRescueCD may not (I don't know).
Real Debian users don't do chat...

shmerl
Posts: 302
Joined: 2009-07-30 21:41

Re: [Updated 6x]HOWTO: AMD64 Debian GNU/Linux and UEFI

#20 Post by shmerl »

Yes, I made a SystemRescueCD: http://www.sysresccd.org (it ships with a recent Gparted and it does use 1 MB aligning and formats XFS on hybrid hard drives using 4KB sectors as well), and the new computer was able to boot it in legacy (BIOS) mode. I partitioned the disk with it as per the HOWTO with the gpt table, then booted a Debian KDE live USB with installer (also in BIOS mode), and installed Wheezy on the hard drive keeping the partitions layout. But after that it refused to boot the partitioned hard drive in BIOS mode, may be because it was "too smart" and detected the gpt layout with EFI partition, who knows. Even setting compatiblity mode to legacy only didn't help that. An older computer (that only has BIOS) booted that disk with regular GRUB just fine. Then I followed the steps for enabling EFI GRUB, put the drive back in the new computer and after that it booted at last.

Actually even booting the Debian live USB was pretty erratic. At times it worked, at times not. It must be my motherboard firmaware has rather flaky support for the legacy boot.

shmerl
Posts: 302
Joined: 2009-07-30 21:41

Re: [Updated 6x]HOWTO: AMD64 Debian GNU/Linux and UEFI

#21 Post by shmerl »

I'm using the new system now, but it has a few quirks at boot:

1. Grub loads, but after selecting the default entry (or when it reaches timeout), it shows such messages:

Code: Select all

error: file not found.
error: file not found.
error: file not found.
Loading Linux 3.12-1-amd64 ...
Loading initial ramdisk ...
Press any key to continue
Then it stops, unless you press any key (it resumes after a while on its own though). What can those "file not found" be, and why does it stop with waiting for any key? (Actually, those "file not found" appear on screen briefly even before the Grub menu comes up as well).

2. Grub has an entry for "System setup", but selecting it produces:

Code: Select all

error: unknown command `fwsetup'

hkoster1
Posts: 1264
Joined: 2006-12-18 10:10

Re: [Revised]HOWTO: AMD64 Debian GNU/Linux and UEFI

#22 Post by hkoster1 »

I can't reproduce your error messages, and I don't know what they mean... :cry:

I have just revised the entire HOWTO to reflect the current state of affairs w.r.t. UEFI booting Debian GNU/Linux. The good news is that the current AMD64 version of the D-I for testing (Jessie) boots and installs on a PC with UEFI firmware without any problems, even installing a GUID partition table (GPT) when presented with a raw drive. As to current stable (Wheezy), the D-I cannot boot and install on a PC in UEFI boot mode; but the boot mode can be switched for the installed system from BIOS to UEFI afterwards, provided that the PC itself can be switched from BIOS to UEFI in the setup menu. The Revised HOWTO describes how this is done.

So, if your problems persist you may have another look at the revised HOWTO.

Good luck!
Real Debian users don't do chat...

shmerl
Posts: 302
Joined: 2009-07-30 21:41

Re: [Revised]HOWTO: AMD64 Debian GNU/Linux and UEFI

#23 Post by shmerl »

I found another issue. When some external hard drive is attached before boot, after selection is done in Grub it just produces a black screen. I guess there is some drives order messup, but I didn't look into it yet.

shmerl
Posts: 302
Joined: 2009-07-30 21:41

Re: [Revised]HOWTO: AMD64 Debian GNU/Linux and UEFI

#24 Post by shmerl »

I think I figured out where the errors come from. There is a function defined in /boot/grub/grub.cfg

Code: Select all

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}
In my case vga.mod, vbe.mod and ieee1275_fb.mod are simply missing. They aren't part of grub-efi-amd64-bin. They are found in grub-pc-bin though (which was removed when I installed EFI Grub). But apparently EFI Grub still tries to load them.

hkoster1
Posts: 1264
Joined: 2006-12-18 10:10

Re: [Revised]HOWTO: AMD64 Debian GNU/Linux and UEFI

#25 Post by hkoster1 »

Well, you're running testing/Jessie or Sid, while this HOWTO is about switching stable/Wheezy from BIOS to UEFI afterwards...
So, may be you should check bug reports for a solution to your problems.

FWIW, I installed AMD64 testing/Jessie a few days ago in a VMware VM with firmware = "efi" set, and everything went OK as far as GRUB and EFI is concerned. The D-I partitioner put in a GUID partition table, a 500 MB EFI Systems Partition, and implemented UEFI booting all by itself. So, your problem could be related to hardware.
Real Debian users don't do chat...

shmerl
Posts: 302
Joined: 2009-07-30 21:41

Re: [Revised]HOWTO: AMD64 Debian GNU/Linux and UEFI

#26 Post by shmerl »

Yes, apparently that path is triggered based on some hardware (the video modes errors). Luckily they aren't important - commenting those lines out in that function prevents errors from appearing. I didn't find a similar bug so far, so I might file one about it.

UPDATE: later versions of GRUB fixed this.
Last edited by shmerl on 2014-10-22 00:41, edited 1 time in total.

shmerl
Posts: 302
Joined: 2009-07-30 21:41

Re: [Revised]HOWTO: AMD64 Debian GNU/Linux and UEFI

#27 Post by shmerl »

By the way, why isn't UEFI shell packaged in Debian? It can be useful for restoring some cases when GRUB update borks UEFI boot entries (like recently happened in Debian testing).

JanPenguin
Posts: 136
Joined: 2011-01-16 13:00

Re: [Revised]HOWTO: AMD64 Debian GNU/Linux and UEFI

#28 Post by JanPenguin »

@hkoster1

Thanks a lot.

rEFInd saved my day.

Post Reply