LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Switching my system to UEFI this weekend. (https://www.linuxquestions.org/questions/slackware-14/switching-my-system-to-uefi-this-weekend-4175506557/)

dugan 05-30-2014 05:10 PM

Switching my system to UEFI this weekend.
 
My plan for this weekend is to switch my dual-booting system to UEFI. I plan to end up with a BIOS firmware boot menu containing two entries: one for a UEFI-booted Windows (7) and one for a UEFI-booted Slackware.

Currently, both operating systems are on legacy-mode boots. I plan to change that, and I hope this will let me get away bootloader-chaining, MBR-overwriting, and the "add Windows to lilo.conf" complexity that we're all used to dealing with.

I've read this to prepare:

UEFI boot: how does that actually work, then?

And that's "a UEFI" and not "an UEFI", right? It assume it's pronounced "Yuffie?" Like the Final Fantasy character?

metaschima 05-30-2014 07:43 PM

slackdocs seems to be slow right now, but I did write some info about UEFI when I switched, dunno if it will be useful:
http://docs.slackware.com/howtos:sla...uefi_and_elilo

sycamorex 05-30-2014 08:09 PM

Do report how it went. I've been thinking about it for some time on my laptop.

syg00 05-30-2014 10:33 PM

Quote:

Originally Posted by dugan (Post 5179601)
Currently, both operating systems are on legacy-mode boots. I plan to change that

In-place ?. That could be an interesting exercise. I had no end of trouble with Win7 (64-bit) installing on a new-build UEFI m/board - Win7 was an OEM rather than commercial copy and apparently makes quite a difference. I will also be watching with interest.

[caveat]On the system in question I have neither Slack nor elilo[/caveat]

aaditya 05-30-2014 10:52 PM

I also switched from BIOS to UEFI on my laptop.
Switching Windows was a headache, Linux not so much.

Here is a wiki page I had written and subsequently refined: https://wiki.manjaro.org/index.php?t...m_BIOS_to_UEFI

To switch, I converted my MBR partition table to GPT using http://www.rodsbooks.com/gdisk/mbr2gpt.html

Then created a UEFI partition (fat32 - 512mb), and switched to UEFI in the firmware.

Then I booted Windows installation disk, and tried automatic repair many times, which probably did not work for me, so tried to install Windows bootloader manually onto the uefi partition using the bcdboot command.
(The following I found later: http://superuser.com/questions/46076...efi-bootloader)

After that I booted to my Linux install through chailoading via an external drive which runs Debian (and Grub), and ran the command to installing Grub-
Code:

sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Linux --recheck
But my laptop's firmware only recognises Windows (HP), so I had to install rEFInd for dual-booting.
https://wiki.manjaro.org/index.php?t...g_with_Windows

Alternatively, one can copy the grubx64.efi file to the Boot folder inside the EFI partition to make Grub default.
http://www.rodsbooks.com/refind/installing.html#naming

dugan 06-01-2014 01:17 PM

That was actually very painless.

My rig is a tower containing three hard drives: on SSD for Windows, one SSD for Linux, and an NTFS-formatted Caviar Red for storage. The motherboard is an Asus H87-Plus.

I decided to go for the "back up, wipe, install fresh" approach.

First, I disabled secure boot. It turns out that I'd had it on the entire time, and I never noticed because I was booting my operating systems in legacy mode.

Then I backed everything up, and started reinstalling Windows. I set the "CSM" setting in my firmware to "auto" and told my computer to boot the installation disc in UEFI mode. When the installation CD let me repartition the hard drives, of course I accidentally partitioned (and wiped out) the storage drive. That was fine, because I knew I would make that mistake and had backed the drive up. The rest of the installation went as normal. From Windows, I then repartitioned the storage drive, formatted the partition to NTFS, and restored the contents of the storage drive from the backup.

Then I booted my Slackware64 14.1 DVD in UEFI mode, and essentially proceeded according to README_UEFI.TXT.

I chose not to boot the kernel with KMS.

I used cgdisk to create three partitions on my Linux drive:
  • An EFI System Partition, size 100M (code EF00)
  • A Linux swap partition, same size as my RAM (code 8200)
  • A Linux partition, default size and code

When asked whether I wanted to add an EFI boot menu entry for Slackware, I said yes. I then rebooted.

Now, the boot menu that I get when I press F8 at boot has two entries: one for Windows (actually named Windows) and one for Linux (actually named Linux). Both entries were put there by the Slackware installer.

sycamorex 06-01-2014 01:19 PM

Thanks for posting the feedback. I might actually try it soon.

dad_ 06-04-2014 03:20 AM

booted my Slackware64 14.1 DVD in UEFI mode?
 
I was not able to UEFI boot the DVD, until I disconnected my old MBR HDD.(got freeze on grub start) Huge kernel (both 14.1 and current) also went to panic if MBR hdd was connected on boot. But with a generic kernel(from current, not tried it on 14.1) and initrd I managed to UEFI boot successfully with a mix of MBR and GPT hdds. Then just fixed all my mounts and root reference to use partition uuids(to avoid device name change problems) and now slackware64 current (on 3.14.4 generic kernel, not updated to 3.14.5 yet) boots flawlessly from UEFI. BTW Windows 7 Boot Manager always fails on MBR/GPT drive mix, but disconnecting controller channel with MBR drive from UEFI shell helps(was not the case with linux). I have more than 4 MBR partitions, maybe it causes some confusion.

moisespedro 06-04-2014 07:07 AM

Is there any reason to switch to UEFI?

Habitual 06-04-2014 07:39 AM

Quote:

Originally Posted by moisespedro (Post 5182176)
Is there any reason to switch to UEFI?

To use UEFI, or not to use UEFI? answers that question.

dugan 06-04-2014 09:35 AM

Quote:

Originally Posted by moisespedro (Post 5182176)
Is there any reason to switch to UEFI?

Faster booting.

Easier multiboot setups.

moisespedro 06-04-2014 09:41 AM

Quote:

Originally Posted by dugan (Post 5182277)
Faster booting.

Easier multiboot setups.

How is it faster? And isn't multibooting already pretty easy?

dugan 06-04-2014 09:43 AM

Quote:

Originally Posted by moisespedro (Post 5182283)
How is it faster?

Hardware initialization is technically and objectively faster.

Quote:

And isn't multibooting already pretty easy?
I said easier!

moisespedro 06-04-2014 09:45 AM

Well, I am thinking about giving it a try but I am too lazy.

metaschima 06-04-2014 11:43 AM

The reason to switch to UEFI and also to x86-64 is the same: because they are the future and because there are benefits. You will have to switch one day, the question is not if but when.

Habitual 06-04-2014 12:14 PM

Quote:

Originally Posted by metaschima (Post 5182361)
The reason to switch to UEFI and also to x86-64 is the same: because they are the future and because there are benefits. You will have to switch one day, the question is not if but when.

Buzzkill. :)

dad_ 06-04-2014 12:26 PM

Quote:

Originally Posted by moisespedro (Post 5182176)
Is there any reason to switch to UEFI?

If you have GPT drive (and in case of capacity > 2 Tb it is almost a must) and you want to dual-boot windows 7/8, then you have no choice. That was my case. If you have GNU/Linux only system - I see no obvious reason to upgrade. There are small technical advantages such as slightly faster boot or no need to use a boot loader(in case of linux kernel is configured with EFI stub it could be booted directly), possibility to use UEFI shell and other UEFI applications before boot to any OS.

moisespedro 06-04-2014 12:27 PM

Quote:

Originally Posted by metaschima (Post 5182361)
The reason to switch to UEFI and also to x86-64 is the same: because they are the future and because there are benefits. You will have to switch one day, the question is not if but when.

I can easily see why would someone switch to x86-64 but not why someone would switch to UEFI. In my case, at least.

metaschima 06-04-2014 12:34 PM

Quote:

Originally Posted by moisespedro (Post 5182385)
I can easily see why would someone switch to x86-64 but not why someone would switch to UEFI. In my case, at least.

If your computer supports it then you should switch. UEFI allows support for GUID partition tables, faster booting, and plenty of features that cannot be implemented in BIOS. Now, that doesn't mean you will use the features, and if you don't then you can wait. You will have to switch one day tho, and personally I try to switch to newer technologies sooner as long as they are available because I don't know how much time I will have to do the switch in the future. I mean, if it is available on my hardware and it is newer I will switch to it now, not later. Procrastination has never helped me and probably never will.

dugan 06-04-2014 12:51 PM

I'm not sure if you all have been following the Syndicated Linux News forum, but there have been a couple of recent entries about UEFI booting:

Boot managers and boot devices on a PC with UEFI firmware
How to delete boot managers from a UEFI boot menu

No more MBR-overwriting, bootloader-chaining, setting up LILO/GRUB/BCD boot menus, or any of that nonsense. You just use Linux software to add or remove your boot partitions from the menu that you get when you start the computer up and press F8 during the POST.

I think that's much better.

TracyTiger 06-04-2014 02:18 PM

I'm Sold
 
Quote:

Originally Posted by dugan (Post 5182395)
No more MBR-overwriting, bootloader-chaining, setting up LILO/GRUB/BCD boot menus, or any of that nonsense. You just use Linux software to add or remove your boot partitions from the menu that you get when you start the computer up and press F8 during the POST.

I'm sold. I need to run out an buy a new motherboard with UEFI!

I've never used UEFI and had been waiting for the Slackware solutions to be figured out. (which they appear to have been) You make it sound enticing and not a pain at all.

ymf331 06-05-2014 12:51 AM

I haven't tried the stub loader yet but, for me, efi was more frustrating than the bios setup.

jtsn 06-07-2014 06:19 AM

UEFI is a proprietary pre-boot single-tasking operating system heavily influenced by Windows design principles (including executable format and calling convention). Of course it sucks and is buggy as hell. It is basically an overcomplicated 64 bit version of MS-DOS. ;) The main purpose for its introduction was to hinder booting alternative operating systems (Secure Boot).

