Grub2.06 Upgrade for KLs

Moderator: Forum moderators

Post Reply
JusGellin
Posts: 802
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 103 times
Been thanked: 105 times

Grub2.06 Upgrade for KLs

Post by JusGellin »

Is there an upgrade for KLV and KLA to get Grub2.06?

I've noticed problems with Grub2.03 when using USB Thumb drives that have that version.
The thumb drive will boot instead of the internal drive on the KL pc if it is using Grub2.03.
Even if the internal drive is selected first to boot.

Using a Grub2.06 upgrade for BookwormPup on a pc resolved that for it.

Thanks

User avatar
wiak
Posts: 4296
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 70 times
Been thanked: 1284 times
Contact:

Re: Grub2.06 Upgrade for KLs

Post by wiak »

JusGellin wrote: Tue Oct 29, 2024 2:38 pm

Is there an upgrade for KLV and KLA to get Grub2.06?

I've noticed problems with Grub2.03 when using USB Thumb drives that have that version.
The thumb drive will boot instead of the internal drive on the KL pc if it is using Grub2.03.
Even if the internal drive is selected first to boot.

Using a Grub2.06 upgrade for BookwormPup on a pc resolved that for it.

Thanks

I'm curious about the above effect. If the grub stanza is using uuid or label I can't see how wrong device install gets booted. Or are you talking about an iso boot of some kind, such as via Ventoy, which could have an effect like that, but tor different reason?

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
rockedge
Site Admin
Posts: 6934
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 3058 times
Been thanked: 2874 times
Contact:

Re: Grub2.06 Upgrade for KLs

Post by rockedge »

@JusGellin @wiak There is an upgrade to the KLV xbps package for Grub2config which is version 2.0.8 from @Sofiya

I will be back in an hour and 30 minutes or so and I can have it ready to download or find it on this forum in the mean time.

You will need to create a symlink from /usr/sbin/grub2config to /usr/bin after installing this package.

in a terminal:

Code: Select all

grub2config -v
JusGellin
Posts: 802
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 103 times
Been thanked: 105 times

Re: Grub2.06 Upgrade for KLs

Post by JusGellin »

wiak wrote: Tue Oct 29, 2024 4:12 pm

I'm curious about the above effect. If the grub stanza is using uuid or label I can't see how wrong device install gets booted. Or are you talking about an iso boot of some kind, such as via Ventoy, which could have an effect like that, but tor different reason?

No, I'm using a usb stick with a frugal install of fossapup64_9.6 with grub2.03 and using UUID in its grub.cfg.

The laptop is set to boot on the internal drive first.
It is using KLV-vmHost-rc4 with grub2.03 and using UUID in grub.cfg

When I boot the laptop with the above usb stick, it automatically boots to the usb instead.

If I instead, plug my usb stick in with frugal install of BookwormPup64_10.0.7 and upgraded grub2.06 also using UUID in grub.cfg
and then boot the laptop, it automatically boots the internal drive with the KLV install like it should.

It seems like this did the same when I had Bookworm installed on the laptop and was fixed when upgraded the internal drive to grub2.06.

Thanks

JusGellin
Posts: 802
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 103 times
Been thanked: 105 times

Re: Grub2.06 Upgrade for KLs

Post by JusGellin »

I had a version of grub2.06 update that came from viewtopic.php?p=131997#p131997

Re: "Secure Boot" for Puppy Linux - updated
Post by gyrog » Sun Sep 29, 2024 7:01 am

I don't think this was the latest one @gyrog released, but tried it on my laptop with KLV-VMHost-rc4 install system on it.
The file I used is called grub2.tar.gz
It updates the efi partition by running :

Code: Select all

tar xf grub2.dar.gz --overwrite -C /mnt/sda1

Now my laptop comes up using grub2.06 version.
It makes the main system boot normally even if a bootable usb with an older version (grub2.03) like I used above is attached on boot.
The main internal drive boots like expected.

I just didn't know if this would work for KLV since the topic I got this from was for puppy linux. But it does.

I'm always wondering - is this the right way to do this? It seems to work.
But sometimes some of you help me understand things about it that I didn't know about.
I don't know if all puppys and KLs need to have this added to their isos or not - just my thinking.

It just bothered me that a bootable frugal puppy usb could be attached to a computer(with grub2.03) and even if the computer was
set to boot the internal drive first, it would boot the usb instead. At least that happened to me on 3 different model laptops I have.

This seems to fix the messy thing I've seen when attaching a bootable puppy usb to a laptop on boot.

Thanks

