How to Install Citrix XenServer 5.5 to a USB Hard drive

// September 13th, 2009 // Citrix XenServer

I’ll go ahead and cite the original owner first then go into changing his process to adapt to XenServer 5.5.  Chris Wolf is a genius: http://virtualizationreview.com/articles/2008/05/09/installing-and-running-xenserver-41-on-an-external-usb-drive.aspx

Ok now for the changes.  If you noticed I updated steps 12 and 13 because the kernel has changed since the article was written.

To get XenServer to successfully boot on an external USB drive, follow these steps:

  1. When the server boots, hit the hotkey for the boot options menu.
  2. Ensure that the XenServer installation CD is in the CD-ROM drive.
  3. In the boot options menu, select the option to boot from the CD-ROM.
  4. As soon as the Welcome to XenServer setup screen loads, immediately press the F2 key to view the advanced setup options.
  5. Now type shell and hit Enter.
  6. When the system finishes booting, run the following command to create a temporary folder where you will mount the external USB drive:

    mkdir /tmp/sda

  7. You will now mount the USB drive to the temporary location. Note that I’m assuming the USB drive is the only drive attached to the system and therefore is mounted as /dev/sda. To mount the first partition of sda to the /tmp/sda folder, run this command:

    mount -t ext3 /dev/sda1 /tmp/sda

  8. You will now need to copy the sys/block drivers from the setup environment to the USB drive. However, you will first need to change the driver file permissions prior to the copy. To do this, run this command:

    chmod -R 664 /sys/block

  9. You can now copy the contents of /sys/block to the USB drive. To do this, run this command:

    cp -R /sys/block/ /tmp/sda/sys/block/

    Note: Disregard the resultant “Input/Output error” message. The file copy will complete successfully.

  10. Next you need to change the root location to /tmp/sda. You can do this by running the command:

    chroot /tmp/sda

  11. Now let’s change to the /boot folder on the USB drive. To do this, run the command:

    cd /boot

  12. Now we will rename the original primary initrd image file because the new image file will have the same name as the original file for ease of configuration. To rename the primary initrd image file, run this command:

    mv initrd-2.6.18-128.1.6.el5.xs5.5.0.496.1012xen.img initrd-2.6.18-128.1.6.el5.xs5.5.0.496.1012xen.img.old

  13. Next, we’ll create a new initrd image that includes the USB driver. To do this, run this command:

    mkinitrd –with-usb initrd-2.6.18-128.1.6.el5.xs5.5.0.496.1012xen.img 2.6.18-128.1.6.el5.xs5.5.0.496.1012xen

  14. At this point, you will now be able to successfully boot XenServer from an external USB drive. To reboot, the server, type exit and hit Enter and then type reboot and press Enter. Remember to select the external USB drive from the boot options menu when the server boots.

Leave a Reply