Passthrough disk block size mismatch

KciNicK

Member
May 27, 2024
60
5
8
Hi there, the disk on the server:

Code:
Disk /dev/sdb: 3.64 TiB, 3999998672896 bytes, 976562176 sectors
Disk model: HITHERE
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: E373A6E4-1A92-3D46-8441-BFA9AAF05019

Device         Start       End   Sectors  Size Type
/dev/sdb1       2048 976543743 976541696  3.6T Solaris /usr & Apple ZFS
/dev/sdb9  976543744 976560127     16384   64M Solaris reserved 1

the disk on the vm:
Code:
GPT PMBR size mismatch (976562175 != 7812497407) will be corrected by write.
Disk /dev/sdf: 3.64 TiB, 3999998672896 bytes, 7812497408 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x51cabd30

Device     Boot Start        End    Sectors Size Id Type
/dev/sdf1           1 4294967295 4294967295   2T ee GPT

problem, i guess, the sector size 512 vs 4096, the GPT says disk partition start at sector x, but 512 by x is something, and 4096 by x is something else, is there a way to fix this? i wanna be able to mount the disk on the server and on the vm, don't worry about data corruption, thanks!
 
found a workaround, manually adding this to each disk that need 4k sector size on the vm configuration file, fix the problem:

Code:
args: -set device.scsi0.logical_block_size=4096 -set device.scsi0.physical_block_size=4096

it would be nice to have this on the GUI.