User avatar
rcrsn51
Posts: 1429
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 393 times

Re: Grub2.06 Upgrade for KLs

Post by rcrsn51 »

Here is what I suspect is happening. Some early versions of uefi-grub2 had an annoying function. The machine's UEFI firmware would correctly choose the selected drive and load the grubxxx.efi from its EFI System Partition. GRUB would then need to locate its grub.cfg file. But instead of taking the one from its own partition, it would start searching. Depending on how the UEFI firmware had enumerated the drives, it might find the wrong one first. So it would appear that the machine had booted off the wrong drive because it was using that drive's grub.cfg.

You could test this by temporarily renaming some of the grub.cfg files to prevent them from being detected.

JusGellin
Posts: 802
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 103 times
Been thanked: 105 times

Re: Grub2.06 Upgrade for KLs

Post by JusGellin »

@rcrsn51
I did some interesting tests.

For the first condition, I left the laptop at grub2.03 and allowed it to boot automatically each time:
1. Used a thumbdrive that was formated to ext4 with some files and not bootable.
2. As long as the laptop would select the UUID in its grub.cfg, it would boot without any problem as expected.
But if the partition was selected by partition name, in the grub.cfg, it couldn't boot.

3. If a usb drive had a bootable puppy linux with grub2.03, the laptop would boot into the thumbdrive instead.
4. If a usb drive had a bootable puppy linux with grub2.06, the laptop would boot ok like it should.

So the worst thing it failed was #3 if a usb containing a bootable usb with grub2.03 and the laptop also grub2.03

For the second condition I updated the laptop from grub2.03 to grub2.06.
1. Used a thumbdrive that was formated to ext4 with some files and not bootable.
2. As long as the laptop would select the UUID in its grub.cfg, it would boot without any problem as also expected.
But if the partition was selected by partition name, in the grub.cfg, sometimes it would boot properly but other times it couldn't boot.

3. If a usb drive had a bootable puppy linux with grub2.03, the laptop would boot ok like it should.
4. If a usb drive had a bootable puppy linux with grub2.06, the laptop would boot ok like it should.

So it booted properly even if the usb had a puppy linux grub2.03 or grub 2.06.
Also it definately proves that the laptop or any device needs to use UUID in its grub.cfg.

I'm planning on always upgrading my grub to version 2.06.

Thanks

User avatar
rcrsn51
Posts: 1429
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 393 times

Re: Grub2.06 Upgrade for KLs

Post by rcrsn51 »

JusGellin wrote: Wed Oct 30, 2024 7:42 pm

3. If a usb drive had a bootable puppy linux with grub2.03, the laptop would boot into the thumbdrive instead.

Rename the grub.cfg on the usb drive to grub.cfg.save and reboot. Will it now boot off the internal drive?

JusGellin
Posts: 802
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 103 times
Been thanked: 105 times

Re: Grub2.06 Upgrade for KLs

Post by JusGellin »

rcrsn51 wrote: Wed Oct 30, 2024 7:56 pm
JusGellin wrote: Wed Oct 30, 2024 7:42 pm

3. If a usb drive had a bootable puppy linux with grub2.03, the laptop would boot into the thumbdrive instead.

Rename the grub.cfg on the usb drive to grub.cfg.save and reboot. Will it now boot off the internal drive?

It boots fine. I know that.
Did you mean for the first condition when the laptop is using grub2.03? That's what I tried.

williwaw
Posts: 2121
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 194 times
Been thanked: 405 times

Re: Grub2.06 Upgrade for KLs

Post by williwaw »

rcrsn51 wrote: Wed Oct 30, 2024 5:50 pm

Here is what I suspect is happening. Some early versions of uefi-grub2 had an annoying function. The machine's UEFI firmware would correctly choose the selected drive and load the grubxxx.efi from its EFI System Partition. GRUB would then need to locate its grub.cfg file. But instead of taking the one from its own partition, it would start searching. Depending on how the UEFI firmware had enumerated the drives, it might find the wrong one first. So it would appear that the machine had booted off the wrong drive because it was using that drive's grub.cfg.

You could test this by temporarily renaming some of the grub.cfg files to prevent them from being detected.

is there a parameter for the search command that could be used to point directly to the desired grub.cfg?

@JusGellin

how many machines present the undesirable behavior?

JusGellin
Posts: 802
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 103 times
Been thanked: 105 times

Re: Grub2.06 Upgrade for KLs

Post by JusGellin »

williwaw wrote: Wed Oct 30, 2024 9:25 pm

@JusGellin

how many machines present the undesirable behavior?

I have 3 laptops - Dell, HP and a unique Lenovo that has a 32 bit efi and 64 bit system.
I'll go back to try the others. Is there anything I should do differently or should I just do the same with them?

Thanks

williwaw
Posts: 2121
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 194 times
Been thanked: 405 times

Re: Grub2.06 Upgrade for KLs

Post by williwaw »

JusGellin wrote: Wed Oct 30, 2024 10:25 pm
williwaw wrote: Wed Oct 30, 2024 9:25 pm

@JusGellin

how many machines present the undesirable behavior?

I have 3 laptops - Dell, HP and a unique Lenovo that has a 32 bit efi and 64 bit system.
I'll go back to try the others. Is there anything I should do differently or should I just do the same with them?

Thanks

I have older machines that do not do EFI well, early versions of EFI.

If the undesirable behavior is limited to a certian machine, then fixing grub might not be the easiest way foreward, especially if it can
boot mbr or boot with a manual selection of boot the disk

JusGellin
Posts: 802
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 103 times
Been thanked: 105 times

Re: Grub2.06 Upgrade for KLs

Post by JusGellin »

@williwaw
I just finished checking with my Dell laptop and it does the same as the HP laptop.
Updating their grub.cfg from 2.03 to 2.06 allows them to boot normally from the internal drive that is selected first from their bios.

Both of these can select internal drive or usb for boot up.
They both can set to boot using bios. I have that disabled.

My Lenovo only has efi boot. I haven't rechecked this one yet, but I want to verify how it does as well.
I tested this before and it also did the same thing.
But that's been a while back. I want to recheck it again.

Thanks

williwaw
Posts: 2121
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 194 times
Been thanked: 405 times

Re: Grub2.06 Upgrade for KLs

Post by williwaw »

JusGellin wrote: Wed Oct 30, 2024 11:45 pm

My Lenovo only has efi boot.

how new is the machine?

JusGellin
Posts: 802
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 103 times
Been thanked: 105 times

Re: Grub2.06 Upgrade for KLs

Post by JusGellin »

@williwaw
I got it 2016.
It's a Lenovo Ideapad 100S11IBY
I only bought it thinking I could use Linux on it. It was a struggle to make it work so I gave up on it until this year.

When I became active on this site @gyrog helped me to get BookwormPup to work on it.
He has one too and was wanting to get the internal drive to work exclusively with this. After a lot of work,
he finally helped me to get it working.
It has a 32 bit efi and 64 bit system.

JusGellin
Posts: 802
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 103 times
Been thanked: 105 times

Re: Grub2.06 Upgrade for KLs

Post by JusGellin »

@williwaw
I completed testing all my different model laptops for the effects that the grub version play on the usb. All three of my laptops work the same.

First of all it probably isn't a really big deal.
I see often times when a new person has problems booting a computer, the most advice they are given is to first make sure
no usb drives are plugged in. - that works.

But it's good for at least a new person like myself to understand what happens if a thumb drive is plugged in when a computer is booted.
Plus I can see how this can be fixed to not have puzzling problems come up.

These are the conclusions I've drawn for my understanding what effects grub2.03 on the computer may have when a usb thumb drive is plugged in.
1. This doesn't have anything to do with the version of grub on the computer, but if the computer isn't using the UUID in its
grub.cfg stanza properly, it will cause problems, like not booting or even booting a usb frugal puppy linux. Care should always be taken
to make sure the computer's boot up is looking at the UUID not the partition name.

2. This is the wild one. If a bootable usb puppy linux that is also using grub2.03 on any of my 3 laptops, and the computer is booted, even if
the order of boot is set for the internal drive to be first, the usb will be booted up instead. I've been caught with this happening when I want
to boot the computer and can't because I have the thumb drive plugged in. Sure, just disconnect the usb drive. But to me that just doesn't
seem right that this can happen. Most everybody has control of their own computers and don't have to worry that someone else will
plug a thumb drive into their computer to take control over it. But it can happen even if rarely. -- and who would know this could happen?

3. Another peculiar thing can happen if the thumb drive is bootable and is using grub2.06. Even if the computer is grub2.03, it will boot
properly. That's interesting.

So #1 is solved like we know how to do the UUID in the grub.cfg file.
#2 can be fixed if the computer has its grub.2.03 upgraded to grub2.06. (see Topic: grub2 version 2.06 viewtopic.php?t=10028 for updating GRUB.)
#3 is just interesting to know.

I hope this might be useful to some.

Thanks

Post Reply

Return to “How-To”