LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 03-17-2023, 10:54 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,612

Rep: Reputation: 180Reputation: 180
UEFI BIOS with non-UEFI linux install


I have just upgraded my computer's motherboard to an ASUS Prime 550M-A. When it boots, it does not see the boot drive. Linux (Slackware 15.0) was originally installed on this drive with an old non-UEFI motherboard. I've been avoiding UEFI for years.

I can boot from the installation DVD and it does see the Linux partitions on the hard drive.

Not sure how to solve this. Do I have to reformat the drive and restore everything?
 
Old 03-17-2023, 11:19 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,346

Rep: Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552
I suggest that you switch from UEFI boot to legacy boot. Here are some instructions as to how to do that:

https://www.intel.in/content/www/in/...-products.html
 
Old 03-18-2023, 12:39 AM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,612

Original Poster
Rep: Reputation: 180Reputation: 180
Thanks. That links is for Intel boards and I have ASUS. After some more searching I discovered that thers is a setting on the ASUS board called "CSM" (Compatibility Support Module) that will permit booting Legacy BIOS. The setting wasn't straightforward to find, but I did find and set it. It did boot. It did not show the usual Slackware splash screen with the boot-delay count down. Instead, the screen shows "LILO 24.2 boot:", which stay displayed for what is probably the boot-delay time with no visual count-down.

So, that works, but maybe I should bite the bullet and go all-in on UEFI. I've formatted Linux partitions with gdisk before to accommodate +2G drives, but I suppose this means backing up and restoring the partition.
 
Old 03-18-2023, 12:56 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
There is no reason to run CSM anymore IMHO. Not sure about slack, but some software will detect UEFI firmware (even in CSM) and proceed accordingly. Much angst may ensue.

On my (not new) machines that are mixed UEFI (gpt) and MBR boot, all disks show in the boot list, so not sure what the issue is with your machine.

Converting can be done in-place, but you need some free space in the partition(s), and you'll have to create an EFI partition and re-install your loader. Prior backup is not optional. Should be a bunch of tutorials online.
 
Old 03-18-2023, 05:34 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,681
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
If you're used to lilo, you will want to boot with elilo. There's an eliloconfig script in the Slackware installation image that will install it. It's a very well-behaved little program that looks just like lilo when it's running. The main difference is that you can install new entries just by editing the config file, without having to run a separate program afterwards. The only other thing you need to remember is to have all your kernels and initrds copied to the EFI partition where elilo can find them. It can't use the copies in /boot because elilo can't read ext4 filesystems.

Last edited by hazel; 03-18-2023 at 05:35 AM.
 
Old 03-18-2023, 12:03 PM   #6
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,612

Original Poster
Rep: Reputation: 180Reputation: 180
Well, I guess this is going to be a project. I [re]created the partitions using gdisk. When I ran setup it said I needed to run cfdisk to create a UEFI partition. I did that. I then ran setup to install Slackware. When the option came up, I selected elilo. After completing installation I rebooted.

The UEFI BIOS does not recognize any boot partitions. It does see the drives. I did follow the instructions in https://docs.slackware.com/howtos:sl...?do=export_pdf

The /EFI/Slackware/elilo.conf contains only:
Code:
chooser=simple
delay=1
timeout=1
image=vmlinuz
    label=vmlinuz
    initrd=initrd.gz
    append="root=/dev/sda2 vga=normal ro"
Any suggestions?

Last edited by mfoley; 03-18-2023 at 12:12 PM.
 
Old 03-18-2023, 04:44 PM   #7
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,243

Rep: Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861
Show us listing of the files in /boot/efi/EFI/Slackware.

Do you have a file in there called elilo.efi ? That file is the boot loader. Here what I have in that directory.

Quote:
ls -l /boot/efi/EFI/Slackware/
total 29M
drwxr-xr-x 2 root root 1.0K Feb 26 06:07 ./
drwxr-xr-x 8 root root 512 Jan 28 10:06 ../
-rwxr-xr-x 1 root root 471 Feb 26 06:07 elilo.conf*
-rwxr-xr-x 1 root root 233K Jun 12 2018 elilo.efi*
-rwxr-xr-x 1 root root 11M Feb 21 13:07 initrd-94.gz*
-rwxr-xr-x 1 root root 2.2K Jan 16 2021 textmenu-message.msg*
-rwxr-xr-x 1 root root 7.5M Feb 21 13:08 vmlinuz-generic-5.15.94*
-rwxr-xr-x 1 root root 12M Feb 21 13:08 vmlinuz-huge-5.15.94*
I'm using a menu, you do not need that to boot. It allows me to choose either the generic kernel or huge.
 
Old 03-18-2023, 05:52 PM   #8
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
Is this a 64 or 32 bit system?
 
Old 03-18-2023, 10:37 PM   #9
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,612

Original Poster
Rep: Reputation: 180Reputation: 180
Quote:
Originally Posted by camorri View Post
Show us listing of the files in /boot/efi/EFI/Slackware.

Do you have a file in there called elilo.efi ? That file is the boot loader. Here what I have in that directory.

I'm using a menu, you do not need that to boot. It allows me to choose either the generic kernel or huge.
My /boot/efi directory is empty. In /boot I have:
Code:
total 40588
lrwxrwxrwx  1 root root       38 Mar 18  2023 README.initrd -> /usr/doc/mkinitrd-1.4.11/README.initrd
lrwxrwxrwx  1 root root       23 Mar 19  2023 System.map -> System.map-huge-5.15.19
-rw-r--r--  1 root root  5108747 Feb  2  2022 System.map-generic-5.15.19
-rw-r--r--  1 root root  6875932 Feb  2  2022 System.map-huge-5.15.19
lrwxrwxrwx  1 root root       23 Mar 19  2023 config -> config-huge-5.15.19.x64
-rw-r--r--  1 root root   239284 Feb  2  2022 config-generic-5.15.19.x64
-rw-r--r--  1 root root   239253 Feb  2  2022 config-huge-5.15.19.x64
drwxr-xr-x  2 root root     4096 Mar 18  2023 efi/
-rwxr-xr-x  1 root root   216219 Jun 12  2018 elilo-ia32.efi*
-rwxr-xr-x  1 root root   238531 Jun 12  2018 elilo-x86_64.efi*
drwxr-xr-x  3 root root     4096 Jan  4  2022 grub/
drwxr-xr-x 14 root root     4096 Mar 19  2023 initrd-tree/
-rw-r--r--  1 root root  9805860 Mar 19  2023 initrd.gz
-rw-r--r--  1 root root    22578 Feb 13  2021 inside.bmp
-rw-r--r--  1 root root      432 Feb 13  2021 inside.dat
-rw-r--r--  1 root root     6878 Feb 13  2021 onlyblue.bmp
-rw-r--r--  1 root root      424 Feb 13  2021 onlyblue.dat
-rw-r--r--  1 root root    15634 Mar 27  2011 slack.bmp
-rw-r--r--  1 root root    33192 Feb 13  2021 tuxlogo.bmp
-rw-r--r--  1 root root      423 Feb 13  2021 tuxlogo.dat
lrwxrwxrwx  1 root root       20 Mar 19  2023 vmlinuz -> vmlinuz-huge-5.15.19
lrwxrwxrwx  1 root root       23 Mar 18  2023 vmlinuz-generic -> vmlinuz-generic-5.15.19
-rw-r--r--  1 root root  7495840 Feb  2  2022 vmlinuz-generic-5.15.19
lrwxrwxrwx  1 root root       20 Mar 18  2023 vmlinuz-huge -> vmlinuz-huge-5.15.19
-rw-r--r--  1 root root 11207136 Feb  2  2022 vmlinuz-huge-5.15.19
My /dev/sda has the following partitions:
Code:
GPT fdisk (gdisk) version 1.0.8

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

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 1953525168 sectors, 931.5 GiB
Model: ST1000DM010-2EP1
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): D0587E42-8068-4FA7-9214-3D5D104A4103
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 8-sector boundaries
Total free space is 0 sectors (0 bytes)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048        12584959   6.0 GiB     8200  Linux swap
   2        12584960      1953525134   925.5 GiB   8300  Linux filesystem
   3              34            2047   1007.0 KiB  EF00
What does "MBR: protective" mean? Should I have done 'wipefs /dev/sda' first?

Actually, I found a description of "MBR: protevtive" - "For limited backward compatibility, the space of the legacy Master Boot Record (MBR) is still reserved in the GPT specification, but it is now used in a way that prevents MBR-based disk utilities from misrecognizing and possibly overwriting GPT disks. This is referred to as a protective MBR." Perhaps that is "standard"?
Quote:
Originally Posted by colorpurple21859 View Post
Is this a 64 or 32 bit system?
64 bit.

Last edited by mfoley; 03-18-2023 at 11:55 PM.
 
Old 03-19-2023, 08:34 AM   #10
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,681
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
Quote:
Originally Posted by mfoley View Post
My /boot/efi directory is empty.
It's meant to be empty. It's just a mount point for your EFI system partition. You might find it convenient to have a line in your fstab for mounting the ESP on /boot/efi.
Quote:
My /dev/sda has the following partitions:
Code:
GPT fdisk (gdisk) version 1.0.8

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

Found valid GPT with protective MBR; using GPT.
....
Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048        12584959   6.0 GiB     8200  Linux swap
   2        12584960      1953525134   925.5 GiB   8300  Linux filesystem
   3              34            2047   1007.0 KiB  EF00
So you already have an ESP at /dev/sda3. That's where your kernel(s), initrd(s) and elilo files should go.
Quote:
What does "MBR: protective" mean? Should I have done 'wipefs /dev/sda' first?

Actually, I found a description of "MBR: protective" - "For limited backward compatibility, the space of the legacy Master Boot Record (MBR) is still reserved in the GPT specification, but it is now used in a way that prevents MBR-based disk utilities from misrecognizing and possibly overwriting GPT disks. This is referred to as a protective MBR." Perhaps that is "standard"?
Yes, it's there partly so that you can boot in mbr mode if you want to. The partition table in the protective mbr is a dummy; it doesn't have anything to do with the actual partitioning. But you can put a bootloader like LILO or GRUB stage 1 in there if you have your UEFI set to do a legacy (csm) boot.
 
Old 03-19-2023, 08:45 AM   #11
Arnulf
Member
 
Registered: Jan 2022
Location: Hanover, Germany
Distribution: Slackware
Posts: 273

Rep: Reputation: 89
Think about switching to GRUB2. It works well with Slackware64 15.0 and UEFI boot. CSM isn't required longer. UEFI recognizes and stores GRUB2 entries. It's highly recommended to uninstall all lilo and elilo stuff after switching to GRUB2 to avoid annoying mishaps.
I've done this switch during upgrade from Slackware64 14.2 to 15.0 in combination with a hardware upgrade from AMD FX-8350 to AMD Ryzen 7 5800X. I wouldn't use CSM with this new hardware because CSM becomes more and more obsolete.
 
Old 03-19-2023, 09:18 AM   #12
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
The efi partition needs to be bigger, 1007kb isn’t big enough to hold anything. Maybe shrink the swap by about 200Mb for an efi partition formated as fat32 and mounted to /boot/efi
 
Old 03-19-2023, 09:54 AM   #13
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,612

Original Poster
Rep: Reputation: 180Reputation: 180
Quote:
Originally Posted by hazel View Post
It's meant to be empty. It's just a mount point for your EFI system partition. You might find it convenient to have a line in your fstab for mounting the ESP on /boot/efi.
My fstab is:
Code:
dev/sda1        swap             swap        defaults         0   0
/dev/sda2        /                ext4        defaults         1   1
/dev/sda3        /boot/efi        vfat        defaults         1   0
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro,comment=x-gvfs-show 0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       nosuid,nodev,noexec 0   0
Quote:
So you already have an ESP at /dev/sda3. That's where your kernel(s), initrd(s) and elilo files should go.
In /dev/sda3 is the directory EFI which has:
Code:
-rwxr-xr-x 1 root root    135 Mar 18 01:10 elilo.conf*
-rwxr-xr-x 1 root root 238531 Jun 12  2018 elilo.efi*
-rwxr-xr-x 1 root root      0 Mar 19  2023 initrd.gz*
-rwxr-xr-x 1 root root 729008 Feb  2  2022 vmlinuz*
So, why am I not booting? I apparently have the partitions formatted correctly and I selected elilo at install time. What did I miss?
Quote:
Originally Posted by Arnulf View Post
Think about switching to GRUB2. ...
I'd like to solve the mystery of being able to boot with the as-advertised elilo first. I've never been a bit fan of grub, but if I have to ... I have a document somewhere saying that lilo works better with RAID arrays than grub in case of failure, but I'd like to save that experimentation for later.

Last edited by mfoley; 03-19-2023 at 09:55 AM.
 
Old 03-19-2023, 10:17 AM   #14
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,877
Blog Entries: 1

Rep: Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078
Quote:
Originally Posted by hazel View Post
So you already have an ESP at /dev/sda3. That's where your kernel(s), initrd(s) (...) should go.
Can go, I suppose. Should go, not. FAT partitions crude things, no place for keeping Linux kernels or initrds. Symlinks can't be used on them. They belong on a Linux native filesystem. On some distros, when /boot isn't a discrete filesystem, the kernel isn't anywhere in /boot, but just a symlink to /usr/lib/modules/<version>/vmlinuz.
 
Old 03-19-2023, 10:23 AM   #15
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,243

Rep: Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861
Quote:
-rwxr-xr-x 1 root root 135 Mar 18 01:10 elilo.conf*
-rwxr-xr-x 1 root root 238531 Jun 12 2018 elilo.efi*
-rwxr-xr-x 1 root root 0 Mar 19 2023 initrd.gz*
-rwxr-xr-x 1 root root 729008 Feb 2 2022 vmlinuz*
You have an empty initrd.gz file. The size of vmlinuz is the approximate size of a generic kernel.

Re-create your initrd.gz file, copy it over the empty one.
 
  


Reply

Tags
uefi booting



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
UEFI Class 3 :: To use UEFI, or not to use UEFI? jheengut Slackware 19 12-30-2020 09:24 AM
[SOLVED] Install non-UEFI system from a UEFI USB? andrew.46 Slackware 10 04-08-2020 11:28 PM
Mobo only supports uefi boot - how do I boot off a non-uefi cd? Ulysses_ Linux - Hardware 3 02-25-2016 08:06 PM
Help Creating UEFI A MENU For My Bootable (BIOS/UEFI) CDROM ssenuta Linux - Hardware 0 08-27-2012 09:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration