UEFI booting Ubuntu 12.04 on PowerEdge 12G servers, Part 2

TechCenter

DellTechCenter.com is a community for IT professionals that focuses on Data Center and End User Computing best practices. Here you can learn about and share knowledge about Dell products and solutions.

UEFI booting Ubuntu 12.04 on PowerEdge 12G servers, Part 2

Earlier today, Jared blogged about a grub2 bug that can cause Ubuntu 12.04 to fail to boot on certain systems (including some of Dell’s 12G servers). He talked about how to install Ubuntu with the system in BIOS mode, and then change it to UEFI mode after installing a newer version of grub2.

I’d like to mention an another way to get around this bug and install Ubuntu with the system in UEFI mode, as normal, by simply using the older, “legacy” GRUB on a USB key to boot into the Ubuntu installer. Note that this method, too, is not officially supported.

To install Ubuntu Server 12.04 with this workaround, follow these steps:

Acquire a USB flash drive with a FAT filesystem (or containing a partition with a FAT filesystem). Many USB flash drives come with an already-formatted FAT filesystem--otherwise use “parted” or “fdisk” and “mkfs.vfat” tools in linux to create a partition and format it with a FAT filesystem.

On the USB flash drive, create a directory /EFI/BOOT.

Mount the CentOS image (“mount –oloop CentOS-6.3-x86_64-minimal.iso /mnt”, for example), and copy the files below from the CentOS image to the /EFI/BOOT directory on the USB flash drive.

EFI/BOOT/BOOTX64.efi

EFI/BOOT/BOOTX64.conf

EFI/BOOT/splash.xpm.gz

Mount the Ubuntu 12.04 Server CD, and copy the files below from the Ubuntu disk to the /EFI/BOOT directory on the USB flash drive:

Next, edit the file EFI/BOOT/BOOTX64.conf on the USB flash drive. Remove all of the lines below the word “hiddenmenu”, and add the following three lines to the end of the file:

title Ubuntu 12.04

kernel /EFI/BOOT/vmlinuz

initrd /EFI/BOOT/initrd.gz

Put the USB flash drive and the Ubuntu CD into the system on which you want to install Ubuntu, and boot to the USB flash drive (hit “F11” during boot on Dell’s 12G servers to get the UEFI boot menu). The USB flash drive will boot up, and you can install in UEFI mode as normal from the CD.

IMPORTANT: After Ubuntu has been installed, but before the system is rebooted, follow these steps to install the working version of grub2 on your newly-installed system. (A good point to do this on Ubuntu Server is when it pops up the “Finish the installation” window and asks if your clock is set to UTC.)

Go to virtual terminal 2 (hit alt-F2), and chroot into the installed system (“chroot /target”).

Note that the same instructions should work with Ubuntu Desktop 12.04, except that the files to be copied from the Ubuntu desktop CD are /casper/vmlinuz and /casper/initrd.lz (instead of /install/vmlinuz and /install/initrd.gz), and the three lines added to the BOOTX64.conf file should look like this (the kernel parameters were just copied from the “Install Ubuntu” boot entry in the file boot/grub/grub.cfg on the Ubuntu CD):