Update in another distro removed Mint listing from grub

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Update in another distro removed Mint listing from grub

Post by arvy »

2bytes wrote:
Sat Aug 01, 2020 6:02 pm
I am curious what you will find. Here are the outputs to the three commands in bold.
Thought you were going to take a break. :D

Anyhow, I need one myself. So haven't looked at it in depth. However, this line may be quite significant:

Code: Select all

Partition: ID-1: / size: 41.00 GiB used: 17.21 GiB (42.0%) fs: ext4 dev: /dev/sda10
That says that the root / partition of the set-up to which you have actually booted is an installation on the /dev/sda10 ext4 partition. Furthermore, there is only one single "ubuntu" entry in the efibootmgr output, and so no room for any doubt or confusion there. At a glance, despite your having installed Kubuntu twice, it doesn't look to me as if anything more than just one single Kubuntu set-up currently exists, and it's on an ext4 partition, not on some other btrfs partition. So when you said that you "still have" the ext4 installation, you were right. In fact, it appears to be the only current Kubuntu installation.

Now, I'm taking a few hours "off duty". Maybe someone else will contribute some brilliant "quick fix" in the meantime.

__
P.S.: Thanks very much for your help, MrEen
Last edited by arvy on Sat Aug 01, 2020 10:17 pm, edited 2 times in total.
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
2bytes
Level 1
Level 1
Posts: 16
Joined: Thu Jul 30, 2020 10:15 pm

Re: Update in another distro removed Mint listing from grub

Post by 2bytes »

Kubuntu's software "Discover" told me about an update to about seven grub files. I downloaded, installed, and rebooted. Now I believe my working Kubuntu ext4 partition is "in charge" of my Grub. It is now at the very top of the list. That is better news, because it was Ubuntu in charge, but I could not get past its login screen.

No btrfs partitions are showing up in Grub. I am wondering still if there is a way to get SDA11 Mint going again by somehow redoing its grub and putting it in charge like it has been mostly for the past two weeks. If I could get it going, I could delete everything else except for Windows. Is btrfs still considered to be experimental and somewhat risky? I didn't think so, but I had heard its Timeshift feature might still have a few bugs.
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Update in another distro removed Mint listing from grub

Post by arvy »

Okay, back at it. Was just updating my last reply when you posted yours. Having looked again at your most recently posted details, I can see nothing that would account for the failure of a sudo update-grub command to add into your currently active Grub boot configuration in /boot/grub/grub.cfg any reasonably formulated menu entry (even if non-functional) that was properly inserted into your /etc/grub.d/40_custom script file. Nor do I see anything that would account for any such menu entry update not showing up on the next reboot with all the others in the currently active Grub boot configuration.

So, here's what I'd like you to do in your next reply. Please attach a copy (not a partial transcript or narrative inclusion, but an actual copy) of your /etc/grub.d/40_custom script file as you have edited it to include the new menu item. Also, after running the sudo update-grub command, please copy/paste into your reply an extract of the ==begin 40_custom== to ==end 40_custom== section from your /boot/grub/grub.cfg file. The latter between [code][/code] tags as MrEen has explained above please.

__
P.S. If, as I took your last response to indicate, you want to pursue this issue logically, PLEASE make no further changes to the set-up until we've dealt with it under the one set of reasonably stable and mutually understood conditions. I can't keep up with various random alterations to continue helping you.
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
2bytes
Level 1
Level 1
Posts: 16
Joined: Thu Jul 30, 2020 10:15 pm

Re: Update in another distro removed Mint listing from grub

Post by 2bytes »

From /media/paul/ea48459b-6d06-42d4-9e89-f8a58880be4c/@/etc/grub.d/40_custom:

Code: Select all

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry 'Linux Mint on rootMint' --class linuxmint --class gnu-linux --class gnu --class os {
	insmod part_gpt
	insmod ext2
	insmod btrfs
	search --no-floppy --set=root --label rootMint
	configfile /boot/grub/grub.cfg
}
From the /boot/grub/boot.cfg file on the Kubuntu ext4 partition

Code: Select all

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
2bytes
Level 1
Level 1
Posts: 16
Joined: Thu Jul 30, 2020 10:15 pm

Re: Update in another distro removed Mint listing from grub

Post by 2bytes »

I didn't include this readout:

Code: Select all

paul@paul-HP-Laptop-15-db0xxx:~$ sudo update-grub
[sudo] password for paul: 
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-42-generic
Found initrd image: /boot/initrd.img-5.4.0-42-generic
Found linux image: /boot/vmlinuz-5.4.0-40-generic
Found initrd image: /boot/initrd.img-5.4.0-40-generic
Found linux image: /boot/vmlinuz-5.4.0-39-generic
Found initrd image: /boot/initrd.img-5.4.0-39-generic
Found linux image: /boot/vmlinuz-5.4.0-29-generic
Found initrd image: /boot/initrd.img-5.4.0-29-generic
Found Windows Boot Manager on /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi
Found Ubuntu 20.04.1 LTS (20.04) on /dev/sda6
Adding boot menu entry for UEFI Firmware Settings
done
paul@paul-HP-Laptop-15-db0xxx:~$ ^C
paul@paul-HP-Laptop-15-db0xxx:~$ 
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Update in another distro removed Mint listing from grub

Post by arvy »

2bytes wrote:
Sun Aug 02, 2020 1:32 am
From /media/paul/ea48459b-6d06-42d4-9e89-f8a58880be4c/@/etc/grub.d/40_custom:
That's not a copy of the /etc/grub.d/40_custom script file for the currently booted Kubuntu installation on /dev/sda10. (Or is it now /dev/sda6? I can't keep up with all of your complicating factors.) Anyhow, that's actually taken from a file that has been mounted from the Mint installation on /dev/sda11. So, of course, that won't work for updating the Kubuntu Grub configuration that is currently active and in control of system booting.

Sheesh. I never thought that what should have been a very straightforward copy and paste operation with some minor editing could be turned into such a confused and confusing situation, but I'm learning. Try again, if you want to. Or not. It's up to you. I think I've just about exhausted my supply of patience with it. Good luck with whatever you decide to do.
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
2bytes
Level 1
Level 1
Posts: 16
Joined: Thu Jul 30, 2020 10:15 pm

Re: Update in another distro removed Mint listing from grub

Post by 2bytes »

I pasted the following into the Kubuntu ext10 40_custom file:

Code: Select all

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry 'Linux Mint on rootMint' --class linuxmint --class gnu-linux --class gnu --class os {
	insmod part_gpt
	insmod ext2
	insmod btrfs
	search --no-floppy --set=root --label rootMint
	configfile /boot/grub/grub.cfg
}

I ran in terminal sudo update-grub. Terminal did not show any new changes.

I checked the Kubuntu's grub.cfg file at /boot/grub/grub.cfg.

There is a change there. It now reads:

Code: Select all

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry 'Linux Mint on rootMint' --class linuxmint --class gnu-linux --class gnu --class os {
	insmod part_gpt
	insmod ext2
	insmod btrfs
	search --no-floppy --set=root --label rootMint
	configfile /boot/grub/grub.cfg
}
### END /etc/grub.d/40_custom ###
I rebooted. SDA11 or Mint was still not recognized, but as you said sda11 does have the 40_custom file that I edited. That was not the 40_custom file that you wanted me to edit. It still has that information and I did not take it out. However, I would if this will change things.

So, I thought that Kubuntu became in charge of everything. The only other linux partition showing up in Grub, plain Ubuntu 20.04, does not let me log in either in the regular boot or recovery modes.
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Update in another distro removed Mint listing from grub

Post by arvy »

IF you have now succeeded in getting the "Linux Mint on rootMint" item into the active Grub boot menu, and IF selecting that boot menu option fails to find and launch your Mint installation, it is most likely because you still haven't applied the "rootMint" label to the Mint installation's root / partition (/dev/sda11).
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
2bytes
Level 1
Level 1
Posts: 16
Joined: Thu Jul 30, 2020 10:15 pm

Re: Update in another distro removed Mint listing from grub

Post by 2bytes »

I do not have any sda listings at /media/paul/ea48459b-6d06-42d4-9e89-f8a58880be4c/@/dev/ or I am looking in the wrong place. I do not see the word "partitions" either. I got to go into the city. I will be gone for a while. Thanks.
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Update in another distro removed Mint listing from grub

Post by arvy »

I gave you this link yesterday to an article that explains all about partition labelling and how to do it for ext2/3/4 partitions. And here is the complete btrfs filesystem manual which includes the label [<device>|<mountpoint>] [<newlabel>] subcommand. In your case:

Code: Select all

sudo btrfs filesystem label /dev/sda11 rootMint
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
linux-rox
Level 4
Level 4
Posts: 395
Joined: Sun Jul 19, 2020 9:17 pm

Re: Update in another distro removed Mint listing from grub

Post by linux-rox »

