Loading the Driver via udev or Init Script for md and LVM Loading the Driver via udev or Init Script for md and LVM
There are two main methods for loading the Fusion-IO Driver: udev and the iodrive script. The default method of loading is udev.
Using udev to Load the Driver
Most modern linux distributions use udev to facilitate driver loading. Usually it just works, behind the scenes, loading drivers.
udev automatically loads drivers for installed hardware on the system. It does this by walking through the devices on the PCI bus, and then loading any driver that has been properly configured to work with that device. This way, drivers can be loaded without having to use scripts or modify configuration files. The Fusion-io drivers are properly configured, and udev will find the drivers and attempt to load them.
However, there are some cases where loading by udev is not appropriate, or can have issues.
Udev will wait 180 seconds for the driver to load, then it will exit. In most cases, this is plenty of time, even with multiple ioDrives installed. But if the drives were shut down improperly, loading the driver and attaching the drives takes longer than the 180 seconds. In this case, udev will exit. The driver will not exit, but will continue working on attaching the drives.
There is not always a problem when udev exits early. The drivers will eventually load, and then you will be able to use the attached block devices. But, if the drivers do take too long to load, and udev does exit, and filesystems are set to be mounted in the fstab, then the system file system check (fsck) will fail, and the system will stop booting. In most distributions the user will drop into a single-user mode, or repair mode.
Again, this is normal behavior; after the driver finishes rescanning and attaching the drive, a reboot will fix things. For most users, this will not happen often enough to be an issue.
But for installations with many devices, or for server installations where dropping into single-user mode is unacceptable, there is an alternative method for driver loading that does not have these issues.
Using Init Scripts to Load the Driver
The ioDriver packages provide init scripts that are installed on all supported Linux distributions. These scripts typically reside in /etc/init.d/iodrive or /etc/rc.d/iodrive. The scripts are used to load and start the driver, and to mount filesystems, after the system is up. This method completely avoids the udev behavior described above. (It will wait as long as it takes for drives to be attached).
NOTE: These steps assume that the logical volumes /dev/md0 (md) and /dev/vg0/fio_lv (LVM) have been setup beforehand. There are other knowledgebase articles that provide details for logical volume creation, including updating lvm.conf to work with ioDrives.
Step 1: Modifying /etc/modprobe.d/iodrive
Edit /etc/modprobe.d/iodrive, and uncomment the blacklist line:
Before:
# To keep ioDrive from auto loading at boot, uncomment below
# blacklist fio-driver
After:
# To keep ioDrive from auto loading at boot, uncomment below
blacklist fio-driver
This keeps udev from automatically loading the driver
Step 2: Modifying /etc/fstab
Add noauto to the options in the appropriate line in the /etc/fstab file. This will keep the OS from trying to check the drive for errors on boot.
Before:
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda5 swap swap defaults 0 0
/dev/md0 /iodrive_mountpoint ext3 defaults 1 2
/dev/vg0/fio_lv /iodrive_mountpoint2 ext3 defaults 1 2
After:
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda5 swap swap defaults 0 0
/dev/md0 /iodrive_mountpoint ext3 defaults,noauto 0 0
/dev/vg0/fio_lv /iodrive_mountpoint2 ext3 defaults,noauto 0 0
Step 3: Modifying /etc/sysconfig/iodrive
Edit /etc/sysconfig/iodrive, and add the mountpoint to the MOUNTS variable, so it will be automatically attached and mounted:
Before:
# An IFS separated list of md arrays to start once the driver is
# loaded. Arrays should be configured in the mdadm.conf file.
# Example: MD_ARRAYS="/dev/md0 /dev/md1"
MD_ARRAYS=""
# An IFS separated list of LVM volume groups to start once the driver is
# loaded. Volumes should be configured in lvm.conf.
# Example: LVM_VGS="/dev/vg0 /dev/vg1"
LVM_VGS=""
# An IFS separated list of mount points to mount once the driver is
# loaded. These mount points should be listed in /etc/fstab with
# "noauto" as one of the mount options.
# Example /etc/fstab:
#/dev/fioa /mnt/fioa ext3 defaults,noauto 0 0
#/dev/fiob /mnt/firehose ext3 defaults,noauto 0 0
# Example: MOUNTS="/mnt/fioa /mnt/firehose"
MOUNTS=""
After:
# An IFS separated list of md arrays to start once the driver is
# loaded. Arrays should be configured in the mdadm.conf file.
# Example: MD_ARRAYS="/dev/md0 /dev/md1"
MD_ARRAYS="/dev/md0"
# An IFS separated list of LVM volume groups to start once the driver is
# loaded. Volumes should be configured in lvm.conf.
# Example: LVM_VGS="/dev/vg0 /dev/vg1"
LVM_VGS="/dev/vg0"
# An IFS separated list of mount points to mount once the driver is
# loaded. These mount points should be listed in /etc/fstab with
# "noauto" as one of the mount options.
# Example /etc/fstab:
#/dev/fioa /mnt/fioa ext3 defaults,noauto 0 0
#/dev/fiob /mnt/firehose ext3 defaults,noauto 0 0
# Example: MOUNTS="/mnt/fioa /mnt/firehose"
MOUNTS="/iodrive_mountpoint /iodrive_mountpoint2"
Step 4: Verifying the Status of the Init Script
Make sure the iodrive script loads at run levels 1 through 5 (runlevel 0 is shutdown and runlevel 6 is reboot).
Run the following commands:
$ chkconfig iodrive on
$ chkconfig --list iodrive
iodrive 0:off 1:on 2:on 3:on 4:on 5:on 6:off