1:[root@node1 ~]# yum install iscsi-initiator-utils*
2:
[root@node1 ~]# vim /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2012-05.com.a.node1
3:[root@node1 ~]# service iscsi start [ OK ]
iscsid dead but pid file exists
Turning off network shutdown. Starting iSCSI daemon: [ OK ]
[ OK ]
Setting up iSCSI targets: iscsiadm: No records found!
[ OK ]
[root@node1 ~]# chkconfig iscsi on
4:[root@node1 ~]# iscsiadm --mode discovery --type sendtargets --portal 192.168.2.100 发现存储设备
192.168.2.100:3260,1 iqn.2012-05.com.a.target
[root@node1 ~]# iscsiadm --mode node --targetname iqn.2012-05.com.a.target --portal 192.168.2.100:3260 --login 登录该设备
Logging in to [iface: default, target: iqn.2012-05.com.a.target, portal: 192.168.2.100,3260]Login to [iface: default, target: iqn.2012-05.com.a.target, portal: 192.168.2.100,3260]: successful 显示登录成功
5:[root@node1 ~]# fdisk -l
Command (m for help): p
Disk /dev/sdb: 1011 MB, 1011677184 bytes
32 heads, 61 sectors/track, 1012 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes
Device Boot Start End Blocks Id System
[root@node1 ~]# fdisk /dev/sdb
Command (m for help): p
Disk /dev/sdb: 1011 MB, 1011677184 bytes
32 heads, 61 sectors/track, 1012 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1002 977921+ 83 Linux
[root@node1 ~]# partprobe /dev/sdb
[root@node1 ~]# cat /proc/partitions
[root@node1 ~]# mkfs -t ext3 /dev/sdb1 对存储设备进行格式化
[root@node1 ~]# mkdir /mnt/sdb1
[root@node1 ~]# mount /dev/sdb1 /mnt/sdb1
[root@node1 ~]# cd /mnt/sdb1/
[root@node1 sdb1]# echo "hello the world " >index.html
[root@node1 sdb1]# cd
[root@node1 ~]# umount /dev/sdb1