• About Binary Impulse
  • BashBytes
Binary Impulse

Daily Archives: April 4, 2016

You are browsing the site archives by date.

Reinstall GRUB When Your System Isn’t Bootable

April 4, 2016 4:22 AM / Leave a Comment / Kirk Schnable

Background
From time to time, I have encountered a system where due to some conditions the GRUB installation has become corrupted.  It is a fairly simple matter to reinstall GRUB, and sometimes this can quickly salvage a broken installation.

This is not meant to be a comprehensive guide, but is a compilation of information I found online ([1], [2]) that was useful to me in repairing a few problematic GRUB loaders.  Please feel free to contribute in the comments section if you have something to add.

Setting Up The Environment
The first thing you will want to do is locate a live CD as close to the version of Linux you have installed as possible.  Boot into the Live CD.

You need to set up a functional chroot.  For the purposes of this guide, I will assume /dev/sda1 is your / partition on your installation.  We will make a chroot in /mnt/chroot/.

mkdir /mnt/chroot/
mount /dev/sda1 /mnt/chroot/

Next, you need to bind the directories that GRUB needs to access.

mount --bind /dev /mnt/chroot/dev
mount --bind /dev/pts /mnt/chroot/dev/pts
mount --bind /proc /mnt/chroot/proc
mount --bind /sys /mnt/chroot/sys

Finally, chroot to your environment.

chroot /mnt/chroot/

Reinstalling GRUB Automatically
You can try a simple reinstall of GRUB automatically first, see if any insightful errors are produced.

grub-install /dev/sda

Failing that, try the following which will rescan the BIOS drives and update information in the GRUB configuration.

grub-install --recheck /dev/sda

Reinstalling GRUB Manually
If the automatic reinstall does not work for you, try reinstalling via the GRUB shell.

grub
grub> root(hd0,0)
grub> setup(hd0)
grub> quit
Posted in: How-To's, Musings

Pages

  • About Binary Impulse
  • BashBytes

Recent Posts

  • My UBook X Linux Tablet Adventure and how I learned more than I ever thought I would need to know about accelerometer drivers
  • Migrating Proxmox Hypervisor’s Boot Volume ZFS Mirror To New (Smaller) Disks
  • OPNsense Performance Tuning for Multi-Gigabit Internet
  • Reddit Deplatforms Popular Microsoft Software Swap Subreddit
  • Comcast Upgrades Gigabit Pro from 3Gbps to 6Gbps!
April 2016
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  
« Feb   Dec »

Recent Comments

  • jasonistre on OPNsense Performance Tuning for Multi-Gigabit Internet
  • Nick on OPNsense Performance Tuning for Multi-Gigabit Internet
  • Kirk Schnable on OPNsense Performance Tuning for Multi-Gigabit Internet
  • nick on OPNsense Performance Tuning for Multi-Gigabit Internet
  • Eric on My UBook X Linux Tablet Adventure and how I learned more than I ever thought I would need to know about accelerometer drivers

Categories

  • How-To's
  • Humorous
  • Musings
  • Newsworthy
  • Other

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
© Copyright 2025 - Binary Impulse
Infinity Theme by DesignCoral / WordPress