1

I'm trying to set up an iSCSI connection from a Raspberry PI (initiator) to my QNAP NAS (target, with configured LUN and ACL). The RPi runs Ubuntu 22.04 and the NAS uses QTS 5

After I reboot or I restart the open-iscsi service, I do see a succesful login:

sudo systemctl status open-iscsi
● open-iscsi.service - Login to default iSCSI targets
     Loaded: loaded (/lib/systemd/system/open-iscsi.service; enabled; vendor preset: enabled)
     Active: active (exited) since Sun 2024-08-25 00:11:13 CEST; 19min ago
       Docs: man:iscsiadm(8)
             man:iscsid(8)
    Process: 776 ExecStart=/sbin/iscsiadm -m node --loginall=automatic (code=exited, status=0/SUCCESS)
    Process: 796 ExecStart=/lib/open-iscsi/activate-storage.sh (code=exited, status=0/SUCCESS)
   Main PID: 796 (code=exited, status=0/SUCCESS)
        CPU: 23ms

Aug 25 00:11:13 <REDACTED HOST> systemd[1]: Starting Login to default iSCSI targets... Aug 25 00:11:13 <REDACTED HOST> iscsiadm[776]: Logging in to [iface: eth0, target: <REDACTED TARGET_IQN>, portal: <REDACTED NAS_IP>,3260] Aug 25 00:11:13 <REDACTED HOST> iscsiadm[776]: Login to [iface: eth0, target: <REDACTED TARGET_IQN>, portal: <REDACTED NAS_IP>,3260] successful. Aug 25 00:11:13 <REDACTED HOST> systemd[1]: Finished Login to default iSCSI targets.

On my NAS I can see that the client did connect: nas gui iscsi target connection

I also see a session on the client side:

$sudo iscsiadm -m session -o show
tcp: [1] <REDACTED NAS_IP>:3260,1 <REDACTED TARGET_IQN> (non-flash)

But I don't see any disks or partitions:

$cat /proc/partitions
major minor  #blocks  name

7 0 61184 loop0 7 1 61184 loop1 7 2 79232 loop2 7 3 79236 loop3 7 4 34460 loop4 7 5 34516 loop5 179 0 62367744 mmcblk0 179 1 262144 mmcblk0p1 179 2 62104559 mmcblk0p2

$sudo lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
loop0         7:0    0 59.8M  1 loop /snap/core20/2267
loop1         7:1    0 59.8M  1 loop /snap/core20/2321
loop2         7:2    0 77.4M  1 loop /snap/lxd/28384
loop3         7:3    0 77.4M  1 loop /snap/lxd/29353
loop4         7:4    0 33.7M  1 loop /snap/snapd/21467
loop5         7:5    0 33.7M  1 loop /snap/snapd/21761
mmcblk0     179:0    0 59.5G  0 disk
├─mmcblk0p1 179:1    0  256M  0 part /boot/firmware
└─mmcblk0p2 179:2    0 59.2G  0 part /

Even lsscsi doesn't give me any results.

This is what I see in the logs:

[    0.167678] SCSI subsystem initialized
[    0.375575] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 242)
...
[  137.016854] Loading iSCSI transport class v2.0-870.
[  137.604999] iscsi: registered transport (tcp)
[  137.612095] scsi host0: iSCSI Initiator over TCP/IP

There are no lines like scsi 7:0:0:4: Direct-Access ..., sd 7:0:0:4: Attached scsi generic ... or Attached SCSI disk though.

Here is my node config:

$ sudo iscsiadm -m node -o show
# BEGIN RECORD 2.1.5
node.name = <REDACTED TARGET_IQN>
node.tpgt = 1
node.startup = automatic
node.leading_login = No
iface.iscsi_ifacename = eth0
iface.net_ifacename = <empty>
iface.ipaddress = <REDACTED CLIENT_IP>
iface.prefix_len = 0
iface.hwaddress = <REDACTED CLIENT_MAC>
iface.transport_name = tcp
iface.initiatorname = <empty>
iface.state = <empty>
iface.vlan_id = 0
iface.vlan_priority = 0
iface.vlan_state = <empty>
iface.iface_num = 0
iface.mtu = 0
iface.port = 0
iface.bootproto = <empty>
iface.subnet_mask = <empty>
iface.gateway = <empty>
iface.dhcp_alt_client_id_state = <empty>
iface.dhcp_alt_client_id = <empty>
iface.dhcp_dns = <empty>
iface.dhcp_learn_iqn = <empty>
iface.dhcp_req_vendor_id_state = <empty>
iface.dhcp_vendor_id_state = <empty>
iface.dhcp_vendor_id = <empty>
iface.dhcp_slp_da = <empty>
iface.fragmentation = <empty>
iface.gratuitous_arp = <empty>
iface.incoming_forwarding = <empty>
iface.tos_state = <empty>
iface.tos = 0
iface.ttl = 0
iface.delayed_ack = <empty>
iface.tcp_nagle = <empty>
iface.tcp_wsf_state = <empty>
iface.tcp_wsf = 0
iface.tcp_timer_scale = 0
iface.tcp_timestamp = <empty>
iface.redirect = <empty>
iface.def_task_mgmt_timeout = 0
iface.header_digest = <empty>
iface.data_digest = <empty>
iface.immediate_data = <empty>
iface.initial_r2t = <empty>
iface.data_seq_inorder = <empty>
iface.data_pdu_inorder = <empty>
iface.erl = 0
iface.max_receive_data_len = 0
iface.first_burst_len = 0
iface.max_outstanding_r2t = 0
iface.max_burst_len = 0
iface.chap_auth = <empty>
iface.bidi_chap = <empty>
iface.strict_login_compliance = <empty>
iface.discovery_auth = <empty>
iface.discovery_logout = <empty>
node.discovery_address = <REDACTED NAS_IP>
node.discovery_port = 3260
node.discovery_type = send_targets
node.session.initial_cmdsn = 0
node.session.initial_login_retry_max = 8
node.session.xmit_thread_priority = -20
node.session.cmds_max = 128
node.session.queue_depth = 32
node.session.nr_sessions = 1
node.session.auth.authmethod = CHAP
node.session.auth.username = <REDACTED CHAP_USERNAME>
node.session.auth.password = ********
node.session.auth.username_in = <empty>
node.session.auth.password_in = <empty>
node.session.auth.chap_algs = MD5
node.session.timeo.replacement_timeout = 0
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 30
node.session.err_timeo.tgt_reset_timeout = 30
node.session.err_timeo.host_reset_timeout = 60
node.session.iscsi.FastAbort = Yes
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.session.iscsi.DefaultTime2Retain = 0
node.session.iscsi.DefaultTime2Wait = 2
node.session.iscsi.MaxConnections = 1
node.session.iscsi.MaxOutstandingR2T = 1
node.session.iscsi.ERL = 0
node.session.scan = auto
node.session.reopen_max = 0
node.conn[0].address = 192.168.1.64
node.conn[0].port = 3260
node.conn[0].startup = automatic
node.conn[0].tcp.window_size = 524288
node.conn[0].tcp.type_of_service = 0
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_interval = 5
node.conn[0].timeo.noop_out_timeout = 5
node.conn[0].iscsi.MaxXmitDataSegmentLength = 0
node.conn[0].iscsi.MaxRecvDataSegmentLength = 262144
node.conn[0].iscsi.HeaderDigest = None
node.conn[0].iscsi.DataDigest = None
node.conn[0].iscsi.IFMarker = No
node.conn[0].iscsi.OFMarker = No
# END RECORD

I did configure the client iqn to have access to the target and to have Read/Write access to the LUN.

I did try to follow multiple guides:

But while they did complement each other, they didn't get me past this issue.

What am I missing to see the storage on my client?

1 Answers1

1

I have tried restarting open-iscsi and iscsid on the initiator side: didn't fix it.

I tried to disable and re-enable the target on the NAS side: didn't fix it.

What DID fix it for me: after verifying that the iSCSI ACL policies were configured for the initiator IQN, I fully disabled and re-enabled the iSCSI service on the NAS. After that I restarted open-iscsi on the client.

After that, I finally saw this in dmesg:

scsi 0:0:0:0: Direct-Access     QNAP     iSCSI Storage    4.0  PQ: 0 ANSI: 5
...
sd 0:0:0:0: Attached scsi generic sg0 type 0
...
sd 0:0:0:0: [sda] Attached SCSI disk

and this in lsblk:

NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
loop0         7:0    0 59.8M  1 loop /snap/core20/2267
loop1         7:1    0 59.8M  1 loop /snap/core20/2321
loop2         7:2    0 77.4M  1 loop /snap/lxd/28384
loop3         7:3    0 77.4M  1 loop /snap/lxd/29353
loop4         7:4    0 33.7M  1 loop /snap/snapd/21467
loop5         7:5    0 33.7M  1 loop /snap/snapd/21761
sda           8:0    0  736G  0 disk
mmcblk0     179:0    0 59.5G  0 disk
├─mmcblk0p1 179:1    0  256M  0 part /boot/firmware
└─mmcblk0p2 179:2    0 59.2G  0 part /

So the iSCSI drive now finally showed up on sda.

I think that some of the settings that I applied on the NAS didn't fully get applied correctly until I restarted the service.

The classic "Have you tried turning it off and on again?"