But you don't have the choice. PC hardware with a real BIOS implementation is not available anymore (and most recent BIOS implementations were worse than UEFI). Enabling the Compatibility Support Module (CSM) and simulating a "legacy boot" doesn't give you the IBM BIOS back, it only complicates things further. So you have to deal with UEFI, if you want or not.

Drakeo 06-07-2014 08:46 AM

well lets reinvent the wheel 26 X 1 3/8 in the 1890's or is it a 650a as of today. it is all the same to me the system is looking at a boot loader and why people want to be confusing.
It is looking for an image and wow lets put it on a fat32 partition. well. All the same all the same stuff. nothing new. not one thing.

It is an image loaded into ram and for what I see oh well.

dad_ 06-08-2014 01:09 AM

Quote:

Originally Posted by jtsn (Post 5184003)
UEFI is a proprietary pre-boot single-tasking operating system heavily influenced by Windows design principles (including executable format and calling convention)...

That's true. But usually BIOS was not superior in any sense. Also proprietary(open/free alternatives exist but how many use them?), single-tasking, often buggy. The only advantage is simplicity.

brobr 10-18-2014 04:31 PM

Challenged by:
0. switch to uefi
slackware-on-uefi

I wondered about 'Upgrading' from MBR to UEFI on a Uefi-firmware computer

First I read some good stuff for understanding what is happening and needed.
0. slackware64-14.1/README_UEFI.TXT
uefi on hardware
2. uefi and elilo
3. uefi-boot
4. boot managers
5. delete bootmanagers
modify bootmanagers
6. efi bootloaders
7. gdisk
8. convert MBR to GPT
9. switch to uefi, but with grub

THUS this is/was the plan:

Current: MBR lilo-booted Slackware64-current (after 14.1) system on a UEFI firmware computer: a PC SPecialist UltraNote -based on a Clevo W550EU- with intel i7, 16Gb RAM, and OS on a mSATA SSD drive and rest on a 750Gb HDD. Two years ago, Slackware was installed by PXE and the drives reformatted (to MBR) to remove any traces of an unwanted test OS and to use the'legacy BIOS'-mode, which was then the most reliable.

Aim: Change to Uefi in situ (without reformatting the whole drive which would remove data and the installed system etc.)

Precaution: backup that data before start....
Experiment: try it out with a spare external drive

We need an extra partition on the boot-drive:

Quote:

Instead of installing the boot files in the Master Boot Record (MBR), an entry for each OS in created in /boot/efi/EFI directory, which should be in an EFI partition.(4)
Quote:

The EFI specification includes a description of a new partition table type, the GUID Partition Table (GPT). .. most EFI computers do use GPT disks. Windows also enforces the EFI/GPT association, at least for its boot disk.. In Linux, there are two main ways to create a GPT disk:

Use ... Parted, to create your partitions, and explicitly tell that tool to use GPT.. select Device -> Create Partition Table, expand the Advanced item, select gpt as the partition table type, and click Apply to create a new partition table. [This] erases your existing partitions.
Use GPT fdisk (gdisk, cgdisk, or sgdisk) to create your partitions. These tools can convert an existing MBR disk to GPT format, or they can partition a blank disk. (6)
THUS: use only gdisk for disc-conversion to GPT. Use parted only for freeing space for the ESP by re-sizing partitions !

I practised each step below with an external drive (with a slackware istallation) before doing the whole stuff 'in situ' on my internal drives. In this practice run I had access to internet help and experienced some difficulties I could repair easily. This reminded me not to resize partitions by changing the left boundaries. A file-system check after all actions was also helpful (can be done from within parted).


For the real change:

STEP 1: Boot with a UEFI install/boot medium (0) into the laptop.

Get into the SETUP menu (or 'Bios'). For MBR discs and legacy-booting via MBR and Lilo, OS was set to 'others' and in my case 'uefi was disabled' automatically. (Note, all Windows stuff had been eradicated by formatting the drives to MBR format, although an inactive 'Windows Bootmanager' was still present).

I disabled all internal MBR drives for booting

Only by turning OS to 'Windows 8' and by enabling uefi my Slackware boot-stick worked and started in uefi-mode

Did not mount internal drives (parted and gdisk only work on UNMOUNTED partitions).


