Friday Jan 11, 2013

How to Install Oracle Linux from a USB Stick


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.


  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... 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
    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

Wednesday Jan 09, 2013

How to Treat an NFS File As a Block Storage Device


Wim actually beat me in blogging about this feature while I was on vacation, but I'd like to add a little more background about dm-nfs, which I gathered from our kernel developers:

What is dm-nfs?

The dm-nfs kernel module provides a device-mapper target that allows you to treat an NFS file as a block device. It provides loopback-style emulation of a block device using a regular file as backing storage. The backing file resides on a remote system and is accessed via the NFS protocol.

The general idea is to have a more-efficient-than-loop access to files on NFS. The device mapper module directly converts requests to the dm device into NFS RPC calls.

dm-nfs is used transparently by Oracle VM's Dom0 when mounting NFS-backed virtual disks. It essentially allows for asynchronous and direct I/O to an NFS-backed block device, which is a lot faster than normal NFS for virtual disks. The Xen block hotplug script has been modified on OVM to look for files which are on NFS filesystems. If the file is on NFS, OVM uses dm-nfs automatically, otherwise it falls back to using the regular (but slower) loop mount method.

The original dm-nfs module was written by Chuck Lever. It has been supported and used by Oracle VM since version 2.2 and is also included in the Unbreakable Enterprise Kernel for Oracle Linux.

Why this feature matters

This feature creates virtual disk devices (LUNs) where the data is stored in an NFS file instead of on local storage. Managed networked storage has many benefits over keeping virtual devices on a disk local to the physical host.

A sample use case is the fast migration of guest VMs for load balancing or if a physical host requires maintenance. This functionality is also possible using iSCSI LUNs, but the advantage of dm-nfs is that you can manage new virtual drives on a local host system, rather than requiring a storage administrator to initialize new LUNs on the storage subsystem. Host administrators can handle their own virtual disk provisioning.

For durability and performance, dm-nfs uses asynchronous and direct I/O so all I/O operations are performed efficiently and coherently. Guest disk data is not double cached on the underlying host. If the underlying host crashes, there's a lower probability of data corruption. If the guest is frozen, a clean backup can be taken of the virtual disk, as you can be certain that its data has been fully written out.

How to use it

You use dm-nfs by first loading the kernel module, then using dmsetup to create a device mapper device on your file. The syntax is very similar to the dm-linear module.

The following sample code demonstrates how to use dmsetup to create a mapped device (/dev/mapper/$dm_nfsdev) for the file $filename that is accessible on a mounted NFS file system:

nblks=`stat -c '%s' $filename`
echo -n "0 $nblks nfs $filename 0" | dmsetup create $dm_nfsdev

Now you can mount /dev/mapper/$dm_nfsdev like any other filesystem image.

- Lenz Grimmer (Oracle Linux Blog)

Website Newsletter Facebook Twitter

Rick Ramsey
Kemer Thomson
and members of the OTN community


« January 2013 »
Blogs We Like