Failed to start XenServer system with a new grub.cfg copied from another XenServer host.

Failed to start XenServer system with a new grub.cfg copied from another XenServer host.

book

Article ID: CTX341581

calendar_today

Updated On:

Description

Customer deleted grub.cfg by mistake, and copied the file from other host, but the affected host cannot boot now. 

Resolution

Correct the root partition label on /boot/efi/EFI/xenserver/grub.cfg
For UEFI boot mode:
1. Load XenServer installation ISO and press 'Alt+F2' to go into shell mode
2. Mount EFI partition /dev/sda4
mount /dev/sda4 /mnt
3. Confirm the current root partition label
e2label /dev/sda1
4. Modify grub.cfg to correct root partition label on /mnt/boot/efi/EFI/xenserver/grub.cfg
For example: 
menuentry 'XenServer' {
search --label --set root root-evpdld multiboot2 /boot/xen.gz dom0_mem=4096M,max:4096M watchdog ucode=scan dom0_max_vcpus=1-16 crashkernel=128M@256M console=vga vga=mode-0x0311 module2 /boot/vmlinuz-4.4-xen root=LABEL=root-evpdld ro nolvm hpet=disable xencons=hvc console=hvc0 console=tty0 quiet vga=785 splash plymouth.ignore-serial-consoles module2 /boot/initrd-4.4-xen.img
}
Change label 'root-evpdld' to the result of step 4.
5. Reboot the host

For Legacy boot mode:

1. Load XenServer installation ISO and press 'Alt+F2' to go into shell mode
2. Mount root partition /dev/sda1
mount /dev/sda1 /mnt
3. Confirm the current root partition label
e2label /dev/sda1
4. Modify grub.cfg to correct root partition label on /mnt/boot/grub/grub.cfg
For example: 
menuentry 'XenServer' {
search --label --set root root-evpdld multiboot2 /boot/xen.gz dom0_mem=4096M,max:4096M watchdog ucode=scan dom0_max_vcpus=1-16 crashkernel=128M@256M console=vga vga=mode-0x0311 module2 /boot/vmlinuz-4.4-xen root=LABEL=root-evpdld ro nolvm hpet=disable xencons=hvc console=hvc0 console=tty0 quiet vga=785 splash plymouth.ignore-serial-consoles module2 /boot/initrd-4.4-xen.img
}
Change label 'root-evpdld' to the result of step 4.
5. Reboot the host
 

Problem Cause

Incorrect root partition label in /boot/efi/EFI/xenserver/grub.cfg , because it's copied from another XenServer host and every XenServer system has different label.