ISCSI客户端配置:
-
yum install iscsi-initiator-utils
-
vim /etc/iscsi/initiatorname.iscsi
InitiatorName = iqn.2014-11...:Desktop0
-
systemctl restart iscsid.service
systemctl enable iscsid(与服务器通讯)
systemctl restart iscsi(读取iscsi文件)
systemctl enable iscsi
-
iscsiadm -m discovery -t st(send target) -p server0 可以man iscsiadmin 查看
-
yum -y install tree
tree /var/lib/iscsi/
-
systemctl restart iscsi
-
fdisk -l 可看到/dev/sda的盘,只要保证iscsi开启并且/var/lib/iscsi里的内容还在,那么开机后就会有iscsi的盘
-
fdisk /dev/sda; n,p,+500M,w,partprobe
mkfs.xfs /dev/sda1
mkdir /iscsidisk; blkid 获取UUID,用来挂载
-
vim /etc/fstab
UUID = "..." /iscsidisk xfs defaults, _netdev 0 0
-
mount -a 重启后查看是否挂载
-
出错时可以用: rm -rf /var/lib/iscsi/* 再重新做一遍 '
本文转自 拾瓦兴阁 51CTO博客,原文链接:http://blog.51cto.com/ponyjia/1866808