码迷,mamicode.com
首页 > 系统相关 > 详细

【linux】Centos7 iscsi服务搭建

时间:2019-07-28 20:07:40      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:firewalld   fstab   uuid   ini   nod   art   color   xfs   ack   

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

【linux】Centos7 iscsi服务搭建

标签:firewalld   fstab   uuid   ini   nod   art   color   xfs   ack   

原文地址:https://www.cnblogs.com/grumpyhippo/p/11260276.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!