Forked from nateheat/rescue-grub-with-fedora-live-cd.sh
Created
June 16, 2024 17:02
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ 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