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

kaazoo kaazoo at kernelpanik.net
Fri Jan 8 11:38:20 EST 2016


Am 08.01.16 um 17:27 schrieb Chris Siebenmann:
>> 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
> [...]
>> Why is a physical blocksize of 32 KB instead of 4 KB reported?
>> Is this a bug in LIO or a configuration issue?
> 
>  I suspect that 'optimal_sectors' is not in units of bytes but in
> 512-byte sectors. That would explain why the physical block size
> winds up listed as 32 KB. Try 'optimal_sectors=512' and see if that
> gets you a physical block size of 4k.
> 
> 	- cks
> 


Hello Chris,

'set attribute optimal_sectors=512' results in the same:

sd 1:0:0:0: [sdd] 23253221376 4096-byte logical blocks: (93.0 TB/86.6 TiB)
sd 1:0:0:0: [sdd] 32768-byte physical blocks


Regards,
kaazoo


More information about the zfs-discuss mailing list