Difference between revisions of "Recover From Grub Failure"

From Proxmox VE
Jump to navigation Jump to search
m
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
During to the upgrade from 3.x to 4.x, I found myself without a working grub and unable to boot.
+
During to the upgrade from 3.x to 4.x, I found myself without a working grub and unable to boot. Monitor shows:
I attempted to use the proxmox 4.1 install disk, but found it had a bug where the prompt would not accept input.
+
*<code>grub rescue ></code>
  
You'll need a ISO for a 64 bit version of Ubuntu, I used 14.04 LTS.
+
You can use Proxmox installation ISO in verison 5.4 or newer, and select debug mode.
 +
On the second prompt you'll have the full Linux tools, including LVM, ZFS, ..., available.
 +
If you exit that prompt you will come to the installation screens, simply hit abort there.
  
Boot ubuntu off the ISO.  We do not want to install ubuntu, just run it live off the ISO/DVD.
+
Alternatively, one can use a 64 bit version of Ubuntu or Debian Rescue CD.
 +
 
 +
Boot Proxmox VE in debug mode, or the Ubuntu/Debian off the ISO.  We do not want to install Ubuntu/Debian, just run it live off the ISO/DVD.
  
 
First We need to activate LVM and mount the the root partition that is inside the LVM container.
 
First We need to activate LVM and mount the the root partition that is inside the LVM container.
*sudo vgscan
+
*<code>sudo vgscan</code>
*sudo vgchange -ay
+
*<code>sudo vgchange -ay</code>
  
Mount all the filesystems that are already there so we can upgrade/install grub. Your paths may vary depending on your drive configuration.
+
Mount all the filesystems that are already there so we can upgrade/install grub. Your paths may vary depending on your drive configuration.
*sudo mkdir /media/USB
+
*<code>sudo mkdir /media/RESCUE</code>
*sudo mount /dev/pve/root /media/USB/
+
*<code>sudo mount /dev/pve/root /media/RESCUE/</code>
*sudo mount /dev/sda1 /media/USB/boot
+
*<code>sudo mount /dev/sda1 /media/RESCUE/boot</code>
*sudo mount -t proc proc /media/USB/proc
+
*<code>sudo mount -t proc proc /media/RESCUE/proc</code>
*sudo mount -t sysfs sys /media/USB/sys
+
*<code>sudo mount -t sysfs sys /media/RESCUE/sys</code>
*sudo mount -o bind /dev /media/USB/dev
+
*<code>sudo mount -o bind /dev /media/RESCUE/dev</code>
 +
*<code>sudo mount -o bind /run /media/RESCUE/run</code>
  
 
Chroot into your proxmox install.
 
Chroot into your proxmox install.
*chroot /media/USB
+
*<code>chroot /media/RESCUE</code>
  
Then upgrade grub and install it.
+
Then update grub and install it.
*grub-upgrade
+
*<code>update-grub</code>
*grub-install /dev/sda
+
*<code>grub-install /dev/sda</code>
  
 
If there are no error messages, you should be able to reboot now.
 
If there are no error messages, you should be able to reboot now.
  
 
Credit: https://www.nerdoncoffee.com/operating-systems/re-install-grub-on-proxmox/
 
Credit: https://www.nerdoncoffee.com/operating-systems/re-install-grub-on-proxmox/

Revision as of 15:06, 20 September 2021

During to the upgrade from 3.x to 4.x, I found myself without a working grub and unable to boot. Monitor shows:

  • grub rescue >

You can use Proxmox installation ISO in verison 5.4 or newer, and select debug mode. On the second prompt you'll have the full Linux tools, including LVM, ZFS, ..., available. If you exit that prompt you will come to the installation screens, simply hit abort there.

Alternatively, one can use a 64 bit version of Ubuntu or Debian Rescue CD.

Boot Proxmox VE in debug mode, or the Ubuntu/Debian off the ISO. We do not want to install Ubuntu/Debian, just run it live off the ISO/DVD.

First We need to activate LVM and mount the the root partition that is inside the LVM container.

  • sudo vgscan
  • sudo vgchange -ay

Mount all the filesystems that are already there so we can upgrade/install grub. Your paths may vary depending on your drive configuration.

  • sudo mkdir /media/RESCUE
  • sudo mount /dev/pve/root /media/RESCUE/
  • sudo mount /dev/sda1 /media/RESCUE/boot
  • sudo mount -t proc proc /media/RESCUE/proc
  • sudo mount -t sysfs sys /media/RESCUE/sys
  • sudo mount -o bind /dev /media/RESCUE/dev
  • sudo mount -o bind /run /media/RESCUE/run

Chroot into your proxmox install.

  • chroot /media/RESCUE

Then update grub and install it.

  • update-grub
  • grub-install /dev/sda

If there are no error messages, you should be able to reboot now.

Credit: https://www.nerdoncoffee.com/operating-systems/re-install-grub-on-proxmox/