Skip to main content
GRUB2Ubuntu

Booting to a recovery ISO with GRUB2 in Ubuntu 12.04 Server

By April 13, 2013September 12th, 2022No Comments

As part of your recovery system on your servers you may require a rescue system to be available from the boot menu. In the event of failure, so long as the boot files are still accessible and the ISO to boot from, we can boot to the recover ISO and use the tools to repair our host system. We will look at the Ubuntu Recovery Remix ISO and include this in our GRUB menu. Firstly we will need to download the ISO file from http://ubuntu-rescue-remix.org/Version12-04 and add the file to our server. In the example we add the ISO file to the /boot/iso directory on our Ubuntu 12.04 server. With the ISO in place we can look at editing our 40_custom file in /etc/grub.d or, if we feel it necessary, creating a new file.

menuentry "Remix Recovery"  {
 insmod part_msdos
 insmod ext2
 set isofile="/boot/iso/ubuntu-rescue-remix-12-04.iso"
 loopback loop (hd0,1)$isofile
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject
 initrd (loop)/casper/initrd.gz}
  1. menuentry “Remix Recovery” { : Here we create the new menu item for the ISO. If required we could add the –users option to requires superuser access.
  2. insmod part_msdos : The two insmod lines load the required drivers to be able to access the ISO file.
  3. set isofile=”/boot/iso/ubuntu-rescue-remix-12-04.iso” : Creeating a GRUB2 varible that references the ISO.
  4. loopback loop (hd0,1)$isofile : Here we mount the ISO file using the loopback devices.
  5. Then we load the kernel and ramdisk from the ISO.