Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save plintx/8bb0b97b8e8920aae58a85072fc534f9 to your computer and use it in GitHub Desktop.

Select an option

Save plintx/8bb0b97b8e8920aae58a85072fc534f9 to your computer and use it in GitHub Desktop.
re-install grub using Fedora Live CD. Fedora was installed with LVM. The system dual boots Ubuntu and Fedora.
su
mkdir /mnt/root
# You may use fdisk -l to list the devices
mount /dev/mapper/fedora-root /mnt/root
# Mount the boot partition, maybe /dev/sda1
# As the system has both Ubuntu and Fedora installed,
# so sda3 in my case
mount /dev/sda<3> /mnt/root/boot
mount -t proc none /mnt/root/proc
mount -o bind /dev /mnt/root/dev
# change root directory
chroot /mnt/root /bin/bash
# [Re]install grub
grub2-install /dev/sda
# References:
# http://thecreationist.expertscolumn.com/article/recover-grub-using-fedora-live-cd
# https://ask.fedoraproject.org/en/question/40578/how-to-reinstall-or-fix-grub-in-fedora-without-a-recovery-option-on-the-live-cd/?answer=40593#post-id-40593
@plintx
Copy link
Author

plintx commented Jun 16, 2024

$ sudo vgscan
Found volume group "fedora_localhost-live" using metadata type lvm2
$ sudo vgchange -ay fedora_localhost-live
3 logical volume(s) in volume group "fedora_localhost-live" now active

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment