Created
November 1, 2022 15:00
-
-
Save abrahaobittar/874c521a72a1130ee0cd5c1abec44719 to your computer and use it in GitHub Desktop.
EFI grub-installation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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