1、安装iscsi initiator客户端程序
2、查找存储服务端initiator targets信息
3、连接服务端(-T 节点名称为上面查找输出的服务端信息)
4、客户端查看自身initiator信息
5、在存储端添加启动器做好磁盘映射(启动器名称则就是客户端initiator信息),如下图:
6、客户端登出重新连接服务端,即可发现新的磁盘信息
[root@jbxue ~]# iscsiadm -m node -T iqn.1994-12.com.promise.6c.63.55.55.1.0.0.20 -p 192.168.6.252 --logout
[root@jbxue ~]# iscsiadm -m node -T iqn.1994-12.com.promise.6c.63.55.55.1.0.0.20 -p 192.168.6.252 --login
[root@jbxue ~]# fdisk -l
Disk /dev/hda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 1044 8281507+ 8e Linux LVM
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 182364 1464838798+ 42 SFS
[root@jbxue ~]# mkfs.ext3 /dev/sda1
[root@jbxue ~]# mkdir -p /iscsi
[root@jbxue ~]# mount /dev/sda1 /iscsi
[root@jbxue ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
ext3 6.6G 3.9G 2.4G 62% /
/dev/hda1 ext3 99M 12M 82M 13% /boot
tmpfs tmpfs 123M 0 123M 0% /dev/shm
/dev/sda1 ext3 20G 173M 19G 1% /iscsi
8、添加开机自动挂载
9、防止重启关机处卡死
[root@jbxue ~]# vi /etc/rc6.d/K04iscsi
#!/bin/bash
. /etc/init.d/functions
umount /dev/sda1
iscsiadm -m node --logoutall=all
[root@jbxue ~]# chmod 777 /etc/rc6.d/K04iscsi
10、iscsi其它参数介绍: