Le 26/02/2020 à 20:52, BERTRAND Joël a écrit : > Hello, > > I continue my tests with iSCSI. My server runs NetBSD 9.0 and istgt to > offer to several diskless workstations : > - nfs (/ and /home) > - iSCSI targets (swap). > > Linux clients run as expected. This evening, I have booted a diskless > NetBSD client (NetBSD 9.0). If iSCSI initiator works fine, I don't know > how configure iSCSI initiator to automatically start at boot time... Of > course, iscsid is launched in /etc/rc.conf, but I have to mount iSCSI > targets at shell prompt. Any idea ? > > Best regards, > > JKB >
Hi Bertrand, I have a SAN at online.net and I wanted to mount it at boot time. Then I wrote a /etc/rc.d/iscsictl file: --------8<--------8<--------8<-------- $_rc_subr_loaded . /etc/rc.subr name="iscsictl" rcvar="$name" start_cmd="iscsictl_start" iscsictl_start() { $name add_send_target -a $rc_flags sleep 1 $name refresh_targets $name login -P 1 } load_rc_config $name run_rc_command "$1" --------8<--------8<--------8<-------- I use it by adding: iscsictl=YES iscsictl_flags="san-dcX-Y.rpn.online.net" Then, I could use /etc/fstab to the disk that has been attached to sd0. Fred