Out of curiosity, I installed a Mint 20 (Mate) to btrfs on a multi-boot USB drive, mainly to see how it interacts with ext4. What I found was that Mint-btrfs had no trouble finding the ext4 installs, and was able to boot into the original lead OS (Ubuntu) from Mint-btrfs' Grub menu, but Ubuntu-ext4 did not see Mint-btrfs. Did not show up, for example, when running sudo os-prober. Checking with GParted (still in Ubuntu-ext4), got a warning that it needs btrfs-progs and btrfs-tools to work. Only the former available; latter returns error, "has no installation candidtate." Installing btrfs-progs eliminated the GParted warning, and made it possible to label the Mint-btrfs partition, but os-prober in Ubuntu-ext4 still fails to recognize Mint-btrfs as an OS. Restored primary Grub to Ubuntu, added Mint-btrfs to its custom.cfg file (effectively the same thing, Paul, as a 40_custom file), and rebooted. No go. Try again, using UUID instead of label. Still no go. Might be my error, of course, but don't think so. Rather, I suspect btrfs requires a parameter of which I'm unaware.

Passing along, simply FWIW. Frankly, Paul, I don't think btrfs is worth the hassle, but that's your decision.
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Update in another distro removed Mint listing from grub

Post by arvy »

linux-rox wrote:
Sun Aug 02, 2020 4:08 pm
I don't think btrfs is worth the hassle
I would certainly concur with that unless there is some very specific and carefully considered reason for choosing it. Actually, as i said at the outset, I know very little about the btrfs filesystem myself. I've probably learned more about it trying to help this OP that I wanted to know. :lol:
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
linux-rox
Level 4
Level 4
Posts: 395
Joined: Sun Jul 19, 2020 9:17 pm

Re: Update in another distro removed Mint listing from grub

Post by linux-rox »

Well, figured out the configfile issue, at least. This works in custom.cfg. Should work also in 40_custom:

Code: Select all

menuentry "Mate 20 (btrfs)" {
    insmod gpt
    insmod btrfs
    search --no-floppy --label --set=root Mate20-btrfs
    configfile /@/boot/grub/grub.cfg
}
Notice the non-standard location for grub.cfg. Of which speaking, this is what the menuentry looks like in grub.cfg.

Code: Select all

menuentry 'Linux Mint 20 MATE' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-ac0ef507-92af-40e8-b27f-4e132d294db0' {
	recordfail
	load_video
	gfxmode $linux_gfx_mode
	insmod gzio
	if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
	insmod part_gpt
	insmod btrfs
	set root='hd1,gpt24'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt24 --hint-efi=hd1,gpt24 --hint-baremetal=ahci1,gpt24  ac0ef507-92af-40e8-b27f-4e132d294db0
	else
	  search --no-floppy --fs-uuid --set=root ac0ef507-92af-40e8-b27f-4e132d294db0
	fi
	linux	/@/boot/vmlinuz-5.4.0-26-generic root=UUID=ac0ef507-92af-40e8-b27f-4e132d294db0 ro rootflags=subvol=@  quiet splash 
	initrd	/@/boot/initrd.img-5.4.0-26-generic
}
Mentions a few other modules (gzio, xzio and lzopio), but they don't seem to be needed (boots fine without 'em).

As for the os-prober problem, apparently it's a known issue. A quick search turns up this workaround. Might be others.

One thing I did notice, yeah, the advantage in Timeshift is dramatic. Baseline snapshot took about three seconds.
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Update in another distro removed Mint listing from grub

Post by arvy »

Great sleuthing. Good to know for future reference even if the OP decides not to bother with it.
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
linux-rox
Level 4
Level 4
Posts: 395
Joined: Sun Jul 19, 2020 9:17 pm

Re: Update in another distro removed Mint listing from grub

Post by linux-rox »

Thanks. To close the circle, I've now had a chance to confirm the workaround. Yup, it works. os-prober finds the btrfs system and the resulting Grub entry (after running update-grub) boots into it. Tested with the custom.cfg file disabled (renamed), of course. Notice the symlinks are created on the btrfs system, not the system in charge of Grub. One thing not mentioned. sudo is needed to create the links, as they're outside the user's home folder. So, there are two solutions (counting 40_custom and custom.cfg as one). Both work.
User avatar
arvy
Level 6
Level 6
Posts: 1230
Joined: Sat Mar 26, 2016 11:22 am

Re: Update in another distro removed Mint listing from grub

Post by arvy »

Here's a custom.cfg (or 40_custom) item for whoever may want it that should handle both ext2/3/4 and btrfs filesystems using either a partition label or a UUID for the Grub search and should also handle most cases where a separate /boot partition has been created:

Code: Select all

#reset insmod part_gpt to part_msdos as required
#reset insmod ext2 to btrfs as required
#partuuid overrides partlabel if set
menuentry 'Linux Mint on rootMint' {
	insmod part_gpt
	insmod ext2
	set partlabel=rootMint
	set partuuid=
	if [ -n "${partuuid}" ]; then
		search --no-floppy --set=root --fs-uuid $partuuid
	else
		search --no-floppy --set=root --label $partlabel
	fi
	if [ -s /@/boot/grub/grub.cfg ]; then
	    configfile /@/boot/grub/grub.cfg
	elif [ -s /grub/grub.cfg ]; then
	    configfile /grub/grub.cfg
	else
	    configfile /boot/grub/grub.cfg
	fi
}
System: Asus ROG Maximus XI Code mobo, Intel i9-9900K CPU, Nvidia GTX1080 GPU, 32 GB DDR4-3600 RAM, Sumsung Pro 2x512GB NVMe & 3x1TB SSD, Multiboot
2bytes
Level 1
Level 1
Posts: 16
Joined: Thu Jul 30, 2020 10:15 pm

Re: Update in another distro removed Mint listing from grub

Post by 2bytes »

Hi,

Wow, two different solutions. Thank you. I need to digest this to figure out how to proceed. It may be wiser for me to just stay with ext4, delete all btrfs partitions, and start over again with a new fresh installation of ext4 Cinnamon Mint. However, you put out a lot of work and that would close the loop if I were to try one of your suggestions.

I was not interested in btrfs until Ubuntu 20.04 touted Timeshift as a major feature of its new LTS btrfs install. Timeshift has been mentioned a few times in reviews of the new Ubuntu distribution. I did not really understand how I could be the only one not being able to find my btrfs partitions. There must be several people by now who have had the same problem. It looked like the last time people wrote to forums in Ubuntu about losing a btrfs partition listed in grub was back in 2012. So I figured that my problems were caused by something that I did in error, a problem with Windows secure boot or failing hardware in my laptop.

I am really surprised that this new LTS requires a editing patch or two to get the btrfs to be found. Won't most people trying out Timeshift be coming from ext2/3/4 systems in the first place and get stuck like me losing their work installing btrfs systems? I did not see that recent earlier versions of Ubuntu based systems had this problem. Will this be fixed soon in a future update? I lost two btrfs partitions and it was driving me crazy.

I will get back to you in two or three days about what I did. I am interested your thoughts about this being fixed in a more automatic way in the future. Are there other tools like Timeshift that work really well?

Thanks again.
linux-rox
Level 4
Level 4
Posts: 395
Joined: Sun Jul 19, 2020 9:17 pm

Re: Update in another distro removed Mint listing from grub

Post by linux-rox »

FYI, you don't need btrfs for Timeshift. It has two modes, btrfs and rsync. The latter is perfectly compatible with ext4 and what most people are using (myself included). It just takes more space and a little more time to run. On the whole, though, I've found it easy to use. Meanwhile, to answer a question from earlier, btrfs is still a work-in-progress and many people think it will never be ready for prime time. That's why I've never bothered with it. Also, probably explains why os-prober/grub haven't been fixed.

Speaking of earlier questions, yes, you can reinstall Grub from a live session. Easily done, in fact. The reason I've not recommended here is that you got in this mess because Cinnamon was having boot problems, so I don't think reinstalling Grub will help. Indeed, I'm not especially confident you'll be able to boot Cinnamon from Kubuntu, even though we've figured out how to get around the os-prober problem. If not, Cinnamon probably can be fixed, but my instincts say this isn't a boot loader problem. Only way to find out, though, is one step at a time.

For future reference, then (not recommending here), this is how you reinstall Grub from a live session. (These are the UEFI steps, BIOS is somewhat simpler.) Set up an internet connection. Open Terminal and run the following commands, one line at a time:

Code: Select all

sudo apt install grub-efi-amd64-signed shim-signed
sudo mount /dev/sda11 /mnt
sudo mount /dev/sda1 /mnt/boot/efi 
sudo grub-install /dev/sda --boot-directory=/mnt/boot --uefi-secure-boot 
It's the device mount in the second line that determines which system gets put in charge of Grub. Alternatively, you can do the same thing from any bootable Ubuntu or Mint OS in a multi-boot system, except you don't need the first line (those will be installed already).
Post Reply

Return to “Installation & Boot”