Grub items duplication

Hi. I have long issue with grub menu items duplicate after update. I found this forum post, but there is no *.rpmorig files in ls /etc/grub.d/.

Content:

00_header    10_linux        25_bli            32_linux_proxy  35_fwupd          38_custom  80_suse_btrfs_snapshot  backup            README
01_tuned     10_linux_proxy  30_os-prober      33_linux_xen    35_uefi-firmware  40_custom  90_persistent           bin
05_crypttab  20_linux_xen    30_uefi-firmware  34_bli          36_fwupd          41_custom  95_textmode             proxifiedScripts

At the very least, there’s obviously two entries in that directory for uefi-firmware (30 and 35). I’d look at the contents of those files and see what’s duplicated.

Looks like fwupd is in there twice as well.

I’d identify which have duplicate entries in then, and then maybe look to see which packages each is owned by to see if there’s maybe an abandoned package or some entries left behind after an update.

Those entries do not exist normally, you need to check what they are (or what files are in these directories).

30_uefi-firmware and 35_uefi-firmware identical with content:

#! /bin/sh
set -e

# grub copyring and other comments

prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"

export TEXTDOMAIN=grub2
export TEXTDOMAINDIR="${datarootdir}/locale"

. "$pkgdatadir/grub-mkconfig_lib"

LABEL="UEFI Firmware Settings"

gettext_printf "Adding boot menu entry for UEFI Firmware Settings ...\n" >&2

cat << EOF
if [ "\$grub_platform" = "efi" ]; then
        menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' {
                fwsetup --is-supported
                if [ "\$?" = 0 ]; then
                        fwsetup
                else
                        echo "Your firmware doesn't support setup menu entry from a boot loader"
                        echo "Press any key to return ..."
                        read
                fi
        }
fi
EOF

The same goes to fwupd. 2 files with identical content. How to check which package owns them?

ls /etc/grub.d/backup

boot_grub  default_grub  etc_grub_d  RESTORE_INSTRUCTIONS

cat ls /etc/grub.d/backup/RESTORE_INSTRUCTIONS

How to restore this backup
--------------------------
 * make sure you have root permissions (`gksu nautilus` or `sudo -s` on command line) otherwise you won't be able to copy the files
 * to fix an unbootable configuration, just copy:
     * '/etc/grub.d/backup/boot_grub' to '/boot/grub2'
 * to reset the whole configuration (if it cannot be fixed by using grub customizer), also copy these files:
     * '/etc/grub.d/backup/etc_grub_d' to '/etc/grub.d'
     * '/etc/grub.d/backup/default_grub' to '/etc/default/grub'

I think this is the most interesting one due to mentioning grub customizer.

ls /etc/grub.d/backup/etc_grub_d

00_header  05_crypttab  20_linux_xen  30_os-prober      35_fwupd   41_custom               90_persistent  README
00_tuned   10_linux     25_bli        30_uefi-firmware  40_custom  80_suse_btrfs_snapshot  95_textmode
rpm -qf /path/to/file
rpm -qf /etc/grub.d/30_uefi-firmware 
grub2-common-2.12-47.1.x86_64
rpm -qf /etc/grub.d/35_uefi-firmware 
file /etc/grub.d/35_uefi-firmware is not owned by any package

It should be fine to remove the ones that aren’t owned by any package, especially since they duplicate other files that are present.

1 Like

Should I do sudo grub2-mkconfig -o /boot/grub2/grub.cfg after that?

EDIT: I still see duplicate entries after file deletion

Have you been using Grub Customizer?

That’s the only time I’ve seen duplicates like that.

The duplicates are already in your grub menu so deleting the files that make the duplicates will not get rid of them.

The easiest way to get rid of them is to delete the duplicate entries with Grub Customizer. Delete the duplicate files in /etc/grub.d/ before you save again from Grub Customizer.

That should produce a single entry for each option in the menu.

Yes. Long ago (probably after plasma6 release). Don’t remember why, but I forgot where grub config and other stuff, so used customizer.

Now I understand why I had duplicates. They created by Grub Customizer.

1 Like

Thanks everyone.
I removed duplicates and re-created grub config. Duplicate entries are gone, and I don’t think they appear anymore, as they were created by Grub Customizer.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.