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 to the iSCSI device. ls -l /dev/disk/by-path/ip* /dev/disk/by-path/ip-192.168.15.51:3260-iscsi-iqn.1991-05.com.microsoft:bsrv25-abu2850gb-target-lun-0 -> ../../sdam
-
Initialize the device as a GUID Partition Table (GPT), create one partition using the parted utility, and make the xfs file system.
In the following code example:
- Commands are in bold font
- /dev/sdam is the device node
- 0 2831 specifies the start and end of the configured partition
- book4a is the user-created label
- /dev/sdam1 is device partition 1
# parted /dev/sdam GNU Parted 1.6.25.1 Copyright (C) 1998 - 2005 Free Software Foundation, Inc. This program is free software, covered by the GNU General Public License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Using /dev/sdam (parted) mklabel gpt (parted) unit gb (parted) print Disk geometry for /dev/sdam: 0GB - 2831GB Disk label type: gpt Number Start End Size File system Name Flags (parted) mkpart primary 0 2831 (parted) print Disk geometry for /dev/sdam: 0GB - 2831GB Disk label type: gpt Number Start End Size File system Name Flags 1 0GB 2831GB 2831GB (parted) quit Information: Don't forget to update /etc/fstab, if necessary. # mkfs -t xfs -L book4a /dev/sdam1 meta-data=/dev/sdam1 isize=256 agcount=32, agsize=21599999 blks = sectsz=512 attr=0 data = bsize=4096 blocks=691199968, imaxpct=25 = sunit=0 swidth=0 blks, unwritten=1 naming =version 2 bsize=4096 log =internal log bsize=4096 blocks=32768, version=1 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=4096 blocks=0, rtextents=0 #