Difference between revisions of "RestoreGrub2"

From PCLinuxOSHelp Knowledge Base
Jump to: navigation, search
(Standardising format & categorisation)
m (Fixed categories)
Line 63: Line 63:

Revision as of 11:40, 19 April 2020

  • Relevant to ALL editions of PCLinuxOS.

YOU ARE HERE :: Main Page > Table of contents > Advanced > RestoreGrub2

This page describes ways to restore your PCLinuxOS GRUB2 bootloader.


Your bootloader may end up corrupt or overwritten by another operating system due to many factors such as user error, power loss or malware etc. In such situations you may find yourself in search of a way to restore your bootloader to a state in which it will normally load your favourite PCLinuxOS.

To fix or restore the GRUB2 bootloader on your PCLinuxOS system please follow these steps outlined below:

Boot from good media

Boot a recent PCLinuxOS LiveOS and open a root terminal to execute the commands given below:

Mount partitions

Mount your PCLinuxOS root partition

 mkdir -p /mnt
 mount /dev/sdaX /mnt

(replace sdaX with whatever your root partition is)

If this is a UEFI system mount the EFI System Partition (ignore this step for a BIOS/legacy system)

 mount /dev/sdaY /mnt/boot/EFI

(replace sdaY with whatever your ESP is)

GRUB2 re-install

Run the following commands to re-install the grub bootloader code

 for i in /sys /proc /dev; do mount -B $i /mnt$i; done
 chroot /mnt

Check result

If all goes well you will see:

 Installation finished. No error reported.

Followup procedures

Exit the chroot environment with CTRL-D

Undo the mounts and then reboot.

 for i in /sys /proc /dev; do umount /mnt$i; done
 umount /mnt/boot/EFI   #if necessary
 umount /mnt