• About
  • Manuals
  • Network
Confessions of a FreeBSD hacker Various tips & tricks about computers in general and FreeBSD in particular
Confessions of a FreeBSD hacker

Fixing a broken grub2

August 15, 2011 17:09 / Leave a Comment / Magnus Strahlert

For some reason every upgrade of Ubuntu destroys the working grub installation. This is how to fix it again.

First boot through rescue CD. Then to find out which partition your linux root system lies on do the following

fdisk -l

Mount it assuming /dev/sda3 is your root system

mount /dev/sda3 /mnt

Then set up a chroot in that root system and reinstall grub2

for fs in dev sys; do mount --bind /$fs /mnt/$fs; done
chroot /mnt
mv /boot/grub/grub.cfg /boot/grub/grub.cfg.old
grub-mkconfig > /boot/grub/grub.cfg
grub-install /dev/sda
exit
for fs in /mnt/dev /mnt/sys /mnt; do umount $fs; done

Reboot

Posted in: Linux / Tagged: grub, linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

* Copy This Password *

* Type Or Paste Password Here *

Post Navigation

 
Next Post →

Recent Posts

  • Takeaways utilising VFIO in a KVM virtual guest
  • Converting VM from ESXi to KVM with iSCSI storage
  • Deploying oVirt in self-hosted mode
  • Ansible playbook for handling perl on FreeBSD
  • iSCSI: Migrating from istgt to ctld

Tags

ansible backup carp chroot cluster cross-server esxi freebsd ftp ftpchroot gpt grub hast install iscsi kvm linux lun lvm mirror network nfs nfsroot ovirt pxe raid ramdrive raspberrypi snapshot ssd ssh terminalserver usb vfio virtio virtualbox vlan vmware volumes winxp zfs zpool zroot

Archives

  • July 2019
  • March 2018
  • February 2018
  • July 2017
  • February 2016
  • January 2015
  • August 2014
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • September 2012
  • July 2012
  • April 2012
  • March 2012
  • November 2011
  • August 2011

Recent Comments

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    © Copyright 2013-2016 - Magnus Strahlert
    Infinity Theme by DesignCoral / WordPress