[SOLVED] Fedora 29 upgrade to 30, grub boot fails and cannot grub2-mkconfig in chroot
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2006
    Posts
    12
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Fedora 29 upgrade to 30, grub boot fails and cannot grub2-mkconfig in chroot

    Hi all, I have an old system that has been upgraded through several versions of Fedora. Last night I ran the upgrade to F30, and on boot I get the following message very briefly as grub tries to start:

    Code:
    GRUB loading.
    Welcome to GRUB!
    
    error: file '/grub2/locale/en.mo.gz' not found
    This message is mentioned on this old thread from 2012 that is now closed: https://bugzilla.redhat.com/show_bug.cgi?id=817187

    "Artem, this is not a new bug, it was fixed. The reason you ran into it is because you had a stale GRUB core and GRUB modules in /boot/grub2 which are not automatically upgraded on BIOS systems. The solution is, as you discovered, is to run grub2-install (BIOS only systems). Thanks."

    This sounds like my situation, I had an old BIOS system that could well be stale.

    So I boot from Fedora 30 Live media, and can chroot and try to run grub2-mkconfig. I have /dev/sda my WIndows drive, and /dev/sdb my Linux drive, with sdb1 being /boot and sdb5 being root, so I first mount root and then boot within that filesystem, all in the live cd environment:

    Code:
    [liveuser@localhost-live ~]$ sudo mkdir /mnt/root
    
    We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:
    
        #1) Respect the privacy of others.
        #2) Think before you type.
        #3) With great power comes great responsibility.
    
    [liveuser@localhost-live ~]$ sudo mount /dev/sdb5 /mnt/root
    [liveuser@localhost-live ~]$ sudo mount /dev/sdb1 /mnt/root/boot
    Now I need to chroot into that environment to run grub2-mkconfig:

    Code:
    liveuser@localhost-live ~]$ sudo chroot /mnt/root
    Error, do this: mount -t proc proc /proc
    /bin/basename: missing operand
    Try '/bin/basename --help' for more information.
    This hangs, I can ctrl-C to get to the chrooted prompt but I'm not sure things are set up right, the user is now 'root' so something definitely changed.

    Code:
    [root@localhost-live /]# ls -l /boot/grub2/grub.cfg
    -rw-------. 1 root root 11863 May  7 10:08 /boot/grub2/grub.cfg
    [root@localhost-live /]# grub2-mkconfig -o /boot/grub2/grub.cfg
    /usr/sbin/grub2-probe: error: cannot find a device for / (is /dev mounted?).
    I'm not at all sure what's going on, but I did find a new command that I hadn't used before as an alternative to chroot, I ctrl-D out of the chroot environment and try this:

    Code:
    [liveuser@localhost-live ~]$ sudo systemd-nspawn -D /mnt/root
    Spawning container root on /mnt/root.
    Press ^] three times within 1s to kill container.
    [root@root ~]# ls -l /boot/grub2/grub.cfg
    -rw-------. 1 root root 11863 May  7 10:08 /boot/grub2/grub.cfg
    [root@root ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
    /usr/sbin/grub2-probe: error: failed to get canonical path of `/dev/sdb5'.
    Secondary question:

    Since the advice I found on Bugzilla said to run grub2-install, and not grub2-mkconfig, it led me to think that my grub config files do look fine (BLS is enabled and the config files for each kernel look OK) so perhaps grub2-mkconfig is not required.

    In this case I need to run grub2-install but am not sure what drive to point it at. Here is my lsblk output:

    Code:
    AME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    loop0         7:0    0   1.7G  1 loop 
    loop1         7:1    0   6.5G  1 loop 
    ├─live-rw   253:0    0   6.5G  0 dm   /
    └─live-base 253:1    0   6.5G  1 dm   
    loop2         7:2    0    32G  0 loop 
    └─live-rw   253:0    0   6.5G  0 dm   /
    sda           8:0    0   477G  0 disk 
    ├─sda1        8:1    0 411.1G  0 part 
    └─sda2        8:2    0  65.8G  0 part [SWAP]
    sdb           8:16   0 223.6G  0 disk 
    ├─sdb1        8:17   0   500M  0 part /mnt/root/boot
    ├─sdb2        8:18   0 156.3G  0 part 
    ├─sdb3        8:19   0   7.8G  0 part [SWAP]
    ├─sdb4        8:20   0     1K  0 part 
    └─sdb5        8:21   0  59.1G  0 part /mnt/root
    sdc           8:32   0   1.8T  0 disk 
    ├─sdc1        8:33   0    16M  0 part 
    └─sdc2        8:34   0   1.8T  0 part 
    sdd           8:48   1   7.5G  0 disk 
    ├─sdd1        8:49   1   1.8G  0 part /run/initramfs/live
    ├─sdd2        8:50   1   9.8M  0 part 
    └─sdd3        8:51   1  20.5M  0 part
    As said before, /dev/sda is my WIndows drive, /dev/sdb is Linux. /dev/sdc and /dev/sdb are storage that are not relevant. So:

    Code:
    [root@root ~]# grub2-install /dev/sdb
    Installing for i386-pc platform.
    grub2-install: error: failed to get canonical path of `/dev/sdb1'.
    Same error (more or less) that grub2-mkconfig gave me. At least things are consistent

    I've done an hour of googling and investigation but cannot see exactly what is going wrong here. These messages seem generic to a whole set of linuxes and problems, not just the problem I'm facing here.

    Any advice, please? My main dev system is dead in the water.

  2. #2
    Join Date
    Aug 2006
    Posts
    12
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Fedora 29 upgrade to 30, grub boot fails and cannot grub2-mkconfig in chroot

    I seem to have got around the problem with advice from https://docs.fedoraproject.org/en-US...BK24W_BqB6KdiA

    I think I was missing steps that bind /dev, /proc etc so they are properly available to the chrooted environment. I noticed that, inside the chroot environment, /dev appeared to be almost empty. Also, I had to alter /etc/sudoers to remove the requirement for a tty.

    So, from the live iso desktop (booted from USB), once you've mounted the root filesystem as I did before:

    Code:
    [liveuser@localhost-live ~]$ sudo mount -o bind /dev /mnt/root/dev
    [liveuser@localhost-live ~]$ sudo mount -o bind /proc /mnt/root/proc
    [liveuser@localhost-live ~]$ sudo mount -o bind /sys /mnt/root/sys
    [liveuser@localhost-live ~]$ sudo mount -o bind /run /mnt/root/run
    Then, I can chroot successfully (where before it hung and I had to ctrl-c, binding /proc fixed that), but sudo is not happy:

    [liveuser@localhost-live ~]$ $ sudo chroot /mnt/root
    [root@localhost-live /]# sudo grub2-install /dev/sdb
    sudo: sorry, you must have a tty to run sudo

    So I edit /etc/sudoers in the chrooted environment so it allows not having a tty, adding the new line "Defaults !requiretty".

    Then, grub2-install succeeds.

    Code:
    [root@localhost-live /]# sudo grub2-install /dev/sdb
    Installing for i386-pc platform.
    Installation finished. No error reported.
    Thanks to everyone who looked!

  3. #3
    Join Date
    Jun 2005
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fedora 29 upgrade to 30, grub boot fails and cannot grub2-mkconfig in chroot

    I seem to be having the same problem and am very stymied as to what to do.

    I ran dnf system-upgrade with no hitches, then did the system-upgrade reboot.

    Using configfile on the rpmsave config file let me into the system, and bugzilla seemed to think I could solve everything by installing grub So I did that.

    Now grub drops me to grub-rescue> and I do not know what to do.

    I tried a live CD with Boot Repair, which produces this Boot/Info fil *attached(



    sdb belongs to the same LVM as sda. sdc is an old Linux drive used currently only for backups. It does apparently have a really old MBR and grub, but is not bootable.

    I am currently downloading the F30 live media. I would be very appreciative if someone could point me in the right direction her, so I dont have to waste a lot of time experimenting...
    Attached Files Attached Files

  4. #4
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fedora 29 upgrade to 30, grub boot fails and cannot grub2-mkconfig in chroot

    Thanks for the info on grub2-install needing to be run/refreshed on BIOS based systems.
    I have multiple KVM instances that have also been upgraded through many releases of Fedora.
    All attempts I tried to update any of the F29 KVM instances to F30 resulted in the "grub>" prompt after the "dnf system-upgrade reboot" completed OK. So I guess the KVM environment emulates a BIOS one.

    I selected one instance to test on and after using "grub2-install /dev/vda" before running the upgrade reboot command the KVM instance upgraded and booted OK. Restored the qcow2 file and redid the upgrade without grub2-install to eliminate updates to the repositories fixing the issue and was back to the grub prompt. Restored it again and repeated using the grub2-install to /dev/vda to make sure it was not luck and it succeeded to boot cleanly after the upgrade again.

    So thanks to the info you provided here I have started upgrading the rest of them, which hopefully will all work. I will include that step on physical machines as well, as I assume that is where you hit the issue.

  5. #5
    Join Date
    Sep 2019
    Location
    The Netherlands
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fedora 29 upgrade to 30, grub boot fails and cannot grub2-mkconfig in chroot

    Hello,

    My laptop got stucked while upgrading from 29 to 30, after doing the reboot for updTing the first f30 install. So far I have been unable to recover. I looked into getting the f29 runninv by:

    Grub> set=root(hd0,1)
    Grub> linux /vmlinux.....29
    Grub> initrd / initra....29
    Grub> boot

    This attemp fails as it gives a rescuescreen for a 5% install missing most functionality.

    What is the best eay to start for doing a recover. I know it has to deal with an error in the grub.cfg. Burn a live Fedora core 30 install dvd and follow the above described path?

    Thanks a lot, Peter

  6. #6
    Join Date
    Feb 2005
    Location
    London, UK
    Posts
    1,156
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Fedora 29 upgrade to 30, grub boot fails and cannot grub2-mkconfig in chroot

    Hi Peter68,

    As this is a new question, please would you create a new thread rather than posting in an old one?

    Thanks,

    Haydn.

Similar Threads

  1. Fedora 18 grub2-mkconfig error
    By te777 in forum Using Fedora
    Replies: 2
    Last Post: 25th April 2013, 01:26 PM
  2. Replies: 0
    Last Post: 27th January 2013, 09:34 AM
  3. Replies: 14
    Last Post: 28th August 2012, 11:03 PM
  4. [SOLVED]
    slow grub since grub2-mkconfig (grub shows penguins)
    By Japplo in forum Using Fedora
    Replies: 2
    Last Post: 27th July 2012, 01:13 PM
  5. Replies: 17
    Last Post: 5th March 2012, 12:37 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
  •