Jump to content



Photo

[How To] Fix Grub with a Ubuntu Live CD


  • Please log in to reply
1 reply to this topic

#1 Haggis

Haggis

    Neowinian Senior

  • Tech Issues Solved: 13
  • Joined: 13-June 07
  • Location: Near Stirling, Scotland
  • OS: Debian 7
  • Phone: Samsung Galaxy S3 LTE (i9305)

Posted 02 July 2014 - 12:11

Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is usually a EXT4 Partition. Replace the XY with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.

sudo mount /dev/sdXY /mnt

Now bind the directories that grub needs access to to detect other operating systems, like so.

sudo mount --bind /dev /mnt/dev &&
sudo mount --bind /dev/pts /mnt/dev/pts &&
sudo mount --bind /proc /mnt/proc &&
sudo mount --bind /sys /mnt/sys

Now we jump into that using chroot.

sudo chroot /mnt

Now install, check, and update grub.
This time you only need to add the drive letter (usually a) to replace X, for example: grub-install /dev/sda, grub-install –recheck /dev/sda.

grub-install /dev/sdX 

grub-install --recheck /dev/sdX 

update-grub

Now grub is back, all that is left is to exit the chrooted system and unmount everything.

exit &&
sudo umount /mnt/sys &&
sudo umount /mnt/proc &&
sudo umount /mnt/dev/pts &&
sudo umount /mnt/dev &&
sudo umount /mnt

Shut down and turn your computer back on, and you will be met with the default Grub2 screen.




#2 +Seahorsepip

Seahorsepip

    http://seapip.com

  • Tech Issues Solved: 23
  • Joined: 23-January 11
  • Location: Netherlands
  • OS: Windows 8.1 Pro
  • Phone: Nexus 5

Posted 02 July 2014 - 18:53

When I broke grub, I always used http://www.supergrubdisk.org/, saved me a lot of hassle when my pc didn't want to boot anymore after tweaking it too much :p