CentOS7.9连接ISCSI
安装iscsi客户端
sudo yum install binutils iscsi-initiator-utils kmod-xfs xfsprogs -y
sudo service iscsi start
sudo systemctl enable iscsi
查找存储映射
sudo iscsiadm -m discovery -t sendtargets -p 192.168.1.107:3260
连接存储
sudo iscsiadm -m node -T iqn.2000-01.com.synology:DS1621plus.Target-2.8172b906b2f -p 192.168.1.107 -l
查看已连接的存储
sudo fdisk -l
自动登录并挂载
sudo iscsiadm -m node --op=update -n node.conn[0].startup -v automatic
sudo iscsiadm -m node --op=update -n node.startup -v automatic
sudo iscsiadm -m node --loginall=automatic
编辑/etc/fstab
/dev/sdb1 /workspace xfs _netdev 0 0
问题处理
无法登录
root@vmub:/# sudo iscsiadm -m node -T iqn.2000-01.com.synology:DS1621plus.Target-1.8172b906b2f -p 192.168.1.107 -l
Logging in to [iface: default, target: iqn.2000-01.com.synology:DS1621plus.Target-1.8172b906b2f, portal: 192.168.1.107,3260] (multiple)
iscsiadm: Could not login to [iface: default, target: iqn.2000-01.com.synology:DS1621plus.Target-1.8172b906b2f, portal: 192.168.1.107,3260].
iscsiadm: initiator reported error (19 - encountered non-retryable iSCSI login failure)
iscsiadm: Could not log into all portals
删除如下路径下的信息
rm -rf /etc/iscsi/nodes/*
rm -rf /etc/iscsi/send_targets/*
本文来自博客园,作者:GreeneGe,转载请注明原文链接:https://www.cnblogs.com/greene/p/16121284.html