Ubuntu iSCSI Partition Not Visible in lsblk – How to Fix

iscsiUbuntu

Recently I have created iSCSI Target with /dev/sda1 partition (1Gb with ext4 filesystem created), and iSCSI Initiator. Every service works correct without visible errors. Initiator successfully logged in to get target device.

Output of discovery command from Initiator:

root@Nitro5:/dev/disk/by-id# iscsiadm -m discovery -t st -p 10.8.0.1
10.8.0.1:3260,1 iqn.2020-09.tech.biowar.storagesrv01.target01

Output of lsblk of SCSI devices from Initiator:

root@Nitro5:/dev/disk/by-id# lsblk -S
NAME HCTL       TYPE VENDOR   MODEL                 REV TRAN
sda  1:0:0:0    disk ATA      WDC_WD10SPZX-21Z10T0 1A02 sata

Output of lsblk command. Also from Initiator:

root@Nitro5:/dev/disk/by-id# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0         7:0    0    55M  1 loop /snap/core18/1880
loop1         7:1    0  55,3M  1 loop /snap/core18/1885
loop2         7:2    0    16M  1 loop /snap/foliate/1119
loop3         7:3    0  29,9M  1 loop /snap/snapd/8542
loop4         7:4    0  29,9M  1 loop /snap/snapd/8790
loop5         7:5    0  49,8M  1 loop /snap/snap-store/467
loop6         7:6    0 290,4M  1 loop /snap/vlc/1700
loop7         7:7    0 240,8M  1 loop /snap/gnome-3-34-1804/24
loop8         7:8    0  62,1M  1 loop /snap/gtk-common-themes/1506
loop9         7:9    0 255,6M  1 loop /snap/gnome-3-34-1804/36
loop10        7:10   0  49,8M  1 loop /snap/snap-store/433
sda           8:0    0 931,5G  0 disk 
├─sda1        8:1    0     1G  0 part /boot/efi
├─sda2        8:2    0   391G  0 part 
├─sda3        8:3    0   5,3G  0 part 
└─sda4        8:4    0 534,2G  0 part /home
nvme0n1     259:0    0 238,5G  0 disk 
├─nvme0n1p1 259:1    0    16M  0 part 
├─nvme0n1p2 259:2    0  58,6G  0 part 
├─nvme0n1p3 259:3    0   131G  0 part 
├─nvme0n1p4 259:4    0  42,3G  0 part /
└─nvme0n1p5 259:5    0   6,5G  0 part [SWAP]

But there are no unmounted SCSI devices in main lsblk list. I have no idea where is SCSI device and how to mount it. How can I mount my device? Thanks in advance!

Best Answer

The first command you listed is a discovery. Server is sending the iSCSI targets available to the initiator. Now you should login the the target. You can use the following example:

iscsiadm -m node -l -T iqn.2020-09.tech.biowar.storagesrv01.target01

Afterwards, the following command will list the connected target and details. At the end of the output you will see where the scsi disk is attached.

iscsiadm -m session -P 3
Related Topic