How to Install Oracle Linux from a USB Stick

source

If you want to install Oracle Linux from a USB drive, keep in mind that not all hardware supports USB device booting. Also, during the boot process you may have to instruct your BIOS to boot from that specific USB device. Finally, keep in mind that this method of installation is not officially sanctioned by Oracle support. You'll need an Oracle Linux 6.0 or higher system to produce the key. Earlier versions may work, but additional prerequisites may be required. The examples in this article assume a USB key device name of /dev/sdb1. Be sure to verify the device name of your USB key to avoid accident data loss.

Prerequisites

  1. The first thing you will need is an ISO image of Oracle Linux. The quickest way to obtain an ISO image is from the Oracle Software Delivery Cloud
  2. You will need a desktop or server system running Oracle Linux in order to prepare your USB drive.
  3. You will also need to download this script to create the bootable USB drive.
  4. Your Oracle Linux system will also need the package syslinux installed. You can install syslinux using yum with the following command:
  5. yum install syslinux

Marking Partition One as Bootable

Once your prerequisites are in order, you need to designate partition one as bootable. Use the parted application, as in this example:

[root@host]# parted /dev/sdb 
GNU Parted 2.1 Using /dev/sdb Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) toggle 1 boot
(parted) quit
Information: You may need to update /etc/fstab.

The example above uses a USB key labelled /dev/sdb. The parted application will only accept device files without partition numbers. So, if we had selected /dev/sdb1 instead, we would have gotten an error message when we tried to write the changes to disk.

Creating the USB Key

Now you can start creating USB key via the script that you downloaded earlier. The script accepts two paths: first the source ISO file and then the USB key:

[root@host]# sh Install_OL_fromUSBStick_Script --reset-mbr /home/user/OL6.3.iso /dev/sdb1 
Verifying image...
livecd-iso-to-disk.sh: line 527: checkisomd5: command not found Are you SURE you want to continue?
Press Enter to continue or ctrl-c to abort
Size of DVD image: 2957
Size of images/install.img: 132
Available space: 31186
Copying DVD image to USB stick
install.img
    137834496 100%   10.87MB/s    0:00:12 (xfer#1, to-check=0/1)
sent 137851396 bytes  received 31 bytes  11028114.16 bytes/sec total size is 137834496  speedup is 1.00
sent 37 bytes  received 12 bytes  98.00 bytes/sec total size is 3100217344  speedup is 63269741.71 Updating boot config file Installing boot loader USB stick set up as live image!

Once the script is finished running you have a bootable USB drive that can install Oracle Linux. While booting, pay attention to your BIOS boot screens as they will often provide direction on how to select a specific boot device other than the ones in the standard boot sequence. For some older systems you may need to go directly into the BIOS setup utility to specify the USB device in your boot sequence. Once you have booted successfully off of your USB device and the installer starts installation will proceed just like an installation from regular DVD media.

- Robert Chase

Website Newsletter Facebook Twitter
Comments:

script wouldn't work under OEL 5.6/5.8 because:
extlinux -i not supported
udevadm command not available

also it would be helpfull to explain how to prepare the USB stick because script expects an ext2 filesystem on the stick

Regards

Edmund

Posted by guest on April 25, 2013 at 08:23 AM MDT #

Very helpful, thank you!

Posted by guest on April 29, 2013 at 12:11 AM MDT #

The script you link to does not have the same name as the script mentioned in the body of the blog entry, which is a little confusing initially and adds work for whoever is trying this out.

Also this script appears to be an older/modified version of the script found in the livecd-tools package. Installing the package will install any dependencies such as extlinux whereas running just the script means you have to discover things by trial and error. This can be frustrating if you see "command not found" after the script has been running for a long time.

It's also a little disingenuous to self-host a script without providing any attribution.

Posted by guest on August 06, 2013 at 04:15 AM MDT #

Thanks, guest, for the correction. Looking into it ... will get back to you.

Rick

Posted by guest on August 06, 2013 at 08:53 AM MDT #

Thanks for your comments. We will be updating this article shortly to address several of the issues mentioned in the comments.

Robert Chase

Posted by guest on August 16, 2013 at 10:21 AM MDT #

It worked, thanks a lot!
In addition, i was running the installation using a kickstart file, now my installation can be ran automatically with the least human interaction! :)

Posted by guest on November 28, 2013 at 02:24 AM MST #

Somewhat ironic to have to install Oracle LInux so I can prepare a USB drive to install Oracle Linux. I'm pretty sure this means I can't install Oracle Linux, unless you know better...

Posted by guest on December 17, 2013 at 08:04 AM MST #

This does not work. Here is what it says when I run the script.

readlink: unrecognized option '--reset-mbr'
Try `readlink --help' for more information.
Missing source

Posted by guest on January 09, 2014 at 08:20 AM MST #

>Somewhat ironic to have to install Oracle LInux so I can prepare a USB drive to install Oracle Linux.

Download Oracle VM Virtualbox. It is available for Windows and different linux distributions. Create a virtual machine. Install Oracle linux on that one. (It is possible mounting the iso image.) Follow the instructions above. Have a USB stick of 8 GB or more, 4 GB won't be enough. The whole process may need several hours.

And don't be surprised: the Oracle linux has no GUI. You have to do everything from command line.

Posted by atzs on January 24, 2014 at 08:29 AM MST #

It would be probably worth to mention 3 things before running this script.

a) after creating 1st partition on your USB device, format it with vfat, ext2 or ext3 filesystem.
b) before running script, make sure nothing is mounted under /media
c) The full command to run script would be similar to:

sh Install_OL_fromUSBStick_Script --reset-mbr /home/user/OL6.3.iso /dev/sdb1

THis assumes that /dev/sdb1 is your USB device

Posted by guest on March 04, 2014 at 07:13 AM MST #

Thank you for the great feedback here! I'm going to be making some changes to the article in a moment here to assist in it's clarity. I am looking into some alternate ways of creating bootable USB keys for Oracle Linux and may be updating this article soon with some other options.

The script will take care of the file system by itself. It does not matter to the script what's currently on the key.

For the person that had the "readlink: unrecognized option '--reset-mbr'" error. Could I get some more information about your system? Is it Oracle Linux 6?

Posted by Robert Chase on March 07, 2014 at 04:06 PM MST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Contributors:
Rick Ramsey
Kemer Thomson
and members of the OTN community

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
12
13
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
Blogs We Like