<---- template headericclude ----->
grub2-mkconfig picking up docker images as OS options??
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2014
    Location
    London
    Posts
    95
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Exclamation grub2-mkconfig picking up docker images as OS options??

    I've had some weird issues lately with grub not showing the options I was expecting. Even worse, I started to see Ubuntu listed as an option on one of my NVMe drives. I haven't installed Ubuntu anywhere, but I do have a Ubuntu container images in my local Docker cache. So I tried adding another container image and immediately noticed Alpine picked up by grub2-mkconfig. Is this expected? Seems dodgy that grub should be hitting container images. Some hosts might get 100+ unbootable OS options listed in their menu. This is the latest Fedora 37 KDE spin, disregard the Rawhide/38 listing here which is extra and not default.

    Code:
    jboero@z840 ~> sudo grub2-mkconfig -o /boot/grub2/grub.cfg
    Generating grub configuration file ...
    File descriptor 3 (pipe:[7043536]) leaked on vgs invocation. Parent PID 3066526: grub2-probe
    File descriptor 9 (pipe:[7061870]) leaked on vgs invocation. Parent PID 3066526: grub2-probe
    File descriptor 3 (pipe:[7043536]) leaked on vgs invocation. Parent PID 3066526: grub2-probe
    File descriptor 9 (pipe:[7061870]) leaked on vgs invocation. Parent PID 3066526: grub2-probe
    Found Ubuntu 22.04.1 LTS on /dev/nvme1n1p3
    Found Alpine Linux v3.9 on /dev/nvme1n1p3
    Found Windows Boot Manager on /dev/sda2@/efi/Microsoft/Boot/bootmgfw.efi
    Found Fedora Linux 38 (KDE Plasma Prerelease) on /dev/sdd3
    Adding boot menu entry for UEFI Firmware Settings ...
    done
    jboero@z840 ~> docker images
    REPOSITORY         TAG       IMAGE ID       CREATED       SIZE
    ubuntu             latest    6b7dfa7e8fdb   4 weeks ago   77.8MB
    boeroboy/hashibo   2019      ed4e7d093c19   3 years ago   29.5MB
    Last edited by JohnnyB; 13th January 2023 at 10:57 PM.

  2. #2
    Join Date
    Jan 2014
    Location
    London
    Posts
    95
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: grub2-mkconfig picking up docker images as OS options??


  3. #3
    Join Date
    Jan 2023
    Location
    home
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: grub2-mkconfig picking up docker images as OS options??

    Hi,

    I have exactly the same problem.
    it seems that "grub2-mkconfig" only updates my docker containers without changing the "real" OS, which is in my case also Fedora 37 KDE

    The referenced bug in bugzilla.redhat.com is closed

    Any updates on this ?

  4. #4
    Join Date
    Aug 2009
    Posts
    11,397
    Mentioned
    98 Post(s)
    Tagged
    0 Thread(s)

    Re: grub2-mkconfig picking up docker images as OS options??

    One way you can prevent this is to prevent grub2 from adding the results of os-prober to the menu, but it also would prevent the addition of other OS's likke Windows.

    Add the following to the /etc/default/grub file:

    Code:
    GRUB_DISABLE_OS_PROBER=true
    Then run grub2-mkconfig again.

    There are ways to exclude specific partitions, etc... by exporting variables in /etc/default/grub and then checking for them in /etc/grub.d/30-os-prober

    This is just an example from the grub docs that I found. It would not work for your specific case without some modifications..

    User-Assigned Variables

    Variables in the /etc/default/grub file are read and acted upon as needed. This allows users to add their own variables in a central location and then alter the GRUB 2 scripts to meet their needs. Keeping the user-defined variables within this file allows easier management of, and change to, those variables when desired. To add a variable, use the following format:

    export <VARIABLE>
    The following example would define a variable used to omit a specific Ubuntu partition from the menu:

    Define and export the variable in /etc/default/grub :

    export GRUB_EXCLUDE_PARTITION="/dev/sda1"

    Establish the conditional in /etc/grub.d/30_os-prober in the 10_linux section:

    if [ $GRUB_EXCLUDE_PARTITION = $LROOT ]; then
    or

    if [ ! $GRUB_EXCLUDE_PARTITION = $LROOT ]; then
    Complete the conditional at the appropriate point in the script

    Save the files and run sudo update-grub to incorporate the changes into the GRUB 2 menu.
    Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

  5. #5
    Join Date
    Jan 2020
    Location
    USA
    Posts
    568
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: grub2-mkconfig picking up docker images as OS options??

    Quote Originally Posted by JohnnyB
    BTW that bug reoprt is closed b/c FC29 is no longer supported.
    I strongly suggest you file a bug report (however progress fixing grub2 has been extremely slow).

Similar Threads

  1. grub2-mkconfig
    By lsatenstein in forum Using Fedora
    Replies: 0
    Last Post: 17th May 2019, 03:14 AM
  2. Grub2-mkconfig problem
    By lsatenstein in forum Using Fedora
    Replies: 24
    Last Post: 18th December 2017, 03:28 AM
  3. [SOLVED]
    grub2-mkconfig problem
    By lsatenstein in forum Using Fedora
    Replies: 8
    Last Post: 31st July 2017, 03:54 AM
  4. grub2-mkconfig warning
    By theking2 in forum F21 Development Forum
    Replies: 0
    Last Post: 13th October 2014, 06:33 PM
  5. Replies: 0
    Last Post: 27th January 2013, 09:34 AM

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
  •  
[[template footer(Guest)]]