You must have the following information for the nodes on which you installed the iSCSI initiator:
- IP address
- Host name
- InitiatorName, which was generated during iSCSI Initiator installation
-
Inform the iSCSI target server administrator of the iSCSI node:
- IP address
- Host name
- InitiatorName, which was generated during iSCSI Initiator installation
-
Start the iscsi daemon by typing:
/etc/init.d/open-iscsi start
Refer to the Linux manual page iscsiadm for more information about the command.If this is the first time the daemon has been started, no iSCSI targets have been defined.
Starting iSCSI initiator service: done iscsiadm: no records found! Setting up iSCSI targets: unused
-
Discover the target server by typing the following code:
# iscsiadm -m discovery --type=st --portal=target IP address and TCP port
In the example, 192.168.15.51 is the IP address and TCP port.
192.168.15.51:3260,1 iqn.1991-05.com.microsoft:bsrv25-abu2850gb-target
Multiple target servers are displayed if one or both of the following conditions apply:- More than one target has been configured for the iSCSI Qualified Name (IQN) at the target server
- More than one Ethernet interface is accessible to the target server
-
If you receive a header read timed out message:
- Check the connection to the iSCSI target server using the ping command.
- Unless there is a hard failure, retry the discovery.
- Log onto the target device. # iscsiadm -m node -T <target name > --portal <target IP address and TCP port> --login An example of a target name is iqn.1991-05.com.microsoft:bsrv25-abu2850gb-target.
- Assign the /dev node assigned to the iSCSI device. ls -l /dev/disk/by-path/ip* lrwxrwxrwx 1 root root 9 Jan 14 10:22 /dev/disk/by-path/ip-192.168.15.51:3260-iscsi-iqn.1991-05.com.microsoft:bsrv25-abu2850gb-target-lun-0 -> ../../sdam
-
Create a Linux partitioned disk.
sfdisk <device node>
In the following example, /dev/sdam is the device node.
sfdisk /dev/sdam
-
Make a file system for partition 1.
mkfs -t xfs -L <label> <device partition 1>
In the following example, book4a is the user-defined label and /dev/sdam1 is device partition 1.
mkfs -t xfs -L book4a /dev/sdam1
- Press Enter and accept the defaults. A file system for partition 1 is created. Partition 1 takes the entire Logical Unit Number (LUN).
- For a DOS partition, zero out the first 512 bytes. dd if=/dev/zero of=<device partition 1> bs=512 count=1