I'm experimenting with a software defined device, trying to force it to work with block size = 512 bytes, but it looks like the Linux doesn't want that.
I've forced the device to report minimal blocks numbers for the SCSI INQUIRY
command:
hekto@ubuntu3:~$ sudo sg_inq -p 0xb0 /dev/sde
VPD INQUIRY: Block limits page (SBC)
Maximum compare and write length: 255 blocks
Optimal transfer length granularity: 1 blocks
Maximum transfer length: 1 blocks
Optimal transfer length: 1 blocks
Maximum prefetch transfer length: 0 blocks
Maximum unmap LBA count: 0
Maximum unmap block descriptor count: 0
Optimal unmap granularity: 0
Unmap granularity alignment valid: 0
Unmap granularity alignment: 0
Maximum write same length: 0x0 blocks
Maximum atomic transfer length: 0
Atomic alignment: 0
Atomic transfer length granularity: 0
But the fdisk -l
still reports physical block size = 4096:
hekto@ubuntu3:~$ sudo fdisk -l /dev/sde
Disk /dev/sde: 5 MB, 5120000 bytes
1 heads, 10 sectors/track, 1000 cylinders, total 10000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes <== see here
I/O size (minimum/optimal): 4096 bytes / 524288 bytes. <== and here
Where do these numbers (see above) come from?
OS: Ubuntu 14.04.5 LTS with kernel 3.19.0-78-generic
(working as virtual machine under VMware Fusion 8.5.8 on MacBook)
strace fdisk -l /dev/sde
ioctl
calls withBLKIOMIN
andBLKPBSZGET
, which return4096
. Any way to affect these parameters? Or they are hard-coded in Linux?