0

I removed grub fully via apt

 sudo apt purge grub-pc grub-common

I was going to reinstall via apt

 sudo apt install grub-pc grub-common

but my UPS failed and the PC shut-down. Now I am stuck. No grub nothing. Live cd shows no /boot/grub/grub.cfg

What to do?

Thanx in advance.

Vijay
  • 8,056

1 Answers1

1
  • Backup
  • Boot from live CD, DVD or USB drive
  • Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) or open a terminal (Ctrl+Alt+T) and use the following command:

    sudo fdisk -l
    

    and find out. It is usually a EXT4 Partition. Replacing the XY with the drive letter, and partition number, run these commands:

    sudo mount /dev/sdXY /mnt
    sudo mount /dev/sdXZ /mnt  
    sudo mount --bind /dev /mnt/dev 
    sudo mount --bind /proc /mnt/proc 
    sudo mount --bind /sys /mnt/sys 
    sudo chroot /mnt 
    sudo apt install grub-pc grub-common
    sudo grub-install /dev/sdX
    sudo update-grub
    exit
    sudo umount /mnt/dev 
    sudo umount /mnt/proc 
    sudo umount /mnt/sys 
    sudo umount /mnt
    
  • Shut down and turn your computer back on, and you will be met with the default Grub2 screen.

Zanna
  • 70,465
HRadl
  • 26