我正在试验软件定义的设备,试图强制它以块大小 = 512 字节工作,但看起来 Linux 不希望这样。
我已强制设备报告命令的最小块数SCSI INQUIRY
:
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
但fdisk -l
仍然报告物理块大小 = 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
这些数字(见上文)从何而来?
操作系统:Ubuntu 14.04.5 LTS,内核为 3.19.0-78-generic
(在MacBook上的VMware Fusion 8.5.8下作为虚拟机工作)