Recovering Fedora 27 after installing Ubuntu
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2018
    Location
    Czechia
    Posts
    2

    Recovering Fedora27 Grub2 (UEFI) after installing Ubuntu

    I have installed Ubuntu to get triple boot with Fedora and Windows, however the Ubuntu installer did not recognized my Fedora so I lost access to it.

    Here is my partitions:
    Code:
    Device             Start       End   Sectors   Size Type
    /dev/nvme0n1p1      2048    534527    532480   260M EFI System
    /dev/nvme0n1p2    534528    567295     32768    16M Microsoft reserved
    /dev/nvme0n1p3    567296 117754792 117187497  55,9G Microsoft basic data
    /dev/nvme0n1p4 498069504 500117503   2048000  1000M Windows recovery environment
    /dev/nvme0n1p5 117755904 119853055   2097152     1G Linux filesystem
    /dev/nvme0n1p6 119853056 429936639 310083584 147,9G Linux LVM
    /dev/nvme0n1p7 429936640 430960639   1024000   500M Linux filesystem
    /dev/nvme0n1p8 430960640 498069503  67108864    32G Linux filesystem
    
    Partition table entries are not in disk order.
    
    
    Disk /dev/mapper/fedora-root: 140 GiB, 150323855360 bytes, 293601280 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/mapper/fedora-swap: 7,9 GiB, 8426356736 bytes, 16457728 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    /dev/mapper/fedora-root is LUKS
    /dev/nvme0n1p5 is /boot partition for Fedora


    To install Ubuntu, I created /dev/nvme0n1p7 for /boot and /dev/nvme0n1p8 for / partition

    Ubuntu does not pick up Fedora:
    Code:
    # update-grub
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-4.15.0-20-lowlatency
    Found initrd image: /boot/initrd.img-4.15.0-20-lowlatency
    Found linux image: /boot/vmlinuz-4.15.0-20-lowlatency
    Found initrd image: /boot/initrd.img-4.15.0-20-lowlatency
    Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
    Adding boot menu entry for EFI firmware configuration

    I tried to follow https://fedoraproject.org/wiki/GRUB_2 and I am not sure if I understand correctly that the command to bring the system back to live is

    Code:
    dnf reinstall grub2-efi shim

    So I boot up from live CD, chroot into the system and issue that command, however that does not seem to have any affect as the Ubuntu Grub boot loader keeps hijacking the boot.
    Also tried
    Code:
    grub-install /dev/nvme0n1
    grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.
    I know this is common issue for quite few users as far as I could have searched, but I fail to find or see an obvious solution to it.
    Last edited by Vitoriung; 15th May 2018 at 12:16 AM. Reason: specifying problem in $subj

  2. #2
    Join Date
    May 2018
    Location
    Czechia
    Posts
    2

    Re: Recovering Fedora 27 after installing Ubuntu

    So I got my Fedora system back up finally.

    I turns that Ubuntu uses /boot/grub/grub.cfg while Fedora /boot/grub2/grub.cfg

    Chrooted Fedora system updates the grub config properly, but since Ubuntu installed its own grub loader and I have separated /boot partitions for each system, Fedora /boot partition does not get picked up by Ubuntu #update-grub command.

    I copied grub.cfg from Fedora /boot to Ubuntu /boot/grub/ and I have tripple boot Fedora/Ubuntu/Windows as desired.

    Now the best solution would be to replace the Ubuntu grub with the Fedora grub as I expect the next update of Fedora won't brake things while the update of Ubuntu will erase Fedora from the boot menu again.

    According to Fedora Grub2 wiki
    grub2-install shouldn't be used on EFI systems. The grub2-efi package installs a prebaked grubx64.efi on the EFI System partition, which looks for grub.cfg on the ESP in /EFI/fedora/ whereas the grub2-install command creates a custom grubx64.efi, deletes the original installed one, and looks for grub.cfg in /boot/grub2/.
    I already tried to reinstall the grub2-efi package under the chroot using livecd without success, is that suppose to resolve my situation and bring back the Fedora grub over the Ubuntu one?

Similar Threads

  1. Installing Fedora 17 on ubuntu 12
    By Sufyan in forum Installation, Upgrades and Live Media
    Replies: 2
    Last Post: 23rd March 2013, 11:05 AM
  2. [SOLVED]
    Can't boot up ubuntu after installing Fedora
    By robro in forum Installation, Upgrades and Live Media
    Replies: 5
    Last Post: 3rd June 2011, 10:48 AM
  3. Installing Fedora over ubuntu
    By TheIlluminative in forum Installation, Upgrades and Live Media
    Replies: 8
    Last Post: 16th September 2009, 04:46 PM
  4. Installing Ubuntu over Fedora
    By Gaurav Prabhu in forum Using Fedora
    Replies: 1
    Last Post: 14th May 2009, 08:37 AM
  5. Installing Fedora with Ubuntu 8.10 ????
    By Adyghe in forum Installation, Upgrades and Live Media
    Replies: 1
    Last Post: 18th February 2009, 04:04 PM

Posting Permissions

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