[CentOS] another iscsi question

Sat Dec 2 00:38:59 UTC 2006
Kevan Benson <kbenson at a-1networks.com>

On Friday 01 December 2006 07:51, James Fidell wrote:
> I have an iscsi array that I'd like to mount and share using NFS and I
> need it to happen without user intervention on a reboot.  In the default
> configuration this doesn't seem to work very well because the iscsi
> intiator isn't started until after the network is up (obviously) and by
> that time all local filesystems are mounted.  I can't mount the
> partitions in rc.local because NFS has already started.

Not too familiar with booting iscsi drives.  Is there a script run, or a 
syntax for /etc/fstab?

> Does a tidy way to handle this already exist, or do I need to do
> something like hack /etc/init.d/iscsi to mount and unmount iscsi
> partitions as necessary?

If you have a startup script, the SysV init system (/etc/rc.d/rc#.d, 
chkconfig) is useful for just this thing.  Looking in /etc/rc.d/rc3.d (rc5.d 
if you boot to X) will show you all the symlinks to init.d for starting and 
stopping processes.  The S## in the beginning of a symlink denotes that the 
process with be started (called through /etc/init.d with argument "start") 
and in which order (the number).  The K## in a symlink denotes that the the 
process is killed (called with argument "stop") in this runlevel, and the 
order.  The chkconfig(8) command automates the configuration of this process 
fairly well, and it's man page will explain more.

Looking at /etc/init.d/rc.d on my system show that the network is started at 
priority 10, and nfs at priority 60.  That leaves quite a bit of room to 
choose where in the boot order you want the iscsi drives mounted.

-- 
- Kevan Benson
- A-1 Networks