LinuxQuestions.org
Visit Jeremy's Blog.
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 01-11-2022, 02:02 PM   #1
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,363

Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
Yet another grub hiccough.


"It would be good to have a bootable backup disk," I thought. So as I was organizing one, I backed up my current install to be bootable. It's mainly the /home I need anyhow I added partuuids to the fstab, and mkade this grub config for the backup disk (to be booted via usb atm)
Code:
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5
set root=(hd1,1)
insmod msdos

menuentry "Slackware64-5.10.15 - Generic Kernel" {
        linux  /vmlinuz-generic-5.10.15 root=/dev/sdb2 ro 
        initrd /initrd-5.10.15.gz
Attempting to install it got me this error
Code:
root@RoseViolet:/boot/grub# grub-install /dev/sdb
Installing for i386-pc platform.
grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub-install: error: embedding is not possible, but this is required for cross-disk install.
That was normally a question of toggling a bootable flag, but that option is missing or moved in fdisk & gdisk. There's been a serious revamp there and all sorts of weird and wonderful partition types have been invented. Why?

Now this is all my fault, of course. But what should have known that I didn't?
 
Old 01-11-2022, 02:18 PM   #2
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,364

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
You are attempting to install grub to a gpt drive in legacy mode.
try
Code:
grub-install --force /dev/sdb
If this doesn't work use lilo, or create a 2mb empty partition flagged BIOS Boot on the gpt drive to install grub in legacy mode or install grub in uefi mode.

Last edited by colorpurple21859; 01-11-2022 at 02:20 PM.
 
3 members found this post helpful.
Old 01-11-2022, 02:39 PM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,062

Rep: Reputation: Disabled
https://wiki.archlinux.org/title/GRU...c_instructions
 
3 members found this post helpful.
Old 01-12-2022, 11:56 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,363

Original Poster
Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
Thanks Didier Spaier, & colorpurple21859.

To cut to the chase, grub thinks it's installed, but it doesn't see the disk as bootable when I press F10 on bootup.

There's no gpt here, I got this box in early 2013,which was a very patchy time for UEFI support. I eventually hacked into an extremely hostile BIOS enough to get Legacy mode going, and never looked back. Just thinking, even formatting with gdisk is enough to reawaken UEFI. I did format the new disk with gdisk. But I haven't woken the enemy Bios thus far …
Code:
bash-5.1$ sudo gdisk -l /dev/sdb
Password: 
GPT fdisk (gdisk) version 1.0.6

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

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdb: 1953525168 sectors, 931.5 GiB
Model: USB 3.0         
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 210C4ABB-7483-4DC0-B678-9EF1F58DCA21
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 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048            6143   2.0 MiB     EF02  BIOS boot partition
   2            6144          518143   250.0 MiB   8300  Linux filesystem
   3          518144        84404223   40.0 GiB    8300  Linux filesystem
   4        84404224       189261823   50.0 GiB    8300  Linux filesystem
   5       189261824      1953525134   841.3 GiB   8300  Linux filesystem
That gdisk does go into long-winded detail, as does the Arch Wiki!

I find it's always the last thing you think of trying with grub that works. In my case, it was making the Bios Boot partition. Grub installed error free, but the System Can't See It when I hit F10 and looks for an alternative boot source. SCSI indeed. Do I need to put a file system on that Bios Boot partition, and if so, which one?
 
Old 01-12-2022, 12:25 PM   #5
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,364

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
Quote:
Do I need to put a file system on that Bios Boot partition, and if so, which one?
NO, the bios-boot partition is the replacement for the 1mb space between the mbr and first partition that exists on a legacy drive, that doesn't exist on a gpt drive.

Quote:
To cut to the chase, grub thinks it's installed, but it doesn't see the disk as bootable when I press F10 on bootup.
Something to do with your bios/firmware, maybe this will help:
Code:
parted /dev/sdb disk_set pmbr_boot on
If doesn't help or make things worst set to off.
 
Old 01-13-2022, 08:02 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,363

Original Poster
Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
Ok the parted command did nothing, not making things worse or better.

A little thought unciurled itself in my head here. I have a duplicate (backup) system here on /dev/sdb. So I can run the grub command installed on /dev/sda; Or I can do a chroot and run the grub command installed on /dev/sdb; Or, I can also install from a live usb key which leads to endless combinations. But what is the kosher grub to run?

Does using the grub on sda mean that sda has to be referenced in the bootup process? The usual time you want an alternative is when you box won't boot. What I have been doing is the same as the live usb. I press F10 during bootup, to select an alternative boot device, and I don't see sdb there. I do see my rather blind sr0, but not my usb drive.

Last edited by business_kid; 01-13-2022 at 08:05 AM.
 
Old 01-13-2022, 08:16 AM   #7
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,785

Rep: Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435
You might enjoy rEFInd. It is human readable text with a LOT of syntax and usage comments in the config file and it doesn't care whether a disk is partitioned Legacy MBR or GPT or some are UEFI booted. The existing slackbuild at slackbuilds.org works whether you're on 14.2 or 15.0-RC2. It will find and try to boot any existing kernel it sees (unless you choose hide one or many) any elilo config, maybe more if you want to check. The documentation is very good.
 
1 members found this post helpful.
Old 01-13-2022, 09:19 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,363

Original Poster
Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
Quote:
Originally Posted by enorbet View Post
You might enjoy rEFInd. It is human readable text with a LOT of syntax and usage comments in the config file and it doesn't care whether a disk is partitioned Legacy MBR or GPT or some are UEFI booted. The existing slackbuild at slackbuilds.org works whether you're on 14.2 or 15.0-RC2. It will find and try to boot any existing kernel it sees (unless you choose hide one or many) any elilo config, maybe more if you want to check. The documentation is very good.
Thanks for the reply. What does rEFInd do? My fallback is that if I want to bother with a 550G copy (again), I can make a live usb out of the usb backup disk. But this struck me as a handy way of doing stuff without having to reset default settings for the Excited States every time I boot up, which I do find to be a pain in the derrière with the liveslak installs. BTW, liveslak is otherwise excellent.
 
Old 01-13-2022, 09:51 AM   #9
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,674

Rep: Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712
http://www.rodsbooks.com/refind/
It is an EFI boot manager. If you are not on an EFI/UEFI machine you do not need it.
Nice project though.
 
Old 01-13-2022, 10:13 AM   #10
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,363

Original Poster
Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
Well, I narrowed the options slightly.

I mounted sdb with all partitions correctly positioned, copied over the /dev/disk stuff, and did a chroot onto /dev/sdb. I mounted proc, checked /boot/grub/grub.cfg, and ran
Code:
grub-install /dev/sdb
That took about 30 seconds, threw up about 15 'node not found' errors, and told me it had completed, like everything was fine. It's still not a boot disk. Barring someone spotting my mistake, my next move is to use the 'iso2usb.sh' script on it, make a live system on sdb, and go forward from there. It may well mean copying 550G of data over again, but hell, what are disks for? It's a background copy anyhow.

Here's the bit of the 'iso2usb.sh' script, which looks an awful lot different from what I did. I already feel another 550G copy coming on
Code:
  # Use sgdisk to wipe and then setup the USB device:
  # - 1 MB BIOS boot partition
  # - 100 MB EFI system partition
  # - Let Slackware have the rest
  # - Make the Linux partition "legacy BIOS bootable"
  # Make sure that there is no MBR nor a partition table anymore:
  dd if=/dev/zero of=$TARGET bs=512 count=1 conv=notrunc

  # We have to use wipefs before sgdisk or else traces of an old 'cp' or 'dd'
  # of a Live ISO image to the device will not be erased.
  # The sgdisk wipe command is allowed to have non-zero exit code:
  wipefs -af $TARGET
  sgdisk -og $TARGET || true

  # After the wipe, get the value of the last usable sector:
  ENDSECT=$(sgdisk -E $TARGET)
The script gets fairly long-winded after that as he has user input to figure out. Here's his bit on setting up the disk
Code:
# Setup the disk partitions:
  sgdisk \
    -n 1:${LP1_START}:${LP1_END} -c 1:"BIOS Boot Partition" -t 1:ef02 \
    -n 2:${LP2_START}:${LP2_END} -c 2:"EFI System Partition" -t 2:ef00 \
    -n 3:${LP3_START}:${LP3_END} -c 3:"Slackware Linux" -t 3:8300 \
    $TARGET
  sgdisk -A 3:set:2 $TARGET
  # Show what we did to the USB stick:
  sgdisk -p -A 3:show $TARGET
As for what it does with grub - well, it doesn't. It uses the syslinux/etxlinux stuff.

I'd welcome ideas on this, but I'm backing off the priority a tad, as I have a cd/dvd rom --> 2.5" hd converter on it's way from our helpful friends at Ali Express, to make a slightly less chaotic setup here, and better use the unspectacular throughput this box posesses.

Last edited by business_kid; 01-13-2022 at 10:14 AM.
 
Old 01-13-2022, 10:27 AM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,363

Original Poster
Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
Quote:
Originally Posted by wpeckham View Post
http://www.rodsbooks.com/refind/
It is an EFI boot manager. If you are not on an EFI/UEFI machine you do not need it.
Nice project though.
I'm on a UEFI machine but using the Legacy option which requires partitioning sda with fdisk. If I use gdisk, the BIOS ignores set values and looks for EFI. where I will stand with an internal sdb formatted by gdisk is an unknown. My experience with UEFI on this box has been
Quote:
Abandon hope all ye who enter here.
Luckily, this laptop is not mission critical to anyone, and I do have the SaveMyA** liveslack usb disk to smooth things over if/when all else fails.
 
Old 01-13-2022, 11:36 AM   #12
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,364

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
Do you have grub installed in the mbr of sda and/or does sda boot with grub?
 
Old 01-13-2022, 12:11 PM   #13
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,363

Original Poster
Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
sda is mbr formatted, and sda1=/boot=ext4. I presume grub is in sda's mbr.

I feel another rejig of that new disk coming on, but who cares? I'm thinking all the /dev/disk/by-* symlinks probably broke when I copied them over. I might give that another go if I get energy.
 
Old 01-13-2022, 01:13 PM   #14
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,364

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
at sda grub boot menu press c for grub command line
Code:
grub>ls
See if grub sees the sdb drive. It should be listed as (hd1)

if it is make a /boot/grub/custom.cfg file on sda1 with this in
Code:
menuentry 'sdb chainload' {
set root=(hd1)
chainloader +1
}
reboot and see if grub will chainload sdb mbr/

Last edited by colorpurple21859; 01-13-2022 at 01:16 PM.
 
Old 01-13-2022, 04:08 PM   #15
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,785

Rep: Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435
My apologies if rEFInd doesn't help your case, business_kid. I may be projecting my own confusion with Grub on multi disk, multi partitioned systems. I had a terrible time just trying to use Grub CLI to try to discover exactly what it could "see" and then how to correctly handle the arcane syntax to properly boot them/it. rEFInd made it vastly simpler for me as I have 4 drives, 2 SSDs and 2 HDDs, with some partitioned GPT and others MBR. rEFInd made that relatively simple for me, simple enough I can see just EFI bootables if I disable CSM Legacy. or all of them if I enable CSM. It might not be what you need but it's a thought possibly worth looking into.
 
3 members found this post helpful.
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slic3r hiccough business_kid Linux - Software 7 01-12-2021 07:24 AM
Calibre Hiccough - basic error. business_kid Linux - Software 1 12-21-2013 04:59 AM
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
[SOLVED] grub hiccough business_kid Slackware 5 01-05-2011 03:11 PM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM

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

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