我用过目标命令行创建 LUN。
查看我的配置:
o-/ ........................................................................................................................... [...] o- 后台存储................................................................................................................ [...] | o- 块................................................................................................................ [存储对象:0] | o- fileio ................................................................................................ [存储对象:1] | | o- disk1 ........................................................... [/disks/disk1.fileio (200.0MiB) 已激活直写功能] | | o- 阿鲁阿 ........................................... ................................................ .. [ALUA 组:1] | | o- default_tg_pt_gp ......................................................................... [ALUA 状态:活动/优化] | o- pscsi ................................................................................................................ [存储对象:0] | o- ramdisk ................................................................................................ [存储对象:0] o- iscsi ................................................................................................................ [目标:1] | o- iqn.2003-01.org.linux-iscsi.svenshost.x8664:sn.df83287c359b ......................................................... [TPG:1] | o- tpg1 ...................................................................................................... [gen-acls,no-auth] | o- acls ........................................................................................................... [ACL:1] | | o- iqn.2003-01.org.linux-iscsi.svenshost.x8664:sn.df83287c359b .......................................... [映射 LUN:1] | | o-mapped_lun0 .............................................................................. [lun0 fileio/disk1 (rw)] | o- luns ................................................................................................................ [LUN:1] | | o- lun0 ........................................................... [fileio/disk1 (/disks/disk1.fileio) (default_tg_pt_gp)] | o- 门户 ................................................................................................... [门户:1] | o- 0.0.0.0:3260 ......................................................................................................... [确定] o- 环回................................................................................................................ [目标:0] o- vhost ................................................................................................................ [目标:0] />
我能够连接到 iSCSI 门户。
登录 [iface: default, target: iqn.2003-01.org.linux-iscsi.svenshost.x8664:sn.df83287c359b, portal: 15.15.130.11,3260] 成功。
但是当我执行 partprobe 时:
# 部分探测 警告:/dev/sdd 无法写入非本地文件(该系统仅能读取该文件)。 /dev/sdd 只读。 // /dev/sdd 无法打开进行写入,文件系统只能进行只读。
如何打开以进行读/写?
答案1
您应该在 targetcli 中添加 iSCSI 启动器的 acl。如果您尝试将 iSCSI 目标连接到 Linux 主机,请在此处检查启动器名称:cat /etc/iscsi/initiatorname.iscsi
它应该允许将您的目标连接到启动器并将其用于读写操作。
您还可以使用带有 GUI 的 iSCSI 目标。StarWind VSAN 就是一个很好的例子: https://www.starwindsoftware.com/starwind-virtual-san