Details / Overview

Recently I had the need to boot Openfiler from a USB flash (thumb) drive.

Note:  This installation method requires a Openfiler install to a hard disk, along with the USB drive
I am using the hard drive installation to create a usb-storage enabled initrd file and then
I copy this new file to the USB drive so that I can boot properly.

What is an initrd file?  
An initial ramdisk is a temporary file system used in the boot process of the Linux kernel

Requirements:

1. Openfiler CD or CD image
2. VMware Workstation / Server / Player
3. or Computer with hard drive
4. USB Drive

Procedure:

1. Get the Openfiler installation CD image (burn it if you need to install onto computer hardware)
or simply mount this to VMware Workstation / Server to boot from

2. Install Openfiler on hard drive (physical or virtual)

3. Install Openfiler on USB Drive.  I used ‘expert’ mode
 


Be sure to properly format your drive (hard disk & USB)

4. Remove your USB drive after install and boot the hard drive install of Openfiler

5. Log into the hard drive installation as root and change to the boot directory using “cd /boot”


6. Save the current initrd file as a backup by typing “mv <initrd filename> <initrd filename>.backup
You can make use of the <tab> key to auto complete the names of the files you are working with.
One of this simple things that help and ensure you do not make mistakes. 



7. Run mkinitrd to create a new initrd with the usb-storage module included.
This module is what is needed to permit the kernel to boot properly from the USB drive.
Type the following:  “mkinitrd –preload=usb-storage <initrd filename> <kernel version>

One of the things that gave me an issue with the kernel version.
To find this I typed the following: “uname -r” to show the version I was running.



You should now have the new initrd file.  You can confirm this by listing the directory.

8. Insert your USB drive.  The system should auto detect this drive and show you the device id.
If you missed this you can type the following: “fidsk -l” will list all the drive devices.
Be sure to select the correct drive (USB drive).



9. Mount the boot partition of the USB drive and change to that directory.
In my setup this was /dev/sdb1/
You can also do a “cat /proc/partitions’ and find the correct device in the partition list.

Type the following:

mkdir /media/usb
mount /dev/sdb1 /media/usb
cd /media/usb

10. Save the current initrd file on your USB drive to another name
Type the following: “mv <initrd filename> <initrd filename>.backup

11. Copy the initrd file you made on the hard disk install of Openfiler to the USB drive installation.
Type the following:  “cd /boot/<initrd filename>”



Note:
  please add a space and then the dot (.) so it will copy the file keeping the same name as the source.

After the copy, check to make sure the new initrd is there. Type: ls

12. After the copy you can unmount the USB drive to make sure all files have been synced properly
Type the following: cd /  <– this will back you out of the directory to the root of the disk
then type:  umount /media /usb

13. Power cycle (power off (shutdown) the system and then boot from the USB drive.
By this point the system should boot as normal and you now are running Openfiler from USB



I hope all of this was found helpful, and good luck!
– Jermal