ESX 3.5 update 4 issue -reinstall GRUB

Use a Live CD to boot your ESX host and fix the host from a chroot environment.

Boot from the Rescue CD.

Check device names for / and /boot filesystems.

For Example, Internal RAID /boot  can be /dev/cciss/c0d0p1  and / can be /dev/cciss/c0d0p7

Run the following command to mount the / filesystem and chroot to it:

mkdir /mnt/root

mount /dev/cciss/c0d0p7 /mnt/root

chroot /mnt/root

Run the following command to mount /boot filesystem to /boot mountpoint:

mount /dev/cciss/c0d0p1 /boot

Ensure the /boot  contains the kernel, initrd, grub/ subdir with stage* files, grub.conf and menu.lst , which is a symlink to grub.conf.

You need to replace anything from step 5 that is missing.

Run the following command if any of the stage files are missing:

cp /usr/share/grub/i386-redhat/* /boot/grub/

You can copy all the files from /usr/share/grub/i386-redhat/ to /boot/grub/ .

If grub.conf is missing, you have to create a new one or take a copy from another server.

An example of /boot/grub/grub.conf is:

vmware:configversion 1

# grub.conf generated by anaconda

#

# Note that you do not have to rerun grub after making changes to this file

# NOTICE: You have a /boot partition. This means that

# all kernel and initrd paths are relative to /boot/, eg.

# root (hd0,0)

# kernel /vmlinuz-version ro root=/dev/sdc2

# initrd /initrd-version.img

#boot=/dev/sdc

timeout=10

default=0

title VMware ESX Server

#vmware:autogenerated esx

root (hd0,0)

uppermem 277504

kernel –no-mem-option /vmlinuz-2.4.21-47.0.1.ELvmnix ro root=/dev/cciss/c0d0p7 mem=272M

initrd /initrd-2.4.21-47.0.1.ELvmnix.img

title VMware ESX Server (debug mode)

#vmware:autogenerated esx

root (hd0,0)

uppermem 277504

kernel –no-mem-option /vmlinuz-2.4.21-47.0.1.ELvmnix ro root=/dev/cciss/c0d0p7 mem=272M console=ttyS0,115200 console=tty0 debug

initrd /initrd-2.4.21-47.0.1.ELvmnix.img-dbg

title Service Console only (troubleshooting mode)

#vmware:autogenerated esx

root (hd0,0)

uppermem 277504

kernel –no-mem-option /vmlinuz-2.4.21-47.0.1.ELvmnix ro root=/dev/cciss/c0d0p7 mem=272M tblsht

initrd /initrd-2.4.21-47.0.1.ELvmnix.img-sc

If the server has multiple drives, LUNs, etc., it may be useful to create/edit a /boot/grub/device.map file, with the following content:

(hd0) /dev/cciss/c0d0p1

Where the device name in /dev/ is the boot partition device. Usage of the device.map file significantly speeds up the process, as the GRUB does not have to autodetect devices.

Run the /sbin/grub command if you are using device map file:

/sbin/grub –device-map=/boot/grub/device.map

Run the following command in the GRUB shell:

root (hd0,0)

Run the following command in the GRUB shell:

setup –stage2=stage2 –prefix=/grub (hd0)

Note: This is for setup, where /boot is (hd0) . If this did not work, you can try:

setup (hd0)

Run the quit command to exit the GRUB shell.

Run the following command:

sync

Reboot the server and remove the Rescue CD