Hi everyone, i am creating this tuto for those that broke their grub because of windows update or because grub was not properly installed during parrot install and so on.
-
The first step is to boot live using a bootable USB key of Debian or ParrotOS. Boot on it, and then open a terminal.
-
In the terminal type:
sudo -i
fdisk -l
The fdisk command will show your partition scheme, you have to identify 2 things (only one for those using legacy instead of uefi)
- The partition that contain the “/” which is the partition where the system is installed.
- The EFI partition
lets say here my system partition is /dev/sda2 and my EFI partition is /dev/sda1. Your partition “name” can be different, just replace mine by yours in the command shown below.
- Now you have to mount the partitions
mount /dev/sda2 /mnt
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /dev /mnt/dev
Those that have Legacy instead of EFI can go to step 4)
For EFI there is one extra step: Mount your EFI partition
mount /dev/sda1 /mnt/boot/efi
Sometimes errors like this can result: mount: /mnt/boot/efi: mount point does not exist.
To solve it create the efi directory in /mnt/boot/ using this command:
mkdir /mnt/boot/efi
then try to mount the efi partition again.
- Now we have to chroot in the system (i let you google what chroot means )
chroot /mnt
Now that you are in you can just install the grub by typing this command: (grub-install ask for disk, not a partition so dont put any number like this: sda instead of sda1
grub-install /dev/sda
then if no errors are chown you can just exit by typing:
exit
and reboot the system. Once the system is rebooted, run update-grub to be sure that any other OS is detected by the grub.
sudo update-grub
If you have any issue you can always ask here.