Iscsi linux client, iscsilinux
Use of iSCSI Linux clients
In Linux, you need to install the ISCSI client software iscsi-initiator. The installation process is as follows:
Step 0: Install the iSCSI client software through yum or rpm.
Step 1: Configure iSCSI
Open/etc/iscsi/iscsid. conf through vi:
# Vi/etc/iscsi/iscsid. conf
?
Set the user name and password (required when CHAP authentication is set on the target side. skip this step if CHAP authentication is not set on the target side ):
Node. session. auth. username = My_ISCSI_USR_NAME
Node. session. auth. password = MyPassword
Discovery. sendtargets. auth. username = My_ISCSI_USR_NAME
Discovery. sendtargets. auth. password = MyPassword
Step 2: Search for targets
Now you can use the iscsiadm command to search for and log on to the iSCSI targets. It can also read and access the open-iscsi database. If the IP address of your ISCSI storage server is 192.168.101.102, enter:
# Iscsiadm-m discovery-t sendtargets-p 192.168.101.102
The output shows the server address and iqn name.
Restart the iscsi service and you will see an additional block device in the/dev/directory. To obtain the name of the device, enter fdisk-l.
Step 3: Format and mount the iSCSI volume
You can use fdisk to partition/dev/sdb, and then use mkfs. ext3 to create a file system on/dev/sdb. The command is as follows:
Partition
# Fdisk/dev/sdb
......
Format
# Mkfs. ext3/dev/sdb1
Now, you can use the hard disk provided by server storage like a local hard disk.
Step 4: automatically mount the iSCSI Device when the system is started next time
First, make sure that the iscsi service runs when the system starts:
# Chkconfig iscsi on
Open the/etc/fstab file and add the following settings:
/Dev/sdb1/mnt/iscsi ext3 _ netdev 0 0
Save and exit
OK. It ends normally.