[zfs-discuss] Linux IO Target: iSCSI LUN with 4 KB blocksize

kaazoo kaazoo at kernelpanik.net
Fri Jan 8 10:34:50 EST 2016


Hallo all,

I try to create a Linux IO Target (LIO) iSCSI LUN with a logical and
physical blocksize of 4 KB.

* ashift of the zpool is 12 (4 KB):
# zpool get ashift data
NAME  PROPERTY  VALUE   SOURCE
data  ashift    12      local

* blocksize of zvol is 4 KB:
# zfs get volblocksize data/iscsi
NAME        PROPERTY      VALUE     SOURCE
data/iscsi  volblocksize  4K        -

* create iSCSI LUN with 4 KB blocksize:
# targetcli
cd /backstores/iblock
create iscsi /dev/zvol/data/iscsi
cd iscsi
set attribute block_size=4096
set attribute optimal_sectors=4096
cd /iscsi/iqn.12345FOOBAR/tpgt1/luns
create /backstores/iblock/iscsi
cd /
saveconfig

* log into iSCSI target on client:
# iscsiadm -m node --login

* see kernel output on client:
scsi host57: iSCSI Initiator over TCP/IP
scsi 57:0:0:0: Direct-Access     LIO-ORG  IBLOCK           4.0  PQ: 0
ANSI: 5
sd 57:0:0:0: Attached scsi generic sg3 type 0
sd 57:0:0:0: [sdd] 23253221376 4096-byte logical blocks: (93.0 TB/86.6 TiB)
sd 57:0:0:0: [sdd] 32768-byte physical blocks
sd 57:0:0:0: [sdd] Write Protect is off
sd 57:0:0:0: [sdd] Mode Sense: 43 00 10 08
sd 57:0:0:0: [sdd] Write cache: enabled, read cache: enabled, supports
DPO and FUA
sd 57:0:0:0: [sdd] 23253221376 4096-byte logical blocks: (93.0 TB/86.6 TiB)
sd 57:0:0:0: [sdd] 32768-byte physical blocks
sd 57:0:0:0: [sdd] 23253221376 4096-byte logical blocks: (93.0 TB/86.6 TiB)
sd 57:0:0:0: [sdd] 32768-byte physical blocks
sd 57:0:0:0: [sdd] Attached SCSI disk
device-mapper: table: 252:2: adding target device sdd caused an
alignment inconsistency: physical_block_size=32768,
logical_block_size=4096, alignment_offset=0, start=0
device-mapper: table: 252:2: adding target device sdd caused an
alignment inconsistency: physical_block_size=32768,
logical_block_size=4096, alignment_offset=0, start=0


Why is a physical blocksize of 32 KB instead of 4 KB reported?
Is this a bug in LIO or a configuration issue?

Another strange thing is that the HW blocksize of the zvol is reported
as 512 byte:
/backstores/iblock/iscsi> get attribute hw_block_size
hw_block_size=512 [ro]


Regards,
kaazoo


More information about the zfs-discuss mailing list