LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-05-2023, 04:02 AM   #1
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,260

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
Fix EFI from windows?


I've taken one thing too many for granted, it seems, and locked myself out of linux on my box. This post is coming to you courtesy of what I'm highly prejudiced against - m$ windows 11 . Now, my problem

The EFI partition (which is windows writable) has the partitions
Code:
EFI |
    | - Boot
    | - Microsoft
    | - Slackware
It defaults to Slackware. But I tweaked elilo.conf and now it won't boot, and gives no error. So I pulled my liveslak usb key but that won't boot either. I made it new, tested it and it was fine. Now, nothing. I go through the menu, and when it can't find init, so it isn't mounting /. Can I edit Slackware\elilo.conf from win 11 and if so how?
 
Old 05-05-2023, 06:23 AM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
Does your liveslak not boot with the error 'can't find init'? Which 'menu' are you referring to?

The link below is to the microsoft site explaining using bcdedit to modify UEFI entries. I don't see anything there that indicates it can modify non-windows entries. I didn't go through all the links on the page but you might take a look and see if there is anything helpful.

https://learn.microsoft.com/en-us/wi...ions-reference

The EFI partition isn't visible from the file manager in windows but you can access it from Disk Management. Explained in the link below but there is no explanation of how/if you can edit entries. It's a windows filesystem so I would expect there would be some way but have never done it myself. The link below also explains how to use a command prompt in windows to access the partition so perhaps using a windows text editor here would work??

https://www.diskpart.com/windows-11/...s-11-0825.html
 
Old 05-05-2023, 07:40 AM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,260

Original Poster
Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
Quote:
Originally Posted by yancek View Post
Does your liveslak not boot with the error 'can't find init'? Which 'menu' are you referring to?
I think I've exhausted my liveUSB otions. On my PC, I edited the grub menu and added 'root=/dev/sdb3' and got the "Can't find init' error. It's actually 'Can't load /sbin/init', around when it mounts / read only.
I gambled on being able to hold my retired laptop, ressurrected that, and tested the live usb, whish showed faults. I built it afresh from backups, but it seems like it's the end of the road for that particular usb drive. It's just got too many reformat & refill cycles on it.

Quote:
Originally Posted by yancek View Post
The link below is to the microsoft site explaining using bcdedit to modify UEFI entries. I don't see anything there that indicates it can modify non-windows entries. I didn't go through all the links on the page but you might take a look and see if there is anything helpful.


https://learn.microsoft.com/en-us/wi...ions-reference

The EFI partition isn't visible from the file manager in windows but you can access it from Disk Management. Explained in the link below but there is no explanation of how/if you can edit entries. It's a windows filesystem so I would expect there would be some way but have never done it myself. The link below also explains how to use a command prompt in windows to access the partition so perhaps using a windows text editor here would work??

https://www.diskpart.com/windows-11/...s-11-0825.html
Thanks for the links. The stuff I found was for editing windows boot entries from windows. Of course if the efi stuff needed editing, you wouldn't be able to get into windows If I can get a prompt or navigate the file/open menus, I should be fine - even in windows

What's irritating is that I have a sata disk in there also which should boot, but I haven't got it showing in the EFI menu.
 
Old 05-05-2023, 08:31 AM   #4
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Not a slack user, but came across your post in LQSpy and maybe some generic troubleshooting can help:

It won't boot with no error? Nothing on the screen at all?

If you can boot Windows and liveSlack at (least past the bootloader stage, which it seems is happening), your problem isn't EFI itself. Try another USB drive.

It is odd that when you specified root= that you'd still get that init error as you have booted to that point as you're not using your broklen bootloader. Did you install on a FS that liveSlack doesn't support OOB? Edit: on second thought, this is probably a kernel version mismatch. liveSlack boots its kernel, but your install may be using a different version, therefore the kernel can not find it's modules in /lib/modules, can't mount root, and you get that error.

If you press F9 or F12 which are the usual keys for bringing up the EFI boot menu, does Slackware show? If so, your EFI entry _may_ fine (see below), move on to the actual bootloader files.

If you can get a live distro working, at a shell prompt, type
Code:
efibootmgr -v
You should see the entries, look for something like

Code:
Boot0000* opensuse-secureboot   HD(1,GPT,a152xxxx-925b-497d-xxxx-5fdfcceb783e,0x800,0x80000)/File(\EFI\opensuse\shim.efi)
HD #1, GPT partitioning, a152xxx... is the partition UUID (lsblk -o PARTUUID) of the EFI boot partition. All of that needs to be correct. The last two numbers I am unsure of what they are, but they are the same on ALL of my installed entries (Windows, openSUSE, OpenCore). So perhaps a device or bus id.

As far as the SATA not showing, that's because it hasn't an entry in NVRAM. If it was bootable, and has an EFI folder, you could disable the non-booting drive and copy the contents of the EFI bootloader folder (for example \EFI\SLACKWARE) to \EFI\BOOT. \EFI\BOOT is supposed to be the fallback if there's no working entry found in NVRAM.

