linuxCentos7 iscsi服务搭建
Posted grumpyhippo
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linuxCentos7 iscsi服务搭建相关的知识,希望对你有一定的参考价值。
Server:
#yum -y install targetcli
#systemctl stop firewalld.service
#systemctl start target.service
#systemctl enable target.service
#fdisk /dev/vdb
n
p
1
+3G
w
#partprobe /dev/vdb
#ls /dev/vdb(TAB)
#pvcreate /dev/vdb1
#vgcreate iscsi_vg /dev/vdb1
#lvcreate -L 2G -n iscsi_lvm iscsi_vg
#targetcli
>/backstores/block create serverX.disk1 /dev/iscsi_vg/iscsi_lvm
>/iscsi create iqn.2017-07.com.example:serverX
>/iscsi/iqn.2017-07.com.example:serverX/tpg1/acls create iqn.2017-07.com.example:desktopX
>/iscsi/iqn.2017-07.com.example:serverX/tpg1/luns create /backstores/block/serverX.disk1
>/iscsi/iqn.2017-07.com.example:serverX/tpg1/portals create 172.25.X.11
>saveconfig
>exit
Desktop:
#yum -y install iscsi-initiator-utils.x86_64
#vim /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2017-07.com.example:desktop0
#iscsiadm -m discovery -t st -p 172.25.X.11
#systemctl restart iscsid
#systemctl restart iscsi
#systemctl enable iscsid
#systemctl enable iscsi
#iscsiadm -m discovery -t st -p 172.25.X.11
#iscsiadm -m node -T iqn.2017-07.com.example:serverX -p 172.25.X.11
#iscsiadm -m node -T iqn.2017-07.com.example:serverX -p 172.25.X.11 -l
#fdisk -l | dmesg | lsblk
#fdisk /dev/sdX
n
p
1
+xG
w
#partprobe /dev/sdX
#mkfs.xfs /dev/sdXX
#blkid /dev/sdXX >> /etc/fstab
UUID="" /mnt/iscsi xfs defaults,_netdev 0 0
#mkdir /mnt/iscsi
#mount -a
#df -h
#reboot
#df -h
以上是关于linuxCentos7 iscsi服务搭建的主要内容,如果未能解决你的问题,请参考以下文章