Linux iSCSI Preparation Script

From DFWLPiki
Jump to: navigation, search


Here is a simple script I use to set up and get ready for iSCSI.

prepareiscsi.sh:

#/bin/bash
yum install iscsi-init* -y
/etc/init.d/iscsi start
/etc/init.d/iscsid start
cat /etc/iscsi/initiatorname.iscsi

The above installs iscsi initiator, starts iscsi, then prints the local initiator wwn. I then manually input this wwn (thus, why I output it so i can copy it) into the access list in the iscsi SAN for the specific lun this system will access.


Next, we discover against the portal, and then log into all available iSCSI luns: iscsiloginall.sh

#!/bin/bash
iscsiadm -m discovery -t sendtargets -p 10.32.10.21
iscsiadm -m node -p 10.32.10.21 -l

After this is complete, I will normally move on to Filesystem creation