CentOS 配置iSCSI 远程存储 【内部操作手册】

服务器
yum -y install scsi-target-utils
/etc/init.d/tgtd restart
chkconfig tgtd on

如果没真实硬盘
使用当前文件系统建立一个镜像文件做测试
dd if=/dev/zero of=/usr/disk.img bs=1M count=512
添加设备
tgtadm –lld iscsi –op new –mode logicalunit –tid 1 –lun 1 -b /usr/disk.img
测试
tgtadm –lld iscsi –op show –mode target

开启
tgtadm –lld iscsi –op bind –mode target –tid 1 -I ALL
查看端口
netstat -tulpn | grep 3260

============== 真实硬盘 ==================
添加名称
tgtadm –lld iscsi –op new –mode target –tid 1 -T iqn.2013-09.com.example:storage.disk1
查看当前设置
tgtadm –lld iscsi –op show –mode target
添加Logical设备
tgtadm –lld iscsi –op new –mode logicalunit –tid 1 –lun 1 -b /dev/sdb1

vim /etc/tgt/targets.conf

backing-store /dev/sdb1
initiator-address ALL


# provided devicce as a iSCSI target
backing-store /dev/vg_target00/lv_target00
# iSCSI Initiator’s IP address you allow to connect
initiator-address 10.0.0.31
# authentication info ( set anyone you like for “username”, “password” )
incominguser username password

tgtadm –mode target –op show

客户端
yum -y install iscsi-initiator-utils

vi /etc/iscsi/iscsid.conf
# line 49: uncomment
node.session.auth.authmethod = CHAP
# line 53,54: uncomment and set username and password which set on iSCSI Target
node.session.auth.username = username
node.session.auth.password = password
# discover target

iscsiadm -m discovery -t sendtargets -p 10.0.0.30
chkconfig iscsi on
chkconfig iscsid on
iscsiadm -m node -o show

iscsiadm -m node –login
iscsiadm -m session -o show

cat /proc/partitions

vi /etc/fstab

/dev/sdb1 /var/kvm ext4 _netdev 0 0

chkconfig netfs on

挂载硬盘
fdisk -l
fdisk /dev/sdb
mkfs.ext4 /dev/sdb1
blkid /dev/sdb1
mount -a -O _netdev

相关:

  • 需要:httpd-mmn = 20051115
  • spokenkbd
  • polep2r
  • HQEN
  • directzon
  • centos安装iscsi
  • centos iscsi服务
  • bentz54
  • bellb1j
  • 822D

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

Scroll to top