STEP 2: on the boot drive created an ESP (Efi System Partition)(0, 4, 6)
Used parted to shrink a (not completely occupied) partition on the boot drive to create space for a EPS partition (around 100-200MB seems to be enough; probably depending how many OSs one wants to boot (but see (3)).

STEP 3: converted discs to GPT-format with gdisk (7)
Ran gdisk on the drives and checked message:

Quote:

bash-4.3# gdisk /dev/sdb
GPT fdisk (gdisk) version 0.8.7

Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************

Command (? for help):
Instead, you can get an error message when your drive is completely occupied:

Quote:

Warning! Secondary partition table overlaps the last partition by 33 blocks! You will need to delete this partition or resize it in another utility
This indicates that there is not enough space to place GPT information as described in (8):

Quote:

Conversions from MBR to GPT works because of inefficiencies in the MBR partitioning scheme. On an MBR disk, the bulk of the first cylinder of the disk goes unused—only the first sector (which holds the MBR itself) is used. Depending on the disk's CHS geometry, this first cylinder is likely to be sufficient space to store the GPT header and partition table. Likewise, space is likely to go unused at the end of the disk because the cylinder (as seen by the BIOS and whatever tool originally partitioned the disk) will be incomplete, so the last few sectors will go unused. This leaves space for the backup GPT header and partition table. (Disks partitioned with 1 MiB alignment sometimes leave no gaps at the end of the disk, which can prevent conversion to GPT format—at least, unless you delete or resize the final partition.)
Pressed "q" to leave gdisk without changing anything.

I got this error and had to reduce the size of my last partition (swap space) (I did this with parted) to get the above clean message.

If you cannnot add an extra primary partition on your MBR drive you have to convert the disk first to GPT, in which all partitions appear the same.

gdisk /dev/sdb

typed "p" to print the partition table (as it will be when disk is converted to GPT
typed "s" to sort the order of partition numbers (which you have to take over to /etc/fstab ) (8)
typed "w" to convert MBR disc to GPT format.

After that, there were gaps in between some partitions as expected (8)

I made then the EPS in the freed-up space as a fat32 formatted partition (with parted but this can be done with gdisk) and then made sure that it was set to the efi format with gdisk:

type "p" to print the partition table: which could show the ESP as 0700. If so:
type "t" to change the ESP to its required format: ef00
type "w" to confirm this.

my boot disk and my data disk:

Quote:

bash-4.3# gdisk /dev/sdb
GPT fdisk (gdisk) version 0.8.7

Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sdb: 250069680 sectors, 119.2 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): E3ED2D86-4ACF-42C3-AC1E-A60501A9078E
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 250069646
Partitions will be aligned on 1-sector boundaries
Total free space is 124658311 sectors (59.4 GiB)

Number Start (sector) End (sector) Size Code Name
1 63 125001764 59.6 GiB 8300 Linux filesystem
2 125003776 125413375 200.0 MiB EF00 EFI System




bash-4.3# gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.7

Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): DEF58BCE-4DC4-41D7-920D-EB3D905BB65F
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 8-sector boundaries
Total free space is 16554 sectors (8.1 MiB)

Number Start (sector) End (sector) Size Code Name
1 63 292961339 139.7 GiB 8300 Linux filesystem
2 292961340 585922679 139.7 GiB 8300 Linux filesystem
3 585922743 624992759 18.6 GiB 8300 Linux filesystem
4 624992823 729231359 49.7 GiB 8300 Linux filesystem
5 729233408 944738303 102.8 GiB 8300 Linux filesystem
6 944740352 976760831 15.3 GiB 8200 Linux swap


##########
EDIT: I should have used fsck on the ESP to check whether the fat32 formatting had been done correctly.
(see this very informative Arch-linux page, as referred to from this slack-doc page).
##########

STEP 4 Set up Elilo (0)

Mounted the partition of the boot-disk with the slackware installation (sdb1) to /mnt
Mounted the partition with the EPS (sdb2) to /mnt/boot/efi

Checked whether all was there
Ran eliloconfig; this only worked when the whole system is recognized as uefi-capable: gpt discs; /boot/efi partition present


I got this far AND according to all info, the computer should now be uefi-only.....

But rebooting fails. I need the USB-stick to boot into the installation.

In SETUP I now see an option for secure boot (disabled)

I tried then to do a minimal install (i.e. only the a-packages) in order to get throught the Slackware setup program.

After that still no proper reboot joy.

This is in /boot/efi/EFI/Slackware:

Quote:

bash-4.3# ll /boot/efi/EFI/Slackware/
total 9336
drwxr-xr-x 2 root root 4096 Oct 18 19:27 ./
drwxr-xr-x 3 root root 4096 Oct 17 19:22 ../
-rwxr-xr-x 1 root root 160 Oct 17 21:19 elilo.conf*
-rwxr-xr-x 1 root root 242346 Mar 29 2013 elilo.efi*
-rwxr-xr-x 1 root root 5617105 Oct 17 20:04 initrd.gz*
-rwxr-xr-x 1 root root 3681296 Sep 9 03:46 vmlinuz*
These vmlinuz and initrd.gz look the same as used for booting via lilo in /boot:

-rw-r--r-- 1 root root 3681296 Sep 9 04:46 vmlinuz-generic-3.14.18
-rw-r--r-- 1 root root 5617105 Oct 17 21:04 initrd.gz


