---
title: "Repairing the GRUB bootloader"
description: "Guide to repair the GRUB bootloader on an instance"
url: https://docs.ovhcloud.com/en/guides/public-cloud/compute/repairing-the-grub-bootloader
lang: en
lastUpdated: 2020-11-23
---
# Repairing the GRUB bootloader

## Objective

In some cases you might need to repair the GRUB bootloader. This guide will show you how to easily repair the bootloader and successfully reboot your instance.

## Requirements

- A [Public Cloud instance](https://www.ovhcloud.com/en-gb/public-cloud/) in your OVHcloud account


***

### OVHcloud Control Panel Access

- **Direct link:** <ManagerLink to="/#/pci/projects">Public Cloud Projects</ManagerLink>
- **Navigation path:** <code className="action">Public Cloud</code> > Select your project

***


## Instructions

:::warning
The instance must be in rescue mode (see [How to activate rescue mode on a Public Cloud instance](/en/guides/public-cloud/compute/put-an-instance-in-rescue-mode.md)).

:::

Connect to the instance, either via VNC in the OVHcloud Control Panel
 or via SSH.
Type the following commands to mount the remote file system and start GRUB repairs:

```sh
mount /dev/sdb1 /mnt
mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys
mount -o bind /dev /mnt/dev
chroot /mnt /bin/bash
```

### Update GRUB (or GRUB2)

For GRUB installs:

```sh
grub-install /dev/sdb
update-grub
```

For GRUB2 installs:

```sh
grub2-install /dev/sdb
grub2-mkconfig -o /boot/grub2/grub.cfg
```

You can now leave the rescue mode and boot normally (see [How to activate rescue mode on a Public Cloud instance](/en/guides/public-cloud/compute/put-an-instance-in-rescue-mode.md)).

## Go further

Join our [community of users](https://community.ovhcloud.com/).
