Recovering grub2 after removing gnome
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2019
    Location
    italy
    Posts
    1
    Linux Firefox 61.0

    Recovering grub2 after removing gnome

    Hi,

    I erroneously removed gnome from fedora 28 and grub2 doesnt work anymore. I reinstalled gnome and updated to fedora 29 but when i boot it just arrives to grub command shell(not grub rescue mod). I have a LUKS encrypted LVM partitioned SSD disk like following (with uefi) :

    Code:
    Device           Start        End    Sectors   Size Type
    /dev/nvme0n1p1    2048     411647     409600   200M EFI System
    /dev/nvme0n1p2  411648    2508799    2097152     1G Linux filesystem
    /dev/nvme0n1p3 2508800 2000408575 1997899776 952.7G Linux filesystem
    third one is luks + lvm (contains root, home and swap)

    I used fedora-live(29) cd to boot, decrypt, mount and finally chroot to my root. Reinstalled grub2-efi and shim and finally run `grub2-mkconfig ...` with following commands:
    Code:
    $ modprobe dm-crypt
    $ cryptsetup  luksOpen  /dev/nvme0n1p3  myvol
    $ vgscan
    $ vgchange -ay fedora_localhost-live
    $ lvs
    
    $ mount /dev/fedora_localhost-live/root /mnt/myfed/
    $ mount  /dev/nvme0n1p2 /mnt/myfed/boot
    $ mount  /dev/nvme0n1p1 /mnt/myfed/boot/efi
    
    $ mount --bind /dev   /mnt/myfed/dev
    $ mount --bind /proc /mnt/myfed/proc
    $ mount --bind /sys   /mnt/myfed/sys
    $ mount --bind /run  /mnt/myfed/run
    
    $ chroot /mnt/myfed
    
    $grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
    Code:
    grub2-mkconfig
    doesnt give me any error, it says "done". But when i reboot there is still no grub menu. What should i do? Don't know what logs could be useful.

  2. #2
    Join Date
    Aug 2007
    Posts
    315
    Linux (Fedora) Firefox 61.0

    Re: Recovering grub2 after removing gnome

    I see one major problem. After decrypting your / partition /dev/nvme0n1p3 with cryptsetup you are apparently ignoring it completely and mounting the live root, which is already mounted if you are running the live environment. There is no point in even doing a chroot operation in that case.

    Code:
    $ mount /dev/fedora_localhost-live/root /mnt/myfed/
    $ vgchange -ay fedora_localhost-live
    This is the wrong volume group to activate. Also it should already be active if you are running the live usb.

    You need to activate the volume group in /dev/mapper/myvol whatever it is named. This is where your installation is stored. The vgscan should return more than one VG name if the decrypt operation worked, one VG for your installation on /dev/nvme0n1p3 and one for the live environment on the USB. If there is only one VG, namely fedora_localhost-live which is a part of F29 live, then the decrypt operation did not work.

    You need to verify that the decrypt operation worked, that /dev/mapper/myvol exists and is a link to a dm-n node.

    Code:
    $ modprobe dm-crypt
    $ cryptsetup  luksOpen  /dev/nvme0n1p3  myvol
    $ ls -l /dev/mapper/myvol
    If the second VG is for example simply named fedora with root and swap partitions, possibly home as well , it would be:

    Code:
    $ vgchange -ay fedora
    $ mount /dev/fedora/root /mnt/myfed/
    https://gist.github.com/agilepoodle/...525fe9fbbc0276

    grub2-mkconfig doesnt give me any error, it says "done". But when i reboot there is still no grub menu. What should i do? Don't know what logs could be useful.
    You don't need any logs as you can look at the actual generated grub.cfg in /boot/efi/EFI/fedora/grub.cfg to see if it worked correctly. You should do this before rebooting other wise the rebooting will accomplish nothing. grub2-mkconfig should list the OS it finds as well as the entries it generates. If it says 'done' without any other output then it did nothing.
    Last edited by amiga; 7th January 2019 at 10:59 PM. Reason: added detail

  3. #3
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,612
    Linux (Fedora) Firefox 64.0

    Re: Recovering grub2 after removing gnome

    Man grub2-install

    sudo grub2-install /dev/sdx where x is the disk drive that has Fedora.
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  4. #4
    Join Date
    Aug 2007
    Posts
    315
    Linux (Fedora) Firefox 61.0

    Re: Recovering grub2 after removing gnome

    Man grub2-install
    sudo grub2-install /dev/sdx where x is the disk drive that has Fedora.
    Apparently you didn't read this post. The OP has an EFI system and an NVMe SSD. For EFI you normally don't install to a device at all, except if you want to make a disk removable and portable. As well the OPs drive would be /dev/nvme0n1 and not /dev/sdx which is for SATA.

    https://fedoraproject.org/wiki/GRUB_2

    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/.
    Last edited by amiga; 4th January 2019 at 09:00 PM.

Similar Threads

  1. Removing new kernel from GRUB2
    By Barzai in forum Using Fedora
    Replies: 5
    Last Post: 13th March 2016, 12:09 AM
  2. Tried KDE - Removing It - Seems to Be Removing Gnome Stuff
    By nightmarcus in forum Using Fedora
    Replies: 10
    Last Post: 18th April 2010, 11:29 PM
  3. recovering gnome from a power failure
    By ftrotter in forum Using Fedora
    Replies: 6
    Last Post: 27th December 2006, 10:00 PM
  4. Removing GNOME
    By Fyorl in forum Using Fedora
    Replies: 8
    Last Post: 21st November 2006, 08:52 PM
  5. Removing Gnome
    By narasim_7 in forum Using Fedora
    Replies: 2
    Last Post: 7th March 2006, 09:08 PM

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
  •