and the Slackware installed elilo.conf was:

Quote:

chooser=simple
delay=1
timeout=1
#
image=vmlinuz
label=vmlinuz
initrd=initrd.gz
read-only
append="root=/dev/sdb1 vga=normal ro"
/boot/efi/EFI/Slackware/elilo.conf lines 1-9/9 (END)




STEP 5 I probably might go ahead with this: use efibootmgr for making changes:

Quote:

To remove unwanted entries from the boot menu,.... type the following command, as root, to delete a specific entry:
efibootmgr -b 0003 -B.
The number (0003) is the hexadecimal number representing the entry you want to delete.(5)

But there seems no need for it.

When I reset the OS to 'others' in the SETUP menu legacy-bios-mode kicks in and I boot into my system as usual via lilo.

Oh, how one can be relieved seeing the Slackware boot-screen appear :-)

Still, I am a bit disappointed that uefi does not work this way. But I don't think I am up to completely reinstall my system: too much stuff to do on an evening.... and possibly to no avail. I also could not boot from my external drive with a huge.s and despite setting delay and timeout to 300.

Thus despite all theory, in my case uefi-mode does not seem to override MBR stuff (that luckily was not been removed by gdisk conversion).


Do I need to change elilo.conf (but how?)
Do I need to put the huge.s in the /boot/efi/EFI/Slackware?
Do I need to include something in the initrd apart from ext4 file system info?
Do I have bad uefi-firmware???

Cheers,

Rob


PS Yes, this might have been a stupid experiment but one has to try...

######
EDIT: The problem arose from an incorrect fat32 file system on the ESP, as described later on
######

dad_ 10-19-2014 08:12 AM

Quote:

Originally Posted by brobr (Post 5255745)
...
But rebooting fails. I need the USB-stick to boot into the installation.
...

Could you please describe in more detail how does it fail? Post (part of) boot log or the error message. How do you exactly boot EFI from your boot menu - maybe you have a screenshot? Have you tried to boot from UEFI shell on USB stick?

brobr 10-19-2014 03:07 PM

Hi dad_ thanks for replying.

OK: In the boot menu of SETUP 'Slackware' is present and first choice (and the only uefi choice unless I attach my eufi-boot flash-drive to a USB3-port).

In uefi-mode, without the boot-USB, the system hangs, that is: does not start at all and reverts after a couple of seconds to the SETUP screen.
In my SETUP eufi mode is only possible by setting 'OS' to 'Windows 8', which then enables me to set 'Uefi' to 'enabled'.
(this is NOT secure boot as this option comes up in another tab (security) and is only available with the above setting of OS Windows 8 + uefi enabled)

When I boot with the uefi USB-stick and then by pressing 'tab' can input my path to / and the kernel (/dev/sdb1 vmlinuz), it reverts to the boot screen of the USB-disk.

If, in SETUP, I set OS to 'others' uefi is greyed-out and automatically set to 'disabled'.

THEN I get the lilo-boot screen ....and the system boots normally

It just seems that my SETUP firmware does not want to accept that other OSs than Windows 8 can boot uefi...... or it is buggered somehow.

(But why does the boot USB-stick work; that's not Windows 8 either???)

#### EDIT: removed output of what bootlogd (after editing rc.S according to this post) spitted out in /var/log/boot and the top of dmesg as it basically showed the lilo-boot. Hope this might make the post more digestable..
#### end EDIT


Cheers,

Rob

keefaz 10-19-2014 03:51 PM

When you boot in uefi mode with the usb key, once system loaded could you post output with:
Code:

modprobe efivars
efibootmgr -v


brobr 10-19-2014 04:54 PM

Hi keefaz,

after modprobe efivars:

Quote:

#efibootmgr

BootCurrent: 0006
Timeout: 0 seconds
BootOrder: 0001,0000,0006
Boot0000* Windows Boot Manager
Boot0001* Slackware
Boot0006* UEFI: Generic USB Flash Disk 2.00

#efibootmgr -v

BootCurrent: 0006
Timeout: 0 seconds
BootOrder: 0001,0000,0006
Boot0000* Windows Boot Manager HD(2,96800,32000,b804aed4-64ef-46bf-896e-8773957b2820)File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a .8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0001* Slackware HD(2,7736800,64000,86ce4157-bde7-4e5f-890d-c0e406ad8bc0)File(\EFI\Slackware\elilo.efi)
Boot0006* UEFI: Generic USB Flash Disk 2.00 ACPI(a0341d0,0)PCI(14,0)USB(1,0)HD(1,3f,79920,0003d704)AMBO

keefaz 10-19-2014 05:05 PM

/boot/efi/EFI/Slackware/elilo.conf content looks ok ?

edit, sorry didn't read the previous post with your elilo.conf

I notice there is no default value (don't know if it is required with only one kernel entry)

Maybe you could add this line:
Code:

default=vmlinuz
just after the "timeout=1" line

brobr 10-19-2014 05:27 PM

Hi Keefaz,

Thanks for the suggestion; I just tried that but to no avail; the system returned back to the SETUP screen again

keefaz 10-19-2014 05:33 PM

At this point, it is not clear if elilo loads or not...

Could you change elilo.conf like:
Code:

chooser=simple
delay=150
timeout=150
default=vmlinuz
prompt
#
  image=vmlinuz
  label=vmlinuz
  initrd=initrd.gz
  read-only
  append="root=/dev/sdb1 vga=normal ro"

This way, if elilo loads you should see elilo prompt at boot

dad_ 10-20-2014 04:48 AM

Quote:

Originally Posted by brobr (Post 5256145)
In uefi-mode, without the boot-USB, the system hangs, that is: does not start at all and reverts after a couple of seconds to the SETUP screen.

So you are not able to see any error message and don't have any failure trace?

Quote:

Originally Posted by brobr (Post 5256145)
When I boot with the uefi USB-stick and then by pressing 'tab' can input my path to / and the kernel (/dev/sdb1 vmlinuz), it reverts to the boot screen of the USB-disk.

Again no any error message is shown? What if try lilo(or grub? - what is installed on a USB stick) command line? Do I correctly understand that you're not able to boot your system installed on GPT drive in EFI mode, but still able to boot it in MBR mode(so lilo is still installed in MBR)? Only the distribution installed on a stick boots from EFI?


What about UEFI shell - have you tried it? (UEFI shell is a special application for EFI - it lets you run some commands before starting any OS or bootloader. For example you could manually start a .EFI executable, such as elilo.efi or bootmfgw.efi, from it).

brobr 10-20-2014 07:46 AM

Quote:

Originally Posted by dad_ (Post 5256380)
So you are not able to see any error message and don't have any failure trace?

That is correct no error message nor trace.


Quote:

Originally Posted by dad_ (Post 5256380)
Do I correctly understand that you're not able to boot your system installed on GPT drive in EFI mode, but still able to boot it in MBR mode (so lilo is still installed in MBR)? Only the distribution installed on a stick boots from EFI?

Yes. That's correct. When I try to uefi-boot from the internal GPT drive nothing happens, just that I get back to the SETUP menu. But for lilo to boot I first have - in SETUP - to change 'OS' from 'Windows 8' to 'Others' and then - automatically - 'Eufi' is set to 'disabled'. This would explain why lilo boots after that.


Quote:

Originally Posted by dad_ (Post 5256380)
What about UEFI shell - have you tried it?

In SETUP there is such an option but It did not work. I can access the boot menu with efibootmgr after booting from the USB-key (after modbrobe efivars; see previous posts), when I am in slackware; or is that not the shell you mean?

rob

dad_ 10-20-2014 08:01 AM

Quote:

Originally Posted by brobr (Post 5256463)


In SETUP there is such an option but It did not work. I can access the boot menu with efibootmgr after booting from the USB-key (after modbrobe efivars; see previous posts), when I am in slackware; or is that not the shell you mean?

rob

No, UEFI shell is not a unix shell. It is a separate .EFI executable which could be downloaded & started from USB stick for example, or from your EFI fat32 partition. See here:

https://wiki.archlinux.org/index.php...ace#UEFI_Shell

Embedded UEFI shell is also sometimes available - in your case it seems it doesn't work, but you could try some external UEFI shell application (try to download one of the mentioned in the above article - some may work, some not).

keefaz 10-20-2014 09:00 AM

Quote:

Originally Posted by brobr (Post 5256463)
When I try to uefi-boot from the internal GPT drive nothing happens, just that I get back to the SETUP menu.

Did you try the elilo.conf changes I suggested? (adding delays + prompt command)

brobr 10-20-2014 09:36 AM

Quote:

Originally Posted by dad_ (Post 5256466)
It is a separate .EFI executable which could be downloaded & started from USB stick for example, or from your EFI fat32 partition. See here:

https://wiki.archlinux.org/index.php...ace#UEFI_Shell

Embedded UEFI shell is also sometimes available - in your case it seems it doesn't work, but you could try some external UEFI shell application (try to download one of the mentioned in the above article - some may work, some not).

Thanks for the advice. It could take me some time to get this going. I just saw in SETUP the option "Launch EFI Shell from filesystem device". Would I need to copy a binary to a particular folder in the EFI folder on the ESP? And how would I then proceed?? This is new for me.

Cheers,

Rob

brobr 10-20-2014 09:39 AM

Quote:

Originally Posted by keefaz (Post 5256498)
Did you try the elilo.conf changes I suggested? (adding delays + prompt command)

Hi Keefaz, thanks. I just tested your suggestions but after two seconds of blackness the SETUP menu reappeared as before.

metaschima 10-20-2014 10:11 AM

Quote:

Originally Posted by brobr (Post 5256512)
Thanks for the advice. It could take me some time to get this going. I just saw in SETUP the option "Launch EFI Shell from filesystem device". Would I need to copy a binary to a particular folder in the EFI folder on the ESP? And how would I then proceed?? This is new for me.

Cheers,

Rob

Copy the shell to '/boot/efi/shellx64.efi'. See:
http://docs.slackware.com/howtos:sla...void_surprises

brobr 10-20-2014 04:05 PM

Thanks keefaz, dad_ and metachima for all the pointers. I think I found the solution, albeit fairly indirect. My EPS partition was wrongly fat32 formatted!

Quote:

Originally Posted by metaschima (Post 5256525)

An informative link metaschima. The reference in there was even more helpful! Especially the section about ESP on GPT-formatted discs, with:
Quote:

Note: If you get the message WARNING: Not enough clusters for a 32 bit FAT!, reduce cluster size with mkfs.fat -s2 -F32 ... or -s1, otherwise the partition may be unreadable by UEFI.
.

I had seen (but initially ignored) this error (my ESP is on /dev/sdb2):

Code:

bash-4.3# umount /boot/efi
bash-4.3# fsck /dev/sdb2
fsck from util-linux 2.21.2
fsck.fat 3.0.22 (2013-07-19)
Warning: Filesystem is FAT32 according to fat_length and fat32_length fields,
  but has only 51096 clusters, less than the required minimum of 65525.
  This may lead to problems on some systems.
/dev/sdb2: 14 files, 4257/51096 clusters

This error could be corrected according to the arch-page with
Code:

bash-4.3# mkfs.fat -s2 -F32 /dev/sdb2
as confirmed by a repeat of fsck (and the partition type was still EF00 according to gdisk). This wiped my original EFI/Slackware folders I reinstated with mkdir.

I then booted again into uefi-mode with my USB-key, mounted my / and /boot/efi partitions under /mnt and /mnt/boot/efi; did 'modprobe efivars' (both in the tty1 shell I was in as well as after 'chroot /mnt' in another terminal, tty2) and then could repeat 'eliloconfig' (in tty1). (Without the 'chroot /mnt' step 'eliloconfig' or 'efibootmgr' would be 'not found' because the USB-key did not have any slackware packages)

After that I booted straight into Slackware 3.14.18 without needing to change anything in the elilo.conf. I did not even get the chance to test the uefi Shell I had copied earlier according to your (metaschima and dad_) instructions; no need ;-).

This post is from an uefi-booted slackware-current installation:

Code:

bash-4.3# modprobe efivars
bash-4.3# efibootmgr 
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0001,0000
Boot0000* Windows Boot Manager
Boot0001* Slackware

and after some clean-up:

Code:

bash-4.3# efibootmgr -b 0000 -B
bash-4.3# efibootmgr -v       
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0001
Boot0001* Slackware        HD(2,7736800,64000,86ce4157-bde7-4e5f-890d-c0e406ad8bc0)File(\EFI\Slackware\elilo.efi)
bash-4.3#

Cheers,

rob

dad_ 10-21-2014 01:43 AM

Quote:

Originally Posted by brobr (Post 5256742)
Thanks keefaz, dad_ and metachima for all the pointers. I think I found the solution, albeit fairly indirect. My EPS partition was wrongly fat32 formatted!

I was not aware of such EFI peculiarities because my EFI partition was created by windows 7 installer :) (I went EFI only to be able to dual-boot win7/linux off my GPT disk and for win7 EFI required in this case).

Quote:

Originally Posted by brobr (Post 5256742)
This post is from an uefi-booted slackware-current installation:

Congrats!:cool:

BTW: I have EFI related question to all - in case of elilo package is upgraded(and this has happened already in Slackware64 current at least once) - we have to manually overwrite elilo files in /boot/efi? There's no special script like eliloconfig? Or we could safely use it in case of upgrade also?

Didier Spaier 10-21-2014 05:37 AM

Quote:

Originally Posted by dad_ (Post 5256916)
BTW: I have EFI related question to all - in case of elilo package is upgraded(and this has happened already in Slackware64 current at least once) - we have to manually overwrite elilo files in /boot/efi? There's no special script like eliloconfig? Or we could safely use it in case of upgrade also?

There's no reason to change anything in /boot/efi after an update of the elilo package. Similarly you wouldn't need to change anything in /boot after an update of the lilo package.

brobr 10-21-2014 06:06 AM

Quote:

Originally Posted by dad_ (Post 5256916)
Congrats!

Thanks.

Quote:

Originally Posted by dad_ (Post 5256916)
BTW: I have EFI related question to all - in case of elilo package is upgraded(and this has happened already in Slackware64 current at least once) - we have to manually overwrite elilo files in /boot/efi? There's no special script like eliloconfig? Or we could safely use it in case of upgrade also?

As far as I understood what is happening is that eliloconfig 0. controls whether you're on an uefi-system (GPT discs, ESP present etc), then 1. copies the required files to the EPS, and 2. makes a boot entry (See the script by, as root, 'less /usr/sbin/eliloconfig' or F3 in mc).

