Repair GRUB

A common problem that comes up after installing Windows on a separate partition on the same machine as Debian or another Linux flavour - you loose the grub menu and Windows boots by default, or Linux does not boot at all.

Get a bootable live USB or CD of the Debian version you are running and boot that.

Open a terminal and install gparted to find out which partition that is your linux root partition
sudo bash
apt-get install gparted

Run gparted and find out what partition that is your linux partition, then exit gparted again
gparted

Or use fdisk -l to find out

Now mount the relevant parts so you get inside your system, replace sdXY with your linux root partition, sdc7 or whatever.

mount /dev/sdXY /mnt 
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys

Jump in to the chroot
chroot /mnt

Now you can update grub
update-grub

This is has proven not to be enough, you need to install it to the drives too:
grub-install /dev/sdXY

Do exit a lot of times and then reboot.

More info at
https://sites.google.com/site/kotkamaahacklab/home/debian-jessie

This is a personal note. Last updated: 2016-03-22 12:20:37.



GitHub

My

GitLab

My

LinkedIn

My

Klebe.se

Don't forget to pay my friend a visit too. Joakim