Edit 2:

You could also add it to the NVRAM:

Code:
efibootmgr --create --gpt (if GPT) --label name --disk /dev/sdXX --partition (partition number for the EFI system partition, 1 based) --loader (path_to_loader, ex: \EFI\linux\boot_x64.efi)

Last edited by goumba; 05-05-2023 at 09:09 AM.
 
Old 05-05-2023, 09:39 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,260

Original Poster
Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
I'm giving up for today for a while.

I have my ancient laptop booting. In an attempt to get my sata disk into play, I have somehow upset the boot priority, and currently nothing works. I see the MSI logo on boot up. I can't even get into the BIOS! I felt it might select sata by default if I removed the NVME, but I can't do that as one of my arms is paralyzed. The thing that is supposed to exit you from the BIOS now doesn't. I have a decent keyboard/mouse, but if I try to use them in the laptop, it fails. The bit of the tracker pad that controls the scroll refuses to. But if I try and type the screen scrolls all over.

In short, I feel like I'm in the Twilight Zone or the Bermuda Triangle. Fagan in the Movie 'Oliver' has this song near the end, where nearly every verse ends "I think I'd better think it out again!" I'm coming up for air, trying to civilize the BIOS, and we'll go from there.
 
Old 05-05-2023, 11:03 AM   #6
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
How old is the box?

CMOS battery maybe?

If you can't even get into the bios - and you're having issues with hardware - it sounds like something was already on the way out, and your messing around with ELilo was just unfortunate timing and has nothing to do with your problem.
 
Old 05-05-2023, 11:59 AM   #7
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,345

Rep: Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588
Open cmd with administrator privileges, use diskpart to select disk, list volume, select volume <number> of efi partition, assign an unused letter, exit, cd to slackware and use notepad from cmd to open elilo.conf

Last edited by colorpurple21859; 05-05-2023 at 12:41 PM.
 
1 members found this post helpful.
Old 05-05-2023, 12:52 PM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,260

Original Poster
Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
Quote:
Originally Posted by goumba View Post
How old is the box?

CMOS battery maybe?

If you can't even get into the bios - and you're having issues with hardware - it sounds like something was already on the way out, and your messing around with ELilo was just unfortunate timing and has nothing to do with your problem.
Well, some of that. The box is new, this year's. Since everything peripheral around here was dying. I pulled out a wired usb keyboard, and that works. The keyboard batteries had also chosen that particular moment to die! So my BIOS is back. I pulled out my lowest mileage sdcard and adapter and tried that burned as yet another liveslak usb. No dice. My backup liveslak may be AWOL, which would explain the usb failures. I had only shoved on 2 disk images on that particular sd card, so that would be a quick death indeed.

Next try will be a slackware-15.0 install iso, because if that boots I can mount my root partition, and chroot to it. Then attach the EFI partition and hopefully make the one necessary edit in elilo.conf. Then, buy some usb keys, and stop fixing stuff for a while.

FTR, m$ don't acknowledge the existence of other OSes in their documents. That's probably wise, given the average technical ability & IQ of their users. Diskpart is a piece of commercial software, from what I gather, a sort of fdisk on steroids. And the win 11 command prompt run as administrator seems very toothless indeed. There's no editor in Diskpart.
 
Old 05-05-2023, 01:09 PM   #9
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,345

Rep: Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588
Quote:
There's no editor in Diskpart.
you don't use diskpart to edit a file, you use it to assign a drive letter to the efi partition so it can be accessed, quit diskpart, and type notepad to open notepad editor
 
Old 05-05-2023, 01:16 PM   #10
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,260

Original Poster
Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
Quote:
Originally Posted by colorpurple21859 View Post
Open cmd with administrator privileges, use diskpart to select disk, list volume, select volume <number> of efi partition, assign an unused letter, exit, cd to slackware and use notepad from cmd to open elilo.conf
I had sent my last post before I saw this.

Thanks very much for the reply. As soon as I read this, I had myself sorted myself out in 5 minutes. I didn't know diskpart was part of windows 11. When you're sent to 'diskpart.com' I presume commercial. You were even kind enough to use the exact diskpart commands in telling me what to do. The only place that came unstuck was (after Ihad selected my EFI partition) assigning a letter to the EFI partition. The syntax there was

assign letter=M

That letter now shows in the file/open menu of notepad.
 
Old 05-05-2023, 01:26 PM   #11
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,345

Rep: Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588
You're Welcome.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Ooooy. EFI boot mmx64.efi.efi not found bulgin Linux - Newbie 12 12-20-2018 11:03 AM
[SOLVED] Can't find /boot/efi/EFI/Slackware/vmlinuz kernel configuration ironQiu Slackware 4 02-09-2015 06:21 AM
boot efi disk with without a non-efi bios pc... masavini Programming 1 11-12-2013 08:48 PM
EFI main GPT overwritten everytime (when windows 7 runs) - structure of EFI masuch Linux - Newbie 2 07-20-2012 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:40 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