LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   antiX / MX Linux (https://www.linuxquestions.org/questions/antix-mx-linux-127/)
-   -   Removing obsolete, unwanted grub items ... how? (https://www.linuxquestions.org/questions/antix-mx-linux-127/removing-obsolete-unwanted-grub-items-how-4175685198/)

LinWinux 11-14-2020 04:30 AM

Removing obsolete, unwanted grub items ... how?
 
Hi everyone.
Well, the grub configuration seems to have changed a lot during the past 5+ years ...
Utilizing MX Linux which has been updated & upgraded multiple times now, I can no longer figure out precisely where I can go in order to remove obsolete entries. There seem to be several locations with grub related files. Currently I have 8 entries for the previous 4 kernels. I would like to simply remove the oldest two entries, since it annoys me to have the startup screen cluttered with things that I don't want to see.

Perhaps an automated process, to delete older kernel entries automatically?
Any helpful thoughts would be appreciated. Thanks.

hazel 11-14-2020 04:38 AM

The best way to modify GRUB is to use the update-grub script. First uninstall the kernels you don't want. Check them in synaptic and you'll probably find them listed as autoremovable. Then run update-grub.

LinWinux 11-14-2020 05:32 AM

Thank you for that fast response. I'm not familiar with an update-grub script. Where do I find this?

hazel 11-14-2020 05:37 AM

Just open a terminal and type sudo update-grub.

LinWinux 11-14-2020 05:48 AM

Sorry, I thought you meant some different script somewhere.
Utilizing sudo update-grub doesn't change anything on the startup (grub) screen.
And when I use the MX Tools Grub Menu, I can't remove any grub entries from there.
I think there is or used to be a grub-customizer tool that I'd used in the past. Don't have it now though.

captain_sensible 11-14-2020 06:05 AM

is that a UEFI PC ?

i never did fully understand uefi, efi partition but if i run
# efibootmgr

i see entries like:

bash-5.0# efibootmgr
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0003,0000,9999
Boot0000* Slackware HD(1,GPT,192a9aa1-9848-4329-8171-9253ffc0f920,0x800,0x32

The laptop was originally Windows 10; i installed Slackware but i noticed when running efibootmgr entry for Windows was still there, even though it was wiped when i installed slackware. I did remove that using
efibootmgr. The entries should be listed somethting like:


Boot0001

..
Boot005

etc you use those to delete , something like:


# efibootmgr -B Boot005

LinWinux 11-14-2020 06:22 AM

Thanks, but that's not what I'm looking for.
I just utilized the grub-customizer tool, followed by saving the new configuration.
Then installed the saved configuration into the master boot record ... but oddly no changes occurred during a reboot.
During system start, right now the screen still displays the same eight grub / kernel entries.

What I'm looking for is the actual grub.cnfg script or whatever it's called these days, which contains all the entries that show up during boot. In the past this used to be a single file with a single backup file. But now the grub menu has been split into several files which are combined ??? during the boot process. I just want those obsolete entries that I'm never going to use ... to go away ... visually.
I don't care if the kernels still exist on the system, I just don't want to see the entries ... :(

captain_sensible 11-14-2020 06:54 AM

might be an idea to confirm which grub using:

grub-install --version


mine is:
grub-install (GRUB) 2.04
bash-5.0#

LinWinux 11-14-2020 07:06 AM

Well, utilizing version, terminal shows me ...

grub-install (GRUB) 2.02~beta3-5deb9u2

I don't see how that can help me any further. I don't understand why I can't locate a single file to edit anymore. Even looking at this link was was the closest that I could find for what I'm looking to do, the grub folder names & file locations in the link don't match up what I have ... even though it's based on Debian as is MX Linux ... ??? https://olinux.net/change-grub-boot-order-linux/

hazel 11-14-2020 07:20 AM

Quote:

Originally Posted by LinWinux (Post 6185156)
I don't understand why I can't locate a single file to edit anymore.

The reason why is that they have made GRUB2 insanely complicated compared with the original GRUB (now called grub-legacy). That's why I really hate it. The way it works now is something like this:

1) When GRUB runs, it creates its menu from /boot/grub.d/grub.cfg, which is a actually a script written in the GRUB shell language.
2) The grub.cfg file is created by grub-mkconfig, which is conveniently wrapped up as update-grub. These are both ordinary shell scripts.
3) grub-mkconfig uses information in a set of files in /etc/default/grub. At least, that's how it's done in the Debian family.

Did you actually uninstall the kernels you don't want any more before running update-grub? If you did and that didn't work, then I think you will need to look at the files in /etc/default/grub, find the one that contains the unwanted kernels and edit them out. Good luck with that!

I don't think you need to bother about efibootmgr. That's a red herring in your case. The uefi (if you have one) is booting GRUB correctly; it's GRUB that's misbehaving.

LinWinux 11-14-2020 07:49 AM

I agree, this is complete insanity. Who the heck over thought of this madness ???
Looking at your recommended path/file of ... /etc/default/grub ... doesn't yield the required information either. Same as a few others that I found, at the top of the file it just says ... if you make changes to this file, yada yada yada.
This is truly maddening, and one would think that these entries would be easier to adjust. Anyone who plays around with their own grub configuration obviously knows that they're doing so at their own risk, so why make such a minor adjustment intentionally more difficult and more confusing?

You're right, the laptop that I'm working with doesn't have a UEFI boot.

No, I didn't actually uninstall the kernels because when I looked at the kernels in the MX package manager ... Kernels ... there were only 5 items listed. Two of them with Antix, one Debian, one Liceurix (or something like that) and one Kernel file for the 4.19 Kernel that I'm currently on. Stable Repository shows me a list of "gazillion" image/kernel files, none of which are greyed out which would indicate to me that any of them are installed. And when I look for Kernels within Debian Backports, there are still a (fewer) number of Kernel related files, also none of which are greyed out to indicate that any of them have been installed.

I have never used boot repair tool or any other grub repair method on this system. To my knowledge it's pretty much all stock, with updates & dist-upgrades during the past 2 to 3 years.

colorpurple21859 11-14-2020 08:29 AM

If you don't want to keep the older kernels, remove them. There are several how-to's of different ways to do this on the net.

captain_sensible 11-14-2020 09:23 AM

@hazel
Quote:

insanely complicated
true this might help some: https://www.dedoimedo.com/computers/grub-2.html

LinWinux 11-14-2020 09:45 AM

Quote:

Originally Posted by colorpurple21859 (Post 6185175)
If you don't want to keep the older kernels, remove them. There are several how-to's of different ways to do this on the net.

As so often in the past, your comments are of no help whatsoever. I've been looking Online for hours and can't find anything which would resolve the excessive grub entries. Really, I wish you would just stay away from my posts. Every time that you comment, it's without any useful information whatsoever. Someone who responds with comments designed to pad their stats. Ridiculous. Do you really believe that I don't know how to use the internet or how to look for solutions there? Going to a forum is always my *LAST* stop, only after I couldn't find the correct solution on my own.

@hazel
@captain_sensible
My apologies, but I have seen this the above users comments literally hundreds of times on this forum already, where instead of help there's nothing but a blank or criticism. It's ridiculous, as if there's nothing better to do than to leave useless remarks (see my signature too).

Anyway, I'm afraid that I'll have to give up on this for now. As I've already explained previously, I can't find the older installed kernels within Synaptic, MX Packager Manager Stable, or MX Package Manager Debian Backports. So if I can't find something, then obviously I can't delete it either.

As far as grub is concerned, I found grub, grub config, and grub backup files in no less than 4 different locations. Altogether within their folders/sub-folders probably a dozen of them. But I can't find a single file that would account for the eight kernel entries that I'm seeing upon startup. I'll be checking out the dedoimedo link sometime in the next few days.

Last but not least, I also installed/re-installed everything grub and grub-customizer related. Nothing that I tried made any difference. Grub customizer displays the correct grub menu as it should appear during startup, but for some reason that's not what I get on the screen. No matter what I try with the grub-customizer as a last resort, even though changes take place without errors as they're applied, those same changes do not remain present when the machine is started up again.

On a positive note ... no matter what I edited, re-installed, or -reconfigured, the system didn't get borked. At least that's something. ;)

hazel 11-14-2020 10:29 AM

I wonder, did you ever install any kernels by hand? For example, you say you have a liquorix kernel. They certainly aren't standard, though I remember them being very fashionable a few years ago. Anything that gets installed independently of the apt system can't be uninstalled by the apt system.

Also you shouldn't have such a lot of grub files, only the ones in the two directories I mentioned and the original installation files which are in the lib tree somewhere.

I can't help you with grub-customiser. I never heard of that before.


All times are GMT -5. The time now is 06:24 PM.