Results 1 to 8 of 8

Thread: Remove Grub2 boot entry?

  1. #1

    Default Remove Grub2 boot entry?

    I installed Leap 15.1 with the gnome desktop on my laptop which had Windows 10 on it. 10 was an "upgrade" from Windows 7 which is no longer on my system. I specifically wanted to have the system dual boot between 10 and Leap 15.1. This is not a UEFI system if that makes a difference.

    I have three entries in the Grub2 boot menu:
    Leap 15.1
    Windows 10
    Windows 7

    If I select the 7 entry, it fails - which it should since 7 is no longer on the PC. The other two entries work without problems as I wanted.

    I have searched around and I have not found anything recent that seems to describe how to delete unwanted or bad Grub2 boot menu entries. The boot screen itself has the edit option, however, it does not appear that I can delete an entry using that menu - and I really don't know the emacs commands to do so. In the past, it appears that I could have gone into YaST to delete entries, but I have tried that and that method appears to be gone.

    What is the preferred procedure to delete unwanted/bad entries from the Grub2 boot menu?

    Thanks.

  2. #2
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,760

    Default Re: Remove Grub2 boot entry?

    Yast-boot loader should allow removal I believe, but the reason Win7 is there is probably that there are still entries in the EFI boot partition (mounted at /bootEFI in Linux) Also there may be entries still hanging around in the UEFI flash memory, read man efibootmgr for detail on viewing adding and removing entries. Once the offending entries are removed in Yast-boot loader make a null edit ie change something and then change it back accept and it should drop the nonexistent OS. Be sure the prob foreign OS box is check. should be by default

  3. #3
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,741
    Blog Entries
    3

    Default Re: Remove Grub2 boot entry?

    You can try running
    Code:
    os-prober
    I'm guessing that os-prober will still find Windows 7, and that's why there is a menu entry.

    Your alternatives:
    1. Remove all remnants of Windows 7, so that os-prober no longer finds it;
    2. Stop using os-prober. But then you will also lose the boot entry for Windows 10;
    3. Stop using os-prober, but manually add an entry for Windows 10 (perhaps in "/etc/grub.d/40_custom");
    4. Learn to live with what you are seeing.


    Personally, I would go with the last of those choices -- because it is the easiest.
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  4. #4
    Join Date
    Apr 2018
    Location
    U.S Midwest just West of the Mississippi River
    Posts
    598

    Default Re: Remove Grub2 boot entry?

    Quote Originally Posted by nrickert View Post
    You can try running
    Code:
    os-prober
    I'm guessing that os-prober will still find Windows 7, and that's why there is a menu entry.

    Your alternatives:
    1. Remove all remnants of Windows 7, so that os-prober no longer finds it;
    2. Stop using os-prober. But then you will also lose the boot entry for Windows 10;
    3. Stop using os-prober, but manually add an entry for Windows 10 (perhaps in "/etc/grub.d/40_custom");
    4. Learn to live with what you are seeing.


    Personally, I would go with the last of those choices -- because it is the easiest.
    I agree! been there, tried some of that on a 'converted to WIn10' Windows 7 laptop. Too much trouble,and then when I did have what I thought was a success. next boot, Grub2 still had Windows 7 in the menu.
    Last edited by Bill_L; 20-Jun-2019 at 18:54. Reason: fat finger correction
    HP Compaq desktop Leap15.1 Win10, Win7
    Toshiba laptops Leap15.1 & Win10, HP AiO Win10.
    I can now print with openSuSe Leap! Can Scan now, could be better!!
    I can backup my iPod and iPad with Windows, can't with Linux.(Will get there someday!)

  5. #5

    Default Re: Remove Grub2 boot entry?

    Quote Originally Posted by nrickert View Post
    You can try running
    Code:
    os-prober
    I'm guessing that os-prober will still find Windows 7, and that's why there is a menu entry.

    Your alternatives:
    1. Remove all remnants of Windows 7, so that os-prober no longer finds it;
    2. Stop using os-prober. But then you will also lose the boot entry for Windows 10;
    3. Stop using os-prober, but manually add an entry for Windows 10 (perhaps in "/etc/grub.d/40_custom");
    4. Learn to live with what you are seeing.


    Personally, I would go with the last of those choices -- because it is the easiest.
    Live with what I am seeing? Oh no! That is far too much!

    I found the answer after a bit more searching.

    What I did is go into the bootloader in YaST2 and get the partition of the Windows 7 entry. For me, it was /dev/sda2

    The next thing I did was to open a terminal and run:

    blkid

    To get the UUID for the Win 7 partition.

    The next thing I did was to edit /etc/default/grub and added the line

    GRUB_OS_PROBER_SKIP_LIST="MYUUID@/dev/sda2"

    Where I replaced MYUUID with the UUID of the Windows 7 partition from blkid.

    Then I ran in a terminal

    grub2-mkconfig -o /boot/grub2/grub.cfg

    On watching the output, I noted it said something like "Skipping Windows 7 on /dev/sda2 per user request."

    Then I went back into YaST2 bootloader and the Windows 7 entry was gone.

    Thanks to these https://superuser.com/questions/1484...ntry-from-grub and https://askubuntu.com/questions/4530...c-default-grub

    Of course, others will have to adjust the parameters according to their system.

    Thanks for all the replies.

  6. #6
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,741
    Blog Entries
    3

    Default Re: Remove Grub2 boot entry?

    Quote Originally Posted by wiyosaya View Post
    The next thing I did was to edit /etc/default/grub and added the line

    GRUB_OS_PROBER_SKIP_LIST="MYUUID@/dev/sda2"
    Well thank you. I didn't know about that.

    I currently get two entries for Windows 7 -- one for "/dev/sda2" and one for "/dev/sda3". They both boot the same Windows 7. Maybe I should try that trick.
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  7. #7
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    1,063

    Default Re: Remove Grub2 boot entry?

    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), openSUSE Tumbleweed, KDE Plasma 5

  8. #8

    Default Re: Remove Grub2 boot entry?

    Quote Originally Posted by nrickert View Post
    Well thank you. I didn't know about that.

    I currently get two entries for Windows 7 -- one for "/dev/sda2" and one for "/dev/sda3". They both boot the same Windows 7. Maybe I should try that trick.
    You're welcome!

    According to the grub docs for that parameter, you will need to separate both entries by a space.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •