Tuesday, January 07, 2014

RedHat ES / CentOS / Oracle Linux - install from USB

  1. You need an 4GB USB Stick ... even better would be 8GB.
    You also need the original install media.
  2. Prepare your  USB Stick
    1. Method A
      The easy way might be to use Grub4DOS - but older server might no be able to boot from the stick.
    2. Method B
      So the safe method is to download RipLinux ISO image and mkusb.sh from the RipLinux Homepage (http://www.tux.org/pub/people/kent-robotti/looplinux/rip/) and to format the USB Stick with mkusb.sh according to the RipLinux documentation.
  3. Mount the USB stick and create a directory in the root directory to hold your Linux install files. I'll call mine /rhes65.
  4. Copy the installation files to the stick

    Mount the ISO image - and copy the content of the ISO to the stick.  I use tar for this purpose. Assuming your image is mounted to /media/cdrom and your stick is monted to /media/usb ...

    # tar -C /media/cdrom -c . | tar -C /media/usb -x -v
  5. Create an entry for grub (menu.lst) and syslinux (syslinux.cfg).  Edit those two files located on the USB in /boot/syslinux an add following lines:

    ### for syslinux.cfg ###
    LABEL Install RedHat ES 6.5! (64-bit kernel)
    KERNEL /rhel65/isolinux/vmlinuz
    APPEND initrd=/rhel65/isolinux/initrd.img ks=hd:sda1:/es65.cfg method=hd:sda1:/rhel65/

    ### for menu.lst ###
    title Install RedHat ES 6.5! (64-bit kernel)
    kernel /rhel65/isolinux/vmlinuz ks=hd:sda1:/es65.cfg method=hd:sda1:/rhel65/
    initrd /rhel65/isolinux/initrd.img
  6. Those entries assume, that you do want to supply an kickstart-file named es65.cfg located in / on the USB stick.  If you do not habe an kickstart file, simply remove the "ks=" option from the files above.
  7. Boot from the stick ... and have fun