Skip to content

Instantly share code, notes, and snippets.

@adde88
Created October 30, 2018 15:11
Show Gist options
  • Save adde88/d18d8b9f95cc40d4d12653d5d6d00eb4 to your computer and use it in GitHub Desktop.
Save adde88/d18d8b9f95cc40d4d12653d5d6d00eb4 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Private script i use while booting a Live distribution of Linux (Kali)
# to fix my grub. Windows seems to be removing it every now and then.
# Which is annoying as hell...
# Feel free to customize it to your own needs if nessecary.
# At least the correct root partition and EFI partition needs to be edited.
# Zylla - <adde88@gmail.com>
#
sudo mount /dev/sda6 /mnt
sudo mount /dev/sda2 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B /mnt$i; done
sudo chroot /mnt
grub-install /dev/sda
update-grub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment