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
hkoster1
Posts: 1264
Joined: 2006-12-18 10:10

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

#1 Post by hkoster1 »

This HOWTO describes the switching of an existing AMD64 installation (Wheezy or later) from booting in BIOS mode to booting in UEFI mode on a computer that supports both options. My example PC is a VMware virtual machine, for which switching from BIOS (the default) to UEFI is as simple as adding the line firmware = "efi" to its .vmx file. Consult the manual of your physical PC on how this must be done in the setup menu.

Note that the 'secure boot' option of UEFI is a different matter that only plays on computers on which Microsoft's Windows 8 or later is the principal OS.

The Preliminaries
The UEFI Boot Manager searches by default VFAT-formatted partitions for an /efi/boot/bootx64.efi boot loader and uses the first one that is found. It is customary to provide an EFI Systems Partition (ESP) on the HD specifically for that purpose. This partition should preferably be 200--500 MB in size, with room for other OS'es and boot loaders. If an existing ESP isn't large enough, then I recommend copying its contents to a memory stick and replacing that content after the HD has been (re)partitioned or resized.

HD resizing
UEFI can work both with the older MBR partition table and with the newer GUID Partition Table (GPT). In either case you need to find or make room for the ESP on the HD that you boot from. Use a recent version of the GParted or PartedMagic bootable CD to do this. Although any old partition with a FAT32 or FAT16 file system will do, there is now a separate format ('ef') for that purpose. It does not have to be the first partition on the drive, but it simplifies things if it is. I assume in the following that the ESP is /dev/sda1, with 'esp' and 'boot' flags set.

Note that there may already be a tiny 1MB BIOSGRUB partition on the HD when you use GPT, which will remain unused after the switch to UEFI booting.

Switching from BIOS to UEFI
With the ESP present and prepared, carry out the commands below with root privileges.

Configuring GRUB for UEFI
Mount the ESP (assumed to be /dev/sda1) on a newly-made mount point

Code: Select all

# mkdir /boot/efi
# mount /dev/sda1 /boot/efi
Next, prepare for and install the proper version of GRUB,

Code: Select all

# modprobe efivars
# aptitude install grub-efi-amd64
# grub-install /dev/sda
# update-grub
which also removes the grub-pc package used for BIOS. Error messages about procfs and sysfs may be ignored, but GRUB itself should report that it installed without error.

Configuring UEFI for GRUB
The above installation has installed the /EFI/debian/grubx64.efi boot loader on the ESP, which can be used provided that we let UEFI know of its existence. We can do this in two ways: simple, suited for Debian GNU/Linux as the only bootable OS; and not-so-simple, also suited when there are multiple boot options.

Since we are still in BIOS mode at this stage, we must do it first the simple way. The more complicated way can be implemented after rebooting in UEFI mode. For the simple way we need only copy and rename grubx64.efi as follows,

Code: Select all

# mkdir /boot/efi/EFI/boot
# cp /boot/efi/EFI/debian/grubx64.efi \
                  /boot/efi/EFI/boot/bootx64.efi
The UEFI Boot Manager will, in the absence of other instructions, find this renamed boot loader and use it. Use of upper and lower case letters in the path is optional.

The computer may now be rebooted in UEFI mode, after first enabling UEFI booting in the computer setup menu.

More UEFI boot options
The UEFI Boot Manager looks at non-volatile RAM (NVRAM) on the motherboard for additional instructions, which may be provided or changed with efibootmgr, which also relies on kernel module efivars.

Instead of letting the UEFI Boot Manager look for a bootx64.efi boot loader in a default path, we can tell it specifically where our grubx64.efi is located with the commands

Code: Select all

# modprobe efivars
# efibootmgr -c \
             -l "\\EFI\\debian\\grubx64.efi" \
             -L "Debian GNU/Linux"
This is in effect the method used by the D-I for Jessie and later when installing on a computer in UEFI booting mode. The output of that latter command will also show a numbering for other boot options, like CD/DVD and PXE network booting. The last-installed option, our Debian GNU/Linux, was given number 0004 in my case, and was automatically made the default option. Should this not be desired, then we can for example issue the command

Code: Select all

# efibootmgr -o 3,4
to make boot option 0003 the default.

The UEFI boot menu
Consult your computer manual on how to reach the UEFI boot menu at startup; on my VMware Fusion VM this needs hitting the fn-F2 key. Two items in the UEFI menu are of interest: Boot Manager and Boot Maintenance Manager.

Boot Manager
This menu item shows all bootloaders that are stored in NVRAM, such as our GRUB installed with efibootmgr. The desired bootloader can be chosen in this menu when it is not the default.

Boot Maintenance Manager
This menu item contains the option to Boot from a File, and gives a choice of available (VFAT-formatted) partitions. We can find the boot loader of our choosing by following the appropriate path. This way, our computer stays bootable in case something went wrong during the earlier switch-over.

