|Building an iSCSI Openfiler SAN on a USB Stick|
As I have now rebuilt my Openfiler 2.3 iSCSI box, I thought that it would be wise to document the procedure as I have installed Openfiler on a USB memory stick. This was something I’ve wanted to do this for a while now. Basically, I’m trying to cut back on the number hard disk drives in my environment. If therefore decided to install Openfiler on a USB memory stick instead of another hard drive. I could then run 4 750GB SATA drives in RAID10 and leave the Openfiler OS to run on the USB stick.
As most servers can boot from USB, I didn’t expect any issues with installing and booting Openfiler from USB. However, Openfiler doesn’t load the USB storage drivers when it boots by default. You’ll have to tweak the initrd image in order to boot from USB.
I recommend you use a 2GB or 4GB memory stick. Although Openfiler can install in less that 1GB, you still want to leave some free space for logs and swap space. I used the SanDisk Cruzer Micro 4GB as it's a small device (physically) and it's made out of metal and not plastic and should be a little more durable. However, this memory stick also has a plastic sleeve covering the memory stick, which I removed in order to keep the memory stick as cool as possible inside my server. The server I've used is the HP ProLiant ML115 G5. This server has a USB port located on the motherboard which is perfect! As the USB memory stick will be located inside the server, it won't be be dangling on the outside where it can be "removed" by "accident". You know what people are like ;-)
1. Unplug all SATA drives from the server. This is so that Openfiler detects the USB flash memory as /dev/sda and not as “/dev/sde” or something. It just makes things a little neater and simpler later on.
2. Power on the server and boot from the Openfiler 2.3 installation CD.
3. At the Openfiler Boot Menu, type linux expert and press enter. You have to parse the “expert command” or else the Openfiler installer will not display the USB flash memory as available storage to install Openfiler to.
4. When the installer has loaded, follow the screens until you get to decided whether to manually or automatically partition the drives. For normal installations automatic partitioning should be OK, however, as we will have to do some post install work on the kernel and the fact that we are only installing Openfiler on a 2GB or 4GB volume, we'll need more control over partition device numbers (/dev/sda1,2,3, etc) as well as partition sizes. I’ve therefore created my partitions manually as follows:
Some notes on partitioning:
5. Continue with installing Openfiler. As this is now installing on a USB 2.0 device, this may take a while longer than normal to complete. Mine took a good 50 minutes to install.
6. Once the installation has completed, keep the installation CD in the CD drive and reboot the server, this time booting from the Openfiler CD-ROM again and not from the newly installed Openfiler on the USB stick. If at this point you boot from the USB stick, the Kernel will not load USB storage drivers and won’t therefore be able to mount the root partition. This will result in a kernel panic.
7. When the server boots from the Openfiler CD, you will again be presented with the boot menu. This time, type: linux rescue
8. When asked to start the network system, choose “No”
9. At the rescue menu, choose “Skip”
10. At the prompt, create a new directory called system, and mount the root filesystem (/dev/sda3) to that directory
11. Now, mount the boot partition to /mnt/system/boot
mount /dev/sda1 /mnt/system/boot
12. Change the system root to /mnt/system. This allows you to work from /mnt/system as if it was the root filesystem
13. Now, extract the initrd image in /tmp
14. Create a new directory where we can extract the initrd files to and work on them
15. Extract the initrd files to the /tmp/tmp-initrd directory
16. Now we need to edit the init file under /tmp/tmp-initrd/. I like to use vi as my text editor. So, here we go:
Press to enter Inert Mode
Find the line with insmod /lib/sd_mod.ko
Enter the following lines after it:
To save the file and quit vi, press “:wq”
17. Now we have configured the init script to load some modules when the kernel boots, however, we now need to copy the actual module files to /lib/
18. Now, all we need to do is to pack it all in a .img file and place it in /boot/. We then need to tell grub (the boot loader) where to find it.
Find the line that contains the old initrd file and change the file name to usb-initrd.img
Save the grub.conf file and exit.
To reboot, type "exit" twice. The server should reboot and should now be able to mount /dev/sdb3when it boots from the USB stick.
- Simple VMware vSphere 4 & 5 License Calculator
- Clearing a GUID Partition Table (GPT) in Linux
- Building an iSCSI Openfiler SAN on a USB Stick
- Replace SSL Certificates: Replace vCenter Server SSL Certificates
- Replacing vSphere SSL Certificates
- My experiences with Installing vCenter on Windows Server 2008 R2
- Patching ESX 3.5 Using esxupdate
- Veeam FastSCP on Windows Server 2003 x64
- Restarting vmware-hostd
- A Deeper Look Into VMware vSphere 5 Licensing