LinuxQuestions.org
Help answer threads with 0 replies.
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 08-03-2020, 03:39 PM   #1
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,142

Rep: Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308
Not booting on X86: Can I sort myself with a live usb?


I can't boot my X86_64 box.

What I think went wrong was that I changed the boot order in /boot/grub/grub.cfg, but forgot to run grub-install, or else something odd happened when I did. I never noticed it for a few days because I was suspending, until I rebooted.Previously, I had kernel1, kernel2, kernel3. I switched it to kernel3, kernel2, kernel1. On the menu now, only kernel2 shows, and that goes out to lunch if I try booting it.

My install dvd chose that moment to expire. Don't you just love it when that happens? I also have a slackware live-usb disk, (kernel-4.19.58?) which boots, but doesn't seem to have grub installed. So I have to mount /, then /boot, and chroot. I can mount proc in the chroot but grub-install throws up a long string of missing device errors and apparently does nothing useful.

I see two options: get grub going under chroot, or on my usb drive there's a slackware64 iso on file. If I could burn a dvd, I can sort myself out with that. Can that be done?

Last edited by business_kid; 08-03-2020 at 03:40 PM.
 
Old 08-03-2020, 04:03 PM   #2
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,751

Rep: Reputation: Disabled
Assuming you've changed the order of drives, while device.map remained the same.
You can either fix this manually, or with the tools from the grub package. Probably not with both at the same time, because the tools overwrite manual edits.
If you're already familiar with the syntax, just edit grub.cfg and device.map to fit the drive map provided by bios. Note some connected USB storage may change this drive map, depending on bios configuration.
 
Old 08-03-2020, 04:30 PM   #3
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,776

Rep: Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425
Assuming your machine is new enough to support EFI boot, you could dispense with bootloader configs by calling up "Boot Order" and booting your Slackware media (either Install or Live should do) with the UEFI entry in Boot Order. Then run "efibootmgr" and if you like download and install "rEFInd" which behave a bit like GRUB by finding bootable kernels and adding them to it's menu.
 
Old 08-04-2020, 04:14 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,142

Original Poster
Rep: Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308
Thanks for the replies.

My machine supports EFI, but it's an M$ inspired BIOS in that area and supremely awkward. To get out of the UEFI 'jail' the BIOS has created, I specified 'Legacy boot, and formatted the disk with fdisk. So, no EFI is enabled.

I haven't changed the order of the drives. I use one ssd, and a usb backup drive. I can press F10 on reboot, and select either the dvd or a usb drive. There are 3 kernels on the same /boot drive (sda1) booting the same /root drive (sda3). I was meaning to install another system on sda6, and I probably wiil, one of these years…
The slackware Live usbs are more than a little complex, with several ISOs loop mounted. I'm hesitant to start firing packages in. I think I just need to install grub again, and all will be well. But 'grub-install /dev/sda in a chroot fails.

Could I install lilo in a chroot? It probably is on the HD. I could probably restore (in)sanity that way…
The other trick I can think of is burning a DVD. I have the iso, but the live usb only had cdrecord that I spotted. That means many grey hairs and a day wasted as I grapple with the very objectionable Mr. Schilling's rantings.
 
Old 08-04-2020, 04:41 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,499
Blog Entries: 19

Rep: Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410
I think you can install any bootloader in chroot if you set up all the dynamic filesystems correctly, linking them to the versions on your host. The LFS book shows you how to do that.

As far as your UEFI is concerned, I don't think legacy boot is incompatible with booting something by hand. It only determines where the firmware normally looks for the bootloader on a given device.

Last edited by hazel; 08-04-2020 at 04:44 AM.
 
Old 08-04-2020, 06:54 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,142

Original Poster
Rep: Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308
Thanks for all the help. I got out of it by reverting to the stone age

Lilo v1 is in the 'a/' directory - the one that everybody should install all of, they tell us.

I looked up how to get a lilo.conf written, and wrote one. That installed in a chroot. So I'm now booting on my own kernels on a primitive lilo, but will be back to grub in an hour or less.

For the record, the live usb doesn't have grub or lilo. I didn't check exhaustively for elilo. Lilo v1 is pre-uefi, but that suits, as so am I. As there's no boot loading programs on the live usb, I reckon it's a chroot. I did have proc available, but I didn't have sysfs, tmpfs, etc. It could probably be done, but I'll leave that to others.

EDIT: Install dvd being written as I post this!
 
Old 08-04-2020, 06:58 AM   #7
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,499
Blog Entries: 19

Rep: Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410
The installer checks your boot mode by looking for /sys/firmware/efi/vars. If it finds that, it should install elilo on your EFI system partition by default. That's what it did for me anyway. Otherwise it installs lilo in the mbr.
 
Old 08-04-2020, 09:00 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,142

Original Poster
Rep: Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308
Well, I wrote the install dvd twice. The first one puked.