The UEFI boot menu does the job, yet is rather stark-looking, while entering it requires a quick reaction during the initial startup. I'll discuss the nice-looking rEFInd boot manager in the follow-up to this post.

Enjoy!
Last edited by hkoster1 on 2015-02-05 13:50, edited 33 times in total.
Real Debian users don't do chat...

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

UEFI boot options with rEFInd

#2 Post by hkoster1 »

The rEFInd menu is a good-looking alternative to the UEFI menu, with some important advantages: you don't have to be super-quick with a function key to start it, and it handles all boot choices on the ESP without having to first store them in UEFI NV-RAM.

rEFInd is a fork of the once-popular but no longer maintained rEFIt boot menu used to boot GNU/Linux in MBR-legacy mode on recent Mac computers. rEFInd can be downloaded from http://www.rodsbooks.com/refind/. The documentation on that site may appear a little daunting, so here are a few pointers on installing rEFInd that tie in with the HOWTO:

a. At minimum two files are needed from the rEFInd archive, refind_x64.efi and refind.conf, the latter an edited version of refind-sample.conf. You'll also need a subdirectory of icons and other graphical features to make for a nice-looking menu.

b. Simplest, in terms of the HOWTO, is to do the installation manually directly to the ESP, mounting it first if not already mounted, e.g.

Code: Select all

# mount /dev/sda1 /boot/efi
# mkdir /boot/efi/EFI/refind
# cp refind_x64.efi refind.conf /boot/efi/EFI/refind/
# cp refind_x64.efi /boot/efi/EFI/boot/bootx64.efi
where that last line will make UEFI boot into the rEFInd menu by default. Copy also any icon files, etc, as per the documentation on the rEFInd website.

c. An alternative to step b. is to use efibootmgr to add rEFInd to UEFI's NV-RAM, as described in the HOWTO. Either way will work.

d. You may have to move the bootloader of "that other OS" from /boot/efi/EFI/boot/ to a separate subdirectory /boot/efi/EFI/<otherOS>/,

Code: Select all

# makedir /boot/efi/EFI/<otherOS>
# mv /boot/efi/EFI/boot/<otherOS>.efi /boot/efi/EFI/<otherOS>/
# umount /dev/sda1
Your PC now boots into the rEFInd menu on startup, giving you your choice of bootloaders.

Enjoy!
Last edited by hkoster1 on 2014-02-02 21:09, edited 5 times in total.
Real Debian users don't do chat...

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

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

#3 Post by hkoster1 »

Good news for those of you interested in UEFI-booting your AMD64-versions of Debian GNU/Linux: the Beta3 version of the D-I for Wheezy has just been announced to allow installation with only UEFI-booting, so without the BIOS detour of my HOWTO.

I now had a chance to try it out on a virtual machine with "efi" firmware (VMware Fusion 5), where I can confirm that everything installs fine. The D-I doesn't say so explicitly, but it installs a GUID Partition Table (GPT) on a virtual drive that has none. I confirmed that by checking afterwards with 'parted'. With GPT already in place, the partitioner automatically installs an EFI boot (or systems) partition.

Only when the partitioner detects an MBR partition table, is the user asked to install an EFI boot (or systems) partition manually.

Anyway, it seems that the D-I for Wheezy can handle all typical UEFI boot cases from a hardware point-of-view. My HOWTO can still give some pointers on the processes involved, while my second post in this thread points the way to using a nice-looking boot manager.

Enjoy!
Real Debian users don't do chat...

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

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

#4 Post by hkoster1 »

A new grub-efi-amd64 package has just (29 December 2012) entered Sid. When I installed it as an upgrade, I noticed that its install script automatically puts the Debian boot option as first-to-boot in NV-RAM, even if prior to that the simple default method was used. No man overboard if that is what you want.

Since I don't boot any other OS on this computer, I don't know what happens when another OS should boot first. If this situation pertains to you, a heads-up would be in order.
Real Debian users don't do chat...

YetAgain
Posts: 12
Joined: 2011-02-18 06:05

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

#5 Post by YetAgain »

Thanks for the excellent posts. They were a big help in installing Wheezy on my new PC.

I used the Beta4 version of the Debian Installer for Wheezy which can install a GPT, EFI systems partition, and appropriate Grub image to a new hard drive without special intervention if the drive (CD-ROM, DVD, USB, etc.) containing the Debian Installer is booted in UEFI mode. Unfortunately in my case, I could not figure out how to boot the CD drive containing the installer in UEFI mode (because no such option was given) so I booted in BIOS mode and followed the instructions in the posts above. Interestingly enough, once the hard drive was set up for UEFI, UEFI mode appeared as an option for the CD drive. Having the UEFI mode option show up at this point was too late for the installer to install an EFI system partition by default, but it was useful for re-installing Grub with a proper UEFI image as explained at the bottom of this posting.

I have a ASUS M5 A99X EVO motherboard. Maybe someone else can explain how to get the "BIOS" for this board to boot the CD drive in UEFI mode with blank hard drives installed. That would make all the extra work described below unnecessary.

Below is an overview of the installation process I went through, covering mainly the steps that were outside the normal Debian Installer installation process. This was performed around December 29, 2012.

Initially I tried installing a "Squeeze" release of the AMD64 Debian installer. This did not have the capability to write a GPT partition table, EFI system partition, and other items needed for UEFI booting.

I ended up using debian-wheezy-DI-b4-amd64-netinst.iso (Debian Installer, Beta4) which I obtained at http://cdimage.debian.org/cdimage/.

I booted the CD and followed the installation process until I got to the hard drive formatting. At the formatting stage, I chose manual partitioning of the drive instead of guided partitioning.

The Debian Installer did not give me an option to make a partition the UEFI system partition as it does in UEFI mode. Instead I set my first partition (the intended UEFI system partition) to "Fat32 file system" under the "Used as" option. I did not set a mount point for this partition but did set it as bootable. I used the installer to format the rest of the partititions with the options appropriate for my partitioning scheme.

I used the Debian Installer to continue with the installation until I got to the bootloader installation step.

GRUB Installation:
I exited to the shell and followed the procedure in step 4 of the first post above. Everything went fine until I ran aptitude to install grub-efi-amd64. I was asked to install the installation CD into /media/cdrom. However, the installation CD was already mounted. A little investigation revealed that I lost access to the cdrom when I chrooted into /target. To fix this I had to exit the chroot, mount the cdrom under /target/media/cdrom and then chroot back to /target as follows:

Code: Select all

# exit
# mount -o bind /cdrom /target/media/cdrom
# chroot /target
I was able to install grub. However running update-grub returned a fatal error about missing proc and sys efivars. My assessment is that the computer must be booted in UEFI mode for update-grub to create a proper grubx64.efi file. Despite the error, I continued on following step 5 and step 6 in the first post by copying /boot/efi/EFI/debian/grubx64.efi to /boot/efi/EFI/boot/bootx64.efi and exiting from the chroot. I tried rebooting to the hard drive but it was not bootable.

Fixing GRUB:
The solution was to boot to the Debian Installer on the CD drive in UEFI mode (which was now an option in the BIOS), run the installer in rescue mode, re-run "update-grub", and then copy grubx64.efi over again.

In more detail, upon booting GRUB on the CD there was a quick message saying, "Welcome to GRUB. Error 'prefix' is not set" and then the installer menu appeared. The installer menu appeared different in UEFI mode than it did in BIOS mode. I selected rescue mode("Debian 7.0 text-mode rescue (64-bit, EFI)"). After asking the questions about the keyboard, language, etc., the installer asked which partition I would like to install as root. Since my root partition was on the 3rd partition of sdb, I selected /dev/sdb3. I then selected "Execute a shell in /dev/sdb3". /usr and /boot were on separate partitions so I had to mount them to access them. They were already listed in fstab so I simply entered:

Code: Select all

# mount /usr
# mount /boot
Mounted the EFI system partition on /boot/efi

Code: Select all

# mount /dev/sdb1 /boot/efi
Re-ran "grub-install /dev/sdb" (may not have been necessary) and "update-grub". Then copied /boot/efi/EFI/debian/grubx64.efi to /boot/efi/EFI/boot/bootx64.efi.
The /boot/efi/EFI/boot directory was left over from the first time I tried copying grubx64.efi over to bootx64.efi so I did not need to create it this time.

After exiting rescue mode and rebooting to the hard drive in UEFI mode the system booted.

User avatar
buntunub
Posts: 591
Joined: 2011-02-11 05:23

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

#6 Post by buntunub »

I ran the wheezy installer and it just plopped that EFI garbage in and screwed up my dual boot pretty badly. I still cant get windows to boot. At all. I have a legacy system so no clue how this happened and I did nothing different than I normally do when installing Squeeze.

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

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

#7 Post by hkoster1 »

That's tough, but that's what can happen when you install a Beta-release. FWIW, the current release notes do address possible UEFI problems...

Why not file a bug report? Start a new thread outside the HOWTO section?

Edit: I see you already started an "install saga" thread... got that off your chest.
Real Debian users don't do chat...

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

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

#8 Post by hkoster1 »

I just tried out the 15 March 2013 daily snapshot of the D-I for amd64-testing, and there has been some regression on the UEFI front, as some of you have already noticed. This is what I found:

1. The D-I will install/use a legacy MBR partition table on a bare HD when UEFI firmware is present. The D-I partitioner has no way, AFAICT, of installing a GUID partition table at this stage, not even when dropping into manual partitioning. I have not tried dropping into a shell to do that, since I prefer using the likes of GParted-liveCD for that.

