Skip to content

Instantly share code, notes, and snippets.

@coder4web
Last active August 31, 2018 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coder4web/2027592d705ee667d87c5bab18c9cbf0 to your computer and use it in GitHub Desktop.
Save coder4web/2027592d705ee667d87c5bab18c9cbf0 to your computer and use it in GitHub Desktop.
Ubuntu dual-boot HOW-TO
# boot - How can I reinstall GRUB to the EFI partition? - Ask Ubuntu
# https://askubuntu.com/a/831241/19938
# Note : sdX = disk | sdXX = efi partition | sdXXX = system partition
sudo mount /dev/sdXXX /mnt
sudo mount /dev/sdXX /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sdX
update-grub
# linux - How to reinstall GRUB2 EFI? - Super User
# https://superuser.com/questions/376470/how-to-reinstall-grub2-efi#376471
apt-get install --reinstall grub-efi
update-grub
# GRUB restore legacy BIOS mode
sudo mount /dev/sda1 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
grub-install /dev/sda
grub-install --recheck /dev/sda
update-grub
exit
sudo umount /mnt/dev
sudo umount /mnt/dev/pts
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment