所以我用 open-iscsi 设置了一个 iSCSI 磁盘。我可以连接并挂载该磁盘,手动写入和卸载。
我也在 fstab 中输入了相关的定义,即 smt。例如:
dev/sdb1 /storage ext3 defaults,auto,_netdev 0 0
它可以手动安装,没有任何问题。
但是当我运行它时service open-iscsi restart
它无法挂载。它在启动时也无法挂载。如果我mount
在服务挂载失败后立即写入,它会挂载...
这是初始化脚本的输出:
[ ok ] Unmounting iscsi-backed filesystems: Unmounting all devices marked _netdev.
[....] Disconnecting iSCSI targets:Logging out of session [sid: 1, target: iqn.***.c44c07, portal: xxx.xxx.xxx.xxx,3260]
Logout of [sid: 1, target: iqn.***.c44c07, portal: xxx.xxx.xxx.xxx,3260] successful.
. ok
[ ok ] Stopping iSCSI initiator service:.
[ ok ] Starting iSCSI initiator service: iscsid.
[....] Setting up iSCSI targets:
Logging in to [iface: default, target: iqn.***.c44c07, portal: xxx.xxx.xxx.xxx,3260] (multiple)
Login to [iface: default, target: iqn.***.c44c07, portal: xxx.xxx.xxx.xxx,3260] successful.
. ok
[FAIL] Mounting network filesystems: failed!
这是 dmesg 所说的内容(存在连接错误,但我不明白发生了什么)
[ 4465.046920] connection1:0: detected conn error (1020)
[ 4465.361580] Loading iSCSI transport class v2.0-870.
[ 4465.365419] iscsi: registered transport (tcp)
[ 4465.373846] iscsi: registered transport (iser)
[ 4465.652981] scsi13 : iSCSI Initiator over TCP/IP
[ 4465.911595] scsi 13:0:0:0: Direct-Access QNAP iSCSI Storage 3.1 PQ: 0 ANSI: 5
[ 4465.913133] sd 13:0:0:0: Attached scsi generic sg2 type 0
[ 4465.917664] sd 13:0:0:0: [sdb] 2097152000 512-byte logical blocks: (1.07 TB/1000 GiB)
[ 4465.921695] sd 13:0:0:0: [sdb] Write Protect is off
[ 4465.921699] sd 13:0:0:0: [sdb] Mode Sense: 2f 00 00 00
[ 4465.929650] sd 13:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 4465.974938] sdb: sdb1
[ 4465.980409] sd 13:0:0:0: [sdb] Attached SCSI disk
笔记:
- 由于它是内部网络,因此无需使用用户名/密码即可连接目标
- 我手动添加了节点
iscsiadm -m node -T "iqn.***.c44c07" -p xxx.xxx.xxx.xxx -o new
答案1
在 fstab 文件中使用 UUID 而不是设备名称解决了该问题。