linux 連接磁盤櫃

實驗環境:falcon存儲設備作服務器,redhat作客戶端

          IPStor控制檯


首先掛載光盤,安裝iscsi相關的rpm包

[root@localhost ~]# mkdir /data
[root@localhost ~]# mount /dev/cdrom /data
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@localhost data]# cd /data/Packages/
[root@localhost Packages]# ll iscsi*
-r--r--r-- 66 root root 670688 Oct 31  2012 iscsi-initiator-utils-6.2.0.873-2.el6.x86_64.rpm
[root@localhost Packages]# rpm -ivh iscsi-initiator-utils-6.2.0.873-2.el6.x86_64.rpm
warning: iscsi-initiator-utils-6.2.0.873-2.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature,
 key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:iscsi-initiator-utils  ########################################### [100%]


設置iscsi服務開機自動啓動

[root@localhost Packages]# chkconfig --level 35 iscsi on
[root@localhost Packages]# chkconfig --level 35 iscsid on
[root@localhost Packages]# chkconfig --list | grep iscsi
iscsi           0:off   1:off   2:off   3:on    4:on    5:on    6:off
iscsid          0:off   1:off   2:off   3:on    4:on    5:on    6:off


向服務器192.168.188.129發送請求

此時服務器並未發現該設備

[root@localhost Packages]# iscsiadm -h
iscsiadm -m discoverydb [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip
  :port -I ifaceN ... [ -Dl ] ] | [ [ -p ip:port -t type] [ -o operation ] [ -n name ] 
  [ -v value ] [ -lD ] ]
iscsiadm -m discovery [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip:port
 -I ifaceN ... [ -l ] ] | [ [ -p ip:port ] [ -l | -D ] ]
iscsiadm -m node [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -L all,manual,automatic ]
 [ -U all,manual,automatic ] [ -S ] [ [ -T targetname -p ip:port -I ifaceN ] 
 [ -l | -u | -R | -s] ] [ [ -o  operation  ] [ -n name ] [ -v value ] ]
iscsiadm -m session [ -hV ] [ -d debug_level ] [ -P  printlevel] [ -r sessionid | sysfsdir
 [ -R | -u | -s ] [ -o operation ] [ -n name ] [ -v value ] ]
iscsiadm -m iface [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -I ifacename | 
-H hostno|MAC ] [ [ -o  operation  ] [ -n name ] [ -v value ] ] [ -C ping [ -a ip ] 
[ -b packetsize ] [ -c count ] [ -i interval ] ]
iscsiadm -m fw [ -l ]
iscsiadm -m host [ -P printlevel ] [ -H hostno|MAC ] [ -C chap [ -o operation ]
 [ -v chap_tbl_idx ] ]
iscsiadm -k priority
[root@localhost Packages]# iscsiadm -m discovery -t sendtargets -p 192.168.188.129
Starting iscsid:                                           [  OK  ]
192.168.188.129:3260,0 iqn.2000-03.com.falconstor-ipstor.FalconStor-CDPVA.Everyone-iSCSI-0


此時要開啓控制檯,在控制檯上掃描新設備,添加客戶端,即可

wKiom1Pu_qrzudgVAAGYqRQ_WI0812.jpg

爲iscsi目標分配SAN資源:

wKiom1Pu_ueRW1hxAAEu_0yVHms923.jpg

然後爲客戶端分配資源

我們最終可以分配到3塊san資源

wKioL1PvAF-RjzOgAADNQUVR748089.jpg


重新啓動服務,並再次發送請求,可以看到19e6f857b0b1-0已經找到

[root@localhost Packages]# service iscsi restart
Stopping iscsi:                                            [  OK  ]
Starting iscsi:                                            [  OK  ]
[root@localhost Packages]# iscsiadm -m discovery -t sendtargets -p 192.168.188.129
192.168.188.129:3260,0 iqn.2000-03.com.falconstor-ipstor.FalconStor-CDPVA.19e6f857b0b1-0
192.168.188.129:3260,0 iqn.2000-03.com.falconstor-ipstor.FalconStor-CDPVA.Everyone-iSCSI-0
[root@localhost Packages]# iscsiadm -m node -T iqn.2000-03.com.falconstor-ipstor.FalconStor
-CDPVA.19e6f857b0b1-0 -p 192.168.188.129 -l
Logging in to [iface: default, target: iqn.2000-03.com.falconstor-ipstor.FalconStor
-CDPVA.19e6f857b0b1-0, portal: 192.168.188.129,3260] (multiple)
Login to [iface: default, target: iqn.2000-03.com.falconstor-ipstor.FalconStor-CDPVA.
19e6f857b0b1-0, portal: 192.168.188.129,3260] successful.


查看分區,多出了sdb,sdc,sdd,此次連接成功。

[root@localhost Packages]# fdisk -l
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x95e53976
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1306    10482688    7  HPFS/NTFS
Disk /dev/sdc: 21.5 GB, 21474836480 bytes
64 heads, 32 sectors/track, 20480 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdd: 21.5 GB, 21474836480 bytes
64 heads, 32 sectors/track, 20480 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000





發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章