Then I wanted to restore grub.Here's my grub.cfg:
Code:
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5
set root=(hd0,1)
insmod msdos

}menuentry "Slackware64-5.4.30-dec15 - Dec's Kernel" {
        linux  /vmlinuz-5.4.30-dec15 root=/dev/sda3 ro
}
menuentry "Slackware64-5.4.30-dec14 - Dec's Kernel" {
        linux  /vmlinuz-5.4.30-dec14 root=/dev/sda3 ro
}
menuentry "Slackware64-5.4.27 - Generic Kernel" {
        linux  /vmlinuz-generic-5.4.27 root=/dev/sda3 ro
        initrd /initrd.gz
I ran 'grub-install /dev/sda' to replace my stone age lilo config, and success was reported with no errors. I rebooted, and I got the fault condition - seeing Slackware64-5.4.30-dec14 entry only in the menu, and that not working.
Never mind, I thought, I'll boot on the dvd. But that went out to lunch halfway through the boot. So I'm back on my live usb --> chroot -->primitive lilo, referencing the same kernels on the same boot drive, except they're working with lilo. Now I am booting, but grub is doing nothing, except upsetting lilo. 'e2fsck -fvy' reports no issue with sda1, the common /boot partition. Is there some diagnostics built into grub to see why it's doing what appears to be nonsense? Should I be deleting stuff?

The only thing I did was swap the generic kernel above to the top - a copy & paste in nano, and Ctrl_K to delete the spare lines. I felt sure I ran grub-install. When grub puked, I presumed I must have forgotten to update the disk to the menu, but I did that, and it pukes. I have the same stuff in lilo.conf, and it seems to go fine

Don't worry about the dvd. It's seven years old. The laser and the cdr were scrupulously cleaned, but I can do without it.
 
Old 08-04-2020, 10:13 AM   #9
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,499
Blog Entries: 19

Rep: Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410
I think you have two unpaired braces in that grub menu.cfg file. The closing brace before the first entry doesn't correspond to anything. And there's no closing brace for the third entry.
 
Old 08-04-2020, 12:29 PM   #10
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,751

Rep: Reputation: Disabled
Example of my MBR setup if you want to use as reference:

Code:
menuentry 'unknown-pc-linux-gnu' --class linux --class os {
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos1'
	linux	/boot/vmlinuz root=/dev/sdb1 rootfstype=ext2 ro
}
menuentry 'unknown-pc-linux-gnu-64' --class linux --class os {
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos2'
	linux	/boot/vmlinuz-64 root=/dev/sdb2 rootfstype=ext2 ro
}
device.map

Code:
(hd1) /dev/sda
(hd0) /dev/sdb
(hd2) /dev/sdc
Couple of notes:

There is part_msdos and msdospart (I think there is no 'msdos' module in 14.2 grub package) so your 'insmod msdos' seems suspicious.
In my example, a primary drive hd0 is mapped to sdb, in your case that would be sda.
I do also chainloading and remapping, but I removed this from example to make it simple.
 
Old 08-04-2020, 02:29 PM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,142

Original Poster
Rep: Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308
Quote:
Originally Posted by hazel View Post
I think you have two unpaired braces in that grub menu.cfg file. The closing brace before the first entry doesn't correspond to anything. And there's no closing brace for the third entry.
Thanks, hazel & well spotted. This could have been it. I don't know, because I moved the entries since the initial problems.

@elcore: Thanks for the ideas. glad to hear the msdos module is gone. It's so weird to be talking about failed OSes of the last millenium. You sure have a lot of extra lines in your config.

I never had any device map, so in your honour one went in. Then i ran grub-install again, made sure my live usb key was inserted, and tried again. It booted up as normal. So I am not sure what broke it, or fixed it, but I imagine typos might have done it. Tired eyes…
 
Old 08-04-2020, 09:42 PM   #12
thirdm
Member
 
Registered: May 2013
Location: Massachusetts
Distribution: Slackware, NetBSD, Debian, 9front
Posts: 312

Rep: Reputation: Disabled
grub2 includes a utility named grub-script-check that can point out some kinds of errors in grub.cfg, in case you edit again sometime.
 
Old 08-05-2020, 04:17 AM   #13
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,142

Original Poster
Rep: Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308
Thanks. I already have edited again, I just didn't make an idiot of myself
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Can not create live usb for OpenSuse using Live USB creater :( PrinceCruise Linux - General 4 09-23-2009 02:04 PM
Can I use GNU sort to sort one field in order, another in reverse? zombieite Linux - Newbie 4 04-27-2009 12:23 AM
How do I do filtering in Perl (keep sort order and sort again by another means)? RavenLX Programming 9 12-19-2008 10:12 AM
selection sort compiles but does not sort the array as desired ganesha Programming 2 04-20-2008 07:44 AM
Is there a line limit with the sort utility? Trying to sort 130 million lines of text gruffy Linux - General 4 08-10-2006 08:40 PM

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

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