Recover GRUB bootloader

If GRUB gets wiped by other operating system or is installed in the wrong disk, do this:

-> Boot from a live Debian USB

-> Start a console/terminal.

-> Find the disk where you want to install GRUB (sdX):

# lsblk -f

-> Create a mountpoint (/ospart) where you are going to mount your system partitition (sdXY)

# mkdir /ospart
# mount /dev/sdXY /ospart

-> Change root to the system partition (/ospart)

# for i in /sys /proc /dev; do mount --bind $i /target$i; done
# chroot /ospart /bin/bash

-> (Re)Install GRUB on your desired disk (sdX)
# grub-install /dev/sdX
# update-grub

> Reboot!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s