F30 grub issue on legacy partition
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 14 of 14
  1. #1
    Join Date
    Jun 2008
    Location
    Melbourne, Australia
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    F30 grub issue on legacy partition

    I previously upgraded my F29 install to F30 and experienced the issue of grub not having an entry for Fedora.

    I decided to do a fresh installation on the weekend and I experienced a similar issue.

    I should explain how my system is set up. Windows, Arch and Fedora were installed in legacy mode, with Fedora being the last partition on the disk. I like to have grub installed from Arch to the MBR. Since Arch doesn't add a new grub entry after a kernel update, I can set the default boot option to Windows to keep my wife happy. If I did that in Fedora, the default entry would change every time a new kernel is installed, since it adds an entry to grub.

    Even though it's not recommended, I have grub in Fedora installed on /dev/sda7 and have the Fedora entry in Arch chainloading to Fedora's grub.

    Anyway, the issue is that when I choose Fedora from the first (Arch's) grub menu, it switches to Fedora's grub menu, but there's no Fedora entry, meaning I'm unable to boot it.

    I suspect this is a similar bug to what I experienced after attempting to upgrade from F29 to F30, but I'd appreciate suggestions.

  2. #2
    Join Date
    Jan 2006
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: F30 grub issue on legacy partition

    Don't understand how you can not have a grub entry in Fedora /boot/grub2/grub.cfg. Anyway suggest you make an entry in Arch's /etc/40_custom, something like this:
    Code:
    menuentry 'Fedora 30' {
    	insmod part_gpt
    	insmod ext2
    	set root='hd1,gpt7'
    	linux	/boot/vmlinuz-5.1.15-300.fc30.x86_64 root=/dev/sda7 ro rhgb quiet 
    	initrd	/boot/initramfs-5.1.15-300.fc30.x86_64.img
    }
    After booting Fedora you can update-grub and use the chainloading if you prefer. An alternative would be to change the Arch's Fedora entry to
    Code:
    menuentry 'Fedora  30' {
        insmod part_gpt
        insmod ext2
        set root='hd1,gpt7'
        configfile /boot/grub2/grub.cfg
    }
    which saves work when the Fedora kernel is updating

  3. #3
    Join Date
    Jan 2006
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: F30 grub issue on legacy partition

    I assumed that you have a GPT disk rather than a MBR disk, as you mention sda7. If MBR you should change "part_gpt" to "part_msdos" and "gpt7" to msdos7. And in either case it should of course be hd0.

    Also when you in Fedora run update-grub, check that this script is used:
    Code:
    sudo /usr/sbin/brub2-mkconfig -o /boot/grub2/grub.cfg
    and no other output.

    Also suggest in /etc/default/grub change GRUB_ENABLE_BLSCFG=true to false

  4. #4
    Join Date
    Jun 2008
    Location
    Melbourne, Australia
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: F30 grub issue on legacy partition

    Quote Originally Posted by Krister Hallerg
    I assumed that you have a GPT disk rather than a MBR disk, as you mention sda7. If MBR you should change "part_gpt" to "part_msdos" and "gpt7" to msdos7. And in either case it should of course be hd0.

    Also when you in Fedora run update-grub, check that this script is used:
    Code:
    sudo /usr/sbin/brub2-mkconfig -o /boot/grub2/grub.cfg
    and no other output.

    Also suggest in /etc/default/grub change GRUB_ENABLE_BLSCFG=true to false
    Thanks for the reply. Yes, it's not a GPT disk. Also, the disk is recognised as /dev/sdb, as a second backup SSD is recognised as /dev/sda, so I'm guessing that it would be hd1. I'll give it a try.

  5. #5
    Join Date
    Jun 2008
    Location
    Melbourne, Australia
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: F30 grub issue on legacy partition

    I've tried it and it doesn't work.

    Fedora installs grub to the MBR by default. I don't see any option to change that. When I reboot from the installation, I select Fedora from the grub menu and it boots. I then run /usr/sbin/grub2-install --force /dev/sdb8 to install grub to /dev/sdb8. I then boot into Arch and run grub-install /dev/sdb to install it to the MBR.

    When I reboot and choose Fedora from Arch's grub boot menu, it switches to Fedora's grub menu in /dev/sdb8, but the Fedora entry is gone. I now have no way of booting Fedora.

    I don't understand why Fedora removes its own grub entry when grub is installed to a partition instead of the MBR.

    My grub syntax in Arch is correct, as it's correctly switching to Fedora's grub menu when I choose Fedora. There's just no Fedora entry in its own grub menu (just Arch and Windows).

    Edit:
    I added the following to Arch's grub menu and I get an error about the partition not being found and needing to load the kernel first.

    menuentry 'Fedora 30' {
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos8'
    linux /boot/vmlinuz-5.0.9-300.fc30.x86_64 root=/dev/sdb8 ro rhgb quiet
    initrd /boot/initramfs-5.0.9-300.fc30.x86_64.img
    }
    Last edited by Pumpino; 31st July 2019 at 05:27 AM.

  6. #6
    Join Date
    Jan 2006
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: F30 grub issue on legacy partition

    sdb8 or sdb7? I actually use the search function with uuid, which for me works better:
    Code:
    menuentry 'Fedora   30 ' {
        insmod part_gpt
        insmod ext2
        search --set=root --fs-uuid 11ea3046-6a4e-4b4a-930c-0083dd7fad29
        linux /boot/vmlinuz-5.0.9-300.fc30.x86_64 root=/dev/sdb8 ro rhgb quiet
        initrd /boot/initramfs-5.0.9-300.fc30.x86_64.img
    }
    Do I understand correctly that you after installation are able to boot with the Fedora grub menu?
    Take a copy of it before running the grub2-install. Location /boot/grub2/boot.cfg? Is it still there? Then run update-grub:
    Code:
     sudo /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
    before rebooting to Arch. Is it still there?

    This link might be useful for you https://forums.fedoraforum.org/showthread.php?321562

  7. #7
    Join Date
    Jan 2006
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: F30 grub issue on legacy partition

    If you do have a functioning Fedora grub2 bootmeny, why not use that and change the default to your wife's wish in /etc/default/grub? Or adding a file 09_custom much like 40_custom with just a menuentry for Windows, which then will turn up as the first line (GRUB_ DEFAULT=0).

  8. #8
    Join Date
    Jun 2008
    Location
    Melbourne, Australia
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: F30 grub issue on legacy partition

    Fedora boots fine immediately after the installation. I boot into Arch and manually add the copied Fedora entry from grub.cfg in Fedora. The kernel entry should've been 5.0.9-301, not 300, which is why it wasn't working in my previous post. So Fedora directly boots from Arch's grub menu. However, manually changing the entry after every kernel update isn't practical.

    The issue is that once booted into Fedora, running /usr/sbin/grub2-install --force /dev/sdb8 after /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg results in the Fedora entry being removed from grub.cfg! However, it only removes it when I run /usr/sbin/grub2-install --force /dev/sdb8. If I run /usr/sbin/grub2-install --force /dev/sdb (ie. to the MBR rather than /dev/sdb8) after /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg, it keeps the Fedora entry in grub.cfg! It's bizarre. It doesn't like grub being anywhere other than the MBR, so chainloading is no longer possible as of F30.
    Last edited by Pumpino; 31st July 2019 at 01:07 PM.

  9. #9
    Join Date
    Jun 2008
    Location
    Melbourne, Australia
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: F30 grub issue on legacy partition

    Quote Originally Posted by Krister Hallerg
    If you do have a functioning Fedora grub2 bootmeny, why not use that and change the default to your wife's wish in /etc/default/grub? Or adding a file 09_custom much like 40_custom with just a menuentry for Windows, which then will turn up as the first line (GRUB_ DEFAULT=0).
    I have always created /boot/grub/custom.cfg with:

    menuentry 'Windows 10' --hotkey=w {
    insmod part_msdos
    insmod ntfs
    set root='hd0,msdos1'
    chainloader +1

    However, it doesn't appear first in the grub list. If Fedora appears above it and an extra kernel is installed, grub will not boot Windows by default, as the numbers will be out of whack. In order for GRUB_ DEFAULT=0 to boot Windows every time, Windows would need to appear first in the grub menu. How would I do that?

    Perhaps I'm not going about it the best way by having a custom.cfg. I'm interested in hearing the "proper" way to go about it.

    Thanks for all of your help so far.

  10. #10
    Join Date
    Jun 2008
    Location
    Melbourne, Australia
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: F30 grub issue on legacy partition

    Quote Originally Posted by Krister Hallerg
    Also suggest in /etc/default/grub change GRUB_ENABLE_BLSCFG=true to false
    I just made this change. It fixed everything. The Fedora entry now stays in grub.cfg after I install grub to /dev/sdb8.

    I can continue with my original setup of chainloading by having the following syntax in /boot/grub/custom.cfg in Arch:

    menuentry 'Fedora Linux' --hotkey=f {
    configfile (hd0,msdos8)/boot/grub2/grub.cfg

    Thanks again!

  11. #11
    Join Date
    Jan 2006
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: F30 grub issue on legacy partition

    Glad you got there in the end

  12. #12
    Join Date
    Aug 2007
    Posts
    514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: F30 grub issue on legacy partition

    However, it doesn't appear first in the grub list. If Fedora appears above it and an extra kernel is installed, grub will not boot Windows by default, as the numbers will be out of whack. In order for GRUB_ DEFAULT=0 to boot Windows every time, Windows would need to appear first in the grub menu. How would I do that?
    You shouldn't use numbers at all for boot priority. You should use the actual label string for the Windows menu entry. That way it's position in the list does not matter.

    I use the F29 menu entry string.

    Code:
    GRUB_DEFAULT="Fedora (4.19.32-1.lts.fc29.x86_64) 29 (Twenty Nine)"

  13. #13
    Join Date
    Jan 2006
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: F30 grub issue on legacy partition

    This is how I handle MultiBoot https://tinyurl.com/y35p5zts

  14. #14
    Join Date
    Jun 2008
    Location
    Melbourne, Australia
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: F30 grub issue on legacy partition

    Quote Originally Posted by Krister Hallerg
    This is how I handle MultiBoot https://tinyurl.com/y35p5zts
    Thanks for the info.

Similar Threads

  1. [SOLVED]
    Replace Grub 2 with Grub Legacy
    By Majara in forum Installation, Upgrades and Live Media
    Replies: 4
    Last Post: 6th June 2012, 01:48 AM
  2. grub legacy
    By patrick013 in forum Installation, Upgrades and Live Media
    Replies: 1
    Last Post: 31st May 2012, 10:56 PM
  3. How compile grub.efi from GRUB Legacy
    By lidcs in forum Installation, Upgrades and Live Media
    Replies: 0
    Last Post: 2nd November 2011, 06:03 PM
  4. Switch from Grub legacy to Grub 2
    By lipisak in forum F16 Development
    Replies: 7
    Last Post: 6th October 2011, 02:41 PM
  5. Can i use grub without legacy usb support?
    By errorxp in forum Using Fedora
    Replies: 0
    Last Post: 20th September 2010, 06:55 AM

Posting Permissions

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