2. When the HD has first been given a GUID partition table (GPT), the D-I will still install a legacy MBR partition table, complete with "biosgrub" partition to store some of the MBR data in. You can undo that (and save some space and that coveted /dev/sda1 moniker for the ESP partition) by doing the partitioning manually -- as described in the HOWTO.

The HOWTO is no longer obsolete...
Last edited by hkoster1 on 2013-03-26 11:15, edited 1 time in total.
Real Debian users don't do chat...

User avatar
llivv
Posts: 5340
Joined: 2007-02-14 18:10
Location: cold storage

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

#9 Post by llivv »

hkoster1 wrote:I just tried out the 25 March 2013 daily snapshot of the D-I for amd64-testing, and there has been some regression on the UEFI front, as some of you have already noticed.
could you give the url for the image.
all I'm finding is 15 March for both sid d-i
http://cdimage.debian.org/cdimage/daily-builds/sid_d-i/
and wheezy d-i images
http://cdimage.debian.org/cdimage/daily ... heezy_d-i/

also found these unofficial images
http://cdimage.debian.org/cdimage/unoff ... velopment/
while looking for the 25 march snapshots
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.

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

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

#10 Post by hkoster1 »

This is what I used: http://cdimage.debian.org/cdimage/daily ... 64/iso-cd/, in fact the
image called debian-testing-amd64-netinst.iso dated 15-03-2013.

I'm still playing with this installer image, I noticed that it won't load the efivars module in the chroot, probably because the kernel on the installer-image doesn't have the module available to it on the image. So, the work-around is then to install first the old way BIOS-way
using that "biosgrub" partition, then reboot and do the chroot thing. My advice: don't let the D-I install biosgrub as /dev/sda1... 8)

Edit: no, doesn't work either, although the efivars module now loads...
Real Debian users don't do chat...

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

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

#11 Post by hkoster1 »

I have updated the HOWTO such that configuring UEFI booting is no longer done in a chroot at the end of regular installation. That method may fail when the required efivars kernel module cannot be loaded in the chroot, as was the case with the daily snapshot of the amd64 installer dated 15 March 2013. The method of the HOWTO now reboots one final time in BIOS-mode, then configures GRUB for UEFI with just a default boot option. More complicated boot options can be configured after rebooting in UEFI-mode.

Enjoy!
Real Debian users don't do chat...

eddyagain
Posts: 6
Joined: 2013-04-11 00:41

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

#12 Post by eddyagain »

I'm working on a Debian install in VirtualBox & in I made it thru step3 in post #1 rendered my VM unbootable outside of the Ubuntu desktop iso that I use for rescue purposes.
I noticed that you mention 3 different efi-boot-managers, anyway VB is efi capable, but does it have an efi-boot-manager?
Grub2 says it's capable here.
says it's capable.
I just wanted to be sure as I'm on another install & I can't see any documentation stating if while VB has support for efi, it doesn't say if it has a boot manager.

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

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

#13 Post by hkoster1 »

Check out a VirtualBox forum?
Real Debian users don't do chat...

johnson33
Posts: 1
Joined: 2013-04-18 06:08

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

#14 Post by johnson33 »

I am agree with "hkoster" that this is a Good news for those of you interested in UEFI-booting your AMD64-versions of Debian GNU/Linux: the Beta3 version of the D-I for Wheezy has just been announced to allow installation with only UEFI-booting, so without the BIOS detour of my HOWTO.so enjoying dears



underwater-hotel-dubai.com
Last edited by johnson33 on 2014-01-25 09:33, edited 5 times in total.
Allen123

pier
Posts: 1
Joined: 2013-04-18 18:59

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

#15 Post by pier »

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).
Different from the HOWTO, I have the UEFI partition on sda2 (sda1 is used by W8 as a recovery partition and I didn't want to mess the windows stuff up), which means that I had to add grub to the UEFI boot order with:
# efibootmgr -c -p 2 -l "\\EFI\\debian\\grubx64.efi" -L "Debian GNU/Linux"
Also, I have now upgraded the system to sid (to mirror my the system on my old laptop).

The ALMOST above is because the grub loader doesn't show the W8 system as an option. When I do "grub-install /dev/sda", I get the error messages about procfs and sysfs, I wonder if these are related to the fact that grub cannot find W8 boot?
I can access the windows 8 system by giving boot priority to "windows manager" at startup (pressing "esc+F12"). Otherwise startup enters grub and debian as a default, which is fine by me, but ideally I would like to have W8 acessible from grub.

Ah, I have found the "Boot from a file" option in Boot Maintenance Manager, but I'm not given any file to select... this means I cannot restore the safe booting feature... shall I bother?

Can anyone help / has anyone the same problem/s?

milomak
Posts: 2158
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.

Post Reply