Subheader

Lazy Programmer's Blog

Pages

Showing posts with label grub. Show all posts
Showing posts with label grub. Show all posts

Sunday, May 1, 2016

How to restore Linux grub

In case when you install Windows when Linux is already installed, Windows overrides Linux GRUB with it's own bootloader without support of two operational systems. Here is algorithm how restore Linux GRUB. Lets pretend Linux has partition /dev/sda6

sudo mount /dev/sda6 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys  /mnt/sys
sudo chroot /mnt
grub-install --recheck --no-floppy /dev/sda
exit
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt
reboot