Skip to content

Instantly share code, notes, and snippets.

@abrahaobittar
Created November 1, 2022 15:00
Show Gist options
  • Save abrahaobittar/874c521a72a1130ee0cd5c1abec44719 to your computer and use it in GitHub Desktop.
Save abrahaobittar/874c521a72a1130ee0cd5c1abec44719 to your computer and use it in GitHub Desktop.
EFI grub-installation
#!/bin/bash
if [ "$UID" -ne 0 ]; then
echo "Execute esse script como sudo"
exit 1
fi
apt update
apt install grub-efi-amd64-bin -y
mount /dev/sda2 /mnt
mount /dev/sda1 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
grub-install --root-directory=/mnt /dev/sda
cat << EOF | chroot /mnt
update-grub
EOF
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment