LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-10-2024, 05:26 PM   #1
rocknrobin
Member
 
Registered: Apr 2020
Location: Texas
Distribution: 14.2
Posts: 50

Rep: Reputation: Disabled
Updating Slackware 15.0+


I just recently built a new PC whereupon I cannot enable CSM on my motherboard so I am trying to move an existing Slackware 15.0+ MBR image on hard drive to UEFI. I posted a thread on this forum back in February 2022, https://www.linuxquestions.org/quest...ub-4175708479/, that detailed directions to make this happen which I have summarized here:

Code:
To fix:
reimage the hardrive
boot ubuntu usb,
use gparted to shrink sda1 and create a 200mb fat32 partition flagged esp.
open a terminal

to convert to gpt drive use gdisk

sudo gdisk /dev/sda

after converting to gpt mount /dev/sda1 and chroot into the system and install grub
chroot /mnt /bin/bash

sudo mount /dev/sda1 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo mount --bind /run /mnt/run
sudo chroot /mnt
mkdir /boot/efi
mount /dev/sda2 /boot/efi
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub
grub-mkconfig -o /boot/grub/grub.cfg
exit


Also if used in a virtual environment:

mkdir /boot/efi/EFI/boot
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64efi
All these steps worked great and I was able to have a UEFI bootable Slackware platform on my new PC then. I tried with basically the same hardware today on a new machine...same exact motherboard, same RAM, and same processor. This is the error message I get when I try the grub-install today.

Code:
bash-5.2# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub
Installing for x86_64-efi platform.
EFI variables are not supported on this system.
EFI variables are not supported on this system.
grub-install: error: efibootmgr failed to register the boot entry: No such file or directory.
Repartitioning the hard drive and converting to a GPT drive worked ( on /dev/sda -- sdb is the usb drive I am using to make these modifications).

Code:
root@robby-Z690-UD-DDR4:~# parted -l
Model: ATA Samsung SSD 870 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End    Size   File system  Name                  Flags
 1      32.3kB  999GB  999GB  ext4         Linux filesystem
 2      999GB   999GB  537MB  fat32        EFI system partition  boot, esp


Model:  USB  SanDisk 3.2Gen1 (scsi)
Disk /dev/sdb: 61.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name                  Flags
 1      1049kB  538MB   537MB   fat32        EFI System Partition  boot, esp
 2      538MB   61.5GB  61.0GB  ext4




root@robby-Z690-UD-DDR4:~# gdisk /dev/sda

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.

I do see that efivar must be installed:

Code:
bash-5.2# efivar --usage
Usage: efivar [OPTION...]
  -t, --attributes=<attributes>     attributes to use on append
  -l, --list                        list current variables
  -p, --print                       print variable specified by --name
  -D, --dmpstore                    use DMPSTORE format when exporting
  -d, --print-decimal               print variable in decimal values specified
                                    by --name
  -n, --name=<guid-name>            variable to manipulate, in the form
                                    8be4df61-93ca-11d2-aa0d-00e098032b8c-Boot0000
  -a, --append                      append to variable specified by --name
  -f, --datafile=<file>             load or save variable contents from <file>
  -e, --export=<file>               export variable to <file>
  -i, --import=<file>               import variable from <file
  -L, --list-guids                  show internal guid list
  -w, --write                       write to variable specified by --name

Help options:
  -?, --help                        Show this help message
      --usage                       Display brief usage message
but when listing the variables, which I can do on the working UEFI machine lists nothing.

Code:
bash-5.2# efivar --list
efivar: error listing variables: Function not implemented
Has something changed with Slackware since 2022 that needs to be modified to make this work now?

Thanks for any help.

Last edited by rocknrobin; 04-10-2024 at 06:12 PM.
 
Old 04-10-2024, 07:27 PM   #2
babydr
Member
 
Registered: Aug 2015
Location: Fairbanks , Alaska
Distribution: Slackware-14.2 & 15.0
Posts: 229

Rep: Reputation: 45
@rocknrobin , Seems that you don't have efivars mounted for grub-install to read the variables from .
Maybe the module isn't installed .

Code:
efivarfs       efivarfs                0       0         0     -          0          0          0    - -    /sys/firmware/efi/efivars
 
Old 04-10-2024, 08:49 PM   #3
rocknrobin
Member
 
Registered: Apr 2020
Location: Texas
Distribution: 14.2
Posts: 50

