Skip to content

Instantly share code, notes, and snippets.

@maplerichie
Created June 14, 2019 09:45
Show Gist options
  • Save maplerichie/bfceaaf53dd1af7e9414d6559ac0e283 to your computer and use it in GitHub Desktop.
Save maplerichie/bfceaaf53dd1af7e9414d6559ac0e283 to your computer and use it in GitHub Desktop.
[Kali GRUB] Fix GRUB bootable #Kali #GRUB
apt-get install grub-efi-amd64 -y

mount /dev/sda* /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mkdir /mnt/sys/firmware/efi/efivars
mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars
mkdir /mnt/boot/efi
mount /dev/sda+ /mnt/boot/efi
mount -o remount,rw /dev/sda+ /mnt/boot/efi
mkdir /mnt/hostrun
mount --bind /run /mnt/hostrun
chroot /mnt
mkdir /run/lvm
mount --bind /hostrun/lvm /run/lvm
grub-install /dev/sda
update-grub
exit
umount /mnt/dev
umount /mnt/proc
umount /mnt/sys/firmware/efi/efivars
umount /mnt/sys
umount /mnt/boot/efi
umount /mnt/hostrun
umount /mnt/run/lvm
umount /mnt
REBOOT

/dev/sda* is your linux filesystem. Like mine is /dev/sda6 /dev/sda+ is your EFI partition which is most likely /dev/sda1. Use fdisk -l to list all partitions.

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