View Full Version : FreeBSD + ISCSi + Openfiler
LaR3
November 17th, 2008, 14:32
Hello,
Does anyone know how to make FreeBSD 7 add the iscsi targets automatically after reboot ??
P.S. Configuring /etc/iscsi.conf and iscsi_initiator_load="yes" in /boot/loader.conf doesn't do the job.
And I'm not looking for some workaround like cron @reboot.
I searched all the man pages but didn't find anything.
JohnNielsen
November 18th, 2008, 08:52
The loader.conf addition will load the kernel module at boot, and /etc/iscsi.conf defines the targets you (might) want to use. To actually attach a target to the initiator you need to run "iscontrol -n NAME", where NAME is one of the targets you have defined in iscsi.conf.
I would like to see an rc script that attaches specified targets at boot but unfortunately there is not one included with the base system currently. That doesn't mean you can't write your own, however. IIRC there are even example scripts floating around, though I don't have a link to one handy.
LaR3
November 18th, 2008, 14:00
it works with cron
@reboot (iscontrol -n target; sleep 10; mount /dev/daX /path)
The thing is that an rc script would be useless, if you want to have the filesystem mounted at boot time within /etc/fstab.
vivek
November 19th, 2008, 14:40
How about /usr/local/etc/rc.d/mount.iscsi.sh with following line:
#!/bin/sh
iscontrol -n target
sleep 10
mount /dev/daX /path
See rc(8) and rcorder(8).
LaR3
November 19th, 2008, 15:16
Vivek, probably will not get executed at startup. But anyways, I'm intereted in having the filesystem mounted from fstab. That would mean that when the kernel loads iscsi_initiator module, to automatically see the /dev/daX device. Untill then, either cron or rc script :)
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.