Original Poster
Rep: Reputation: Disabled
Thanks for the quick response babydr. How do I mount efivarfs? I didn't have to do that before?
 
Old 04-10-2024, 10:16 PM   #4
rocknrobin
Member
 
Registered: Apr 2020
Location: Texas
Distribution: 14.2
Posts: 50

Original Poster
Rep: Reputation: Disabled
Update from previous reply. When checking /sys/firmware/efi/efivars there are no files in that directory.


Code:
bash-5.2# cd /sys/firmware/efi/efivars
bash-5.2# ls -l
total 0
The working system has 103 files in it so the variables are not even there if I did mount it. How do I populate the variables?

Thanks.
 
Old 04-11-2024, 03:31 AM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,063

Rep: Reputation: Disabled
Quote:
Originally Posted by rocknrobin View Post
Update from previous reply. When checking /sys/firmware/efi/efivars there are no files in that directory.


Code:
bash-5.2# cd /sys/firmware/efi/efivars
bash-5.2# ls -l
total 0
The working system has 103 files in it so the variables are not even there if I did mount it. How do I populate the variables?

Thanks.
As root, type:
Code:
mount -t efivarfs none /sys/firmware/efi/efivars
after that grub-install should work if the ESP is in /dev/sda, else you need to give the target device as argument of the grub-install command.

Last edited by Didier Spaier; 04-11-2024 at 10:47 AM. Reason: Typo fix.
 
1 members found this post helpful.
Old 04-11-2024, 10:42 AM   #6
rocknrobin
Member
 
Registered: Apr 2020
Location: Texas
Distribution: 14.2
Posts: 50

Original Poster
Rep: Reputation: Disabled
Thanks Didier Spaier. I first checked to see if efivarfs was mounted:

Code:
bash-5.2# mount | grep efivarfs
bash-5.2#
It was not so I mounted it as you pointed out:

Code:
bash-5.2# mount -t efivarfs none /sys/firmware/efi/efivars
bash-5.2# mount | grep efivarfs
none on /sys/firmware/efi/efivars type efivarfs (rw,relatime)
bash-5.2#

Then I ran grub-install and grub-mkconfig:

Code:
bash-5.2# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub
Installing for x86_64-efi platform.
Installation finished. No error reported.
bash-5.2# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-huge-6.6.25
Found initrd image: /boot/initrd.gz
Found linux image: /boot/vmlinuz-huge
Found initrd image: /boot/initrd.gz
Found linux image: /boot/vmlinuz-generic-6.6.25
Found initrd image: /boot/initrd.gz
Found linux image: /boot/vmlinuz-generic
Found initrd image: /boot/initrd.gz
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
bash-5.2#
All seems to have installed okay. I now have 108 files in /sys/firmware/efi/efivars. I will now reboot to see if the new hard drive will boot on uefi.
 
Old 04-11-2024, 05:17 PM   #7
rocknrobin
Member
 
Registered: Apr 2020
Location: Texas
Distribution: 14.2
Posts: 50

Original Poster
Rep: Reputation: Disabled
Thanks for all the help. I rebooted and I now have a Slackware distro 15.0 working on a UEFI hardware platform booting with Grub. A couple of cleanup items. After I was able to boot up to Slackware the network interface on the new hardware was not working. I ran across this back in September of last year solved via this post: https://www.linuxquestions.org/quest...ng-4175728577/
I updated the MAC address of the new NIC on the new Motherboard in 70-persistent-net.rules, rebooted and ETH0 working again. Then I had to change the IP address of the new machine so it didn't cause an IP address conflict in /etc/rc.d/inet1.conf. Another reboot and the new IP address took affect. Voila.
 
  


Reply

Tags
uefi



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
Updating account after device failure and updating OS Handelbar41 LinuxQuestions.org Member Intro 2 12-12-2022 07:44 PM
[SOLVED] Ubuntu 12.04: Updating via ssh. Dropped connection. Updating locked. How to continue robsbots Linux - General 10 10-02-2014 07:51 PM
rpm changes are not updating immediately and updating after some time. shri_22ram Linux - Newbie 1 05-13-2013 12:50 PM
why is bind updating reverse zone with updating zone 202.1.168.192.1.168.192.in-addr marcobjorge Linux - Networking 5 10-12-2008 04:53 AM
Updating VMWare After Updating CentOS Linux31 Red Hat 2 09-18-2007 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:28 AM.

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