For 1. the required files are in the /boot folder: vmlinuz is the kernel installed and renamed to vmlinuz; with or without initrd.gz and the elilo.efi file is the one that fits your architecture (in my case elilo-x86_64.efi). (You can see this eg by comparing the contents of /boot and /boot/efi/EFI/Slackware alongside in mc)

Quote:

Originally posted by Didier Spaier
There's no reason to change anything in /boot/efi after an update of the elilo pacakage.
Yes, but all happens in /boot/efi/EFI/Slackware. Thus:

I wonder whether, after an upgrade (via upgradepkg or installpkg) of a kernel or elilo the required files get automatically copied to the EPS or whether you have to rerun eliloconfig. But it seems that eliloconfig might replace your current setup which is maybe not what you want, say when adding another kernel for testing.

And here a related question comes in: could you do this manually then, by copying the new kernel (and initrd.gz) and editing elilo.conf; (in this respect it looks quite similar to lilo.conf). But would one still need to add the new kernel to the boot menu with 'efibootmgr' or would 'elilo.efi' produce a menu one can choose from (after increasing time-out etc)? OR do you have to make a new folder (say Slackware-new) with the same contents as before but with vmlinuz (and initrd.gz) replaced by the new ones and add it to the boot menu with efibootmgr which then needs to be assessed during the booting phase with F7 (on my system)?

Rob

keefaz 10-21-2014 06:53 AM

elilo.efi is the boot entry in efibootmgr, so no need to update it after elilo.conf edits

If you have more than one entry in elilo.conf, just add "prompt" line, then at boot you can see elilo prompt and press enter to boot default or press tab to see other options (labels)

dad_ 10-21-2014 07:13 AM

Quote:

Originally Posted by Didier Spaier (Post 5257017)
There's no reason to change anything in /boot/efi after an update of the elilo pacakage. Similarly you wouldn't need to change anything in /boot after an update of the lilo package.

Elilo is quite different from lilo. To update lilo code installed in MBR (or linux partition) you just run
Code:

/sbin/lilo
command when you update your kernel config or lilo itself. With elilo the actual executable code is in elilo.efi file on your EFI FAT32 partition and AFAIK there's no command equivalent to lilo to update it(we have just /sbin/eliloconfig and /sbin/eliloalt). The new code installed by the upgraded elilo package is unpacked to /boot and is not runnable by EFI until you copy it to your EFI partition(eliloconfig does this among other things). I would prefer to not use elilo at all, and just boot the EFI stub which is present even in generic kernel, but there are some problems with initrd and kernel config - so this cannot be done without rebuilding the kernel manually?

jtsn 11-01-2014 08:11 PM

You could also install rEFInd, which provides EFI filesystem drivers for ext2, so it can execute ELILO from your /boot or root partition. (UEFI = Unified Extensible Firmware Interface) With its help ELILO can then read its configuration file, kernel and initrd from a linux partition, too. So this setup allows you to keep everything outside the ESP without having to switch to uber-complicated GRUB2.

gargamel 11-02-2014 04:25 AM

Very interesting thread with lots of useful information and excellent references!

I am slowly approaching this UEFI mountain, too, and haven't read all the useful references provided here. But as far as I did, I haven't seen advice, how to go about disk encryption including /root the partition. My (preliminary) conclusion is, that still everything is valid as described in README_CRYPT.TXT.
EDIT: Except partitioning using with gdisk rather than fdisk etc., and apart from using copying a few files to the EFI partition instead of installing lilo to the MBR, of course.

So I should avoid to encrypt /boot, right? And although it's not mentioned, I'd also avoid to encrypt the EFI System partition.

Is there anything else to be taken into account, not mentioned in the official documentation?

Thanks in advance

gargamel

gargamel 11-02-2014 05:54 AM

Another question I have: Is my understanding correct, that the order of installing systems for multiboot becomes less relevant with UEFI?

In the past it was always recommended to install MS Windows first, then Linux, because the Windows installer would wipe the boot record. With UEFI it should easily be possible to install Linux first, then Windows. Is this correct?

gargamel

brobr 11-03-2014 03:42 AM

Maybe check this out, EFI_Gentoo_End_to_End_Install, for some pointers about efi and encryption..

rob

BTW. I have windows in a virtual machine, saves to decide which OS to start ;-) And I ran in sleep/resume problems after I had activated some Windows-specific settings in the setup for my processor (Intel Smart Techn. and Rapid Start). These problems (direct resume from suspend) were described here XPS 13 wakes up from suspend spontaneously, and http://xps13-9333.appspot.com/#intel_rapid. There are modules in the kernel to take care for these settings but turning them off in the set-up seemed easier. But these could be relevant in the case you multiboot with windows (though not specific for uefi).


All times are GMT -5. The time now is 05:14 PM.