Virtual Disk with 4k sector size ?

Hello,

I see multiple reference to it on Internet and this forum. It's seams to be possible to run kvm with 4k sector size using the `-set 'device.scsi0.physical_block_size=4096' -set 'device.scsi0.logical_block_size=4096'` in command line, but it doesn't seams to be possible to do it properly in proxmox.

So I'm asking here. Is it possible to reate a VirtualDisk in proxmox with 4k sector size ?
 
Nice question! I also wondered about that, too.

For all that wonder how to determine that:

Code:
cat /sys/block/sda/queue/hw_sector_size
 
I would like to know as well. I map a physical drive from the Host ( Proxmox 5 ) to a virtual machine. While it works, and I can write and read to the physical disk, I notice it's very slow, at around 20mb write. I also had one instance where the partition became corrupted, and I had to use fsck on the host to correct the disk. I was not able to mount nor use fsck on the VM. So, is there a way to make the VM know this is a 4k sector drive?


Host:
Code:
root@pve:~# parted /dev/sdd 'print'
Model: ATA WDC WD80EFZX-68U (scsi)
Disk /dev/sdd: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name   Flags
 1      1049kB  8002GB  8002GB  ext4         8TB_1


VM:

Code:
bash-4.3# parted /dev/sdd 'print'
Model: QEMU HARDDISK (scsi)
Disk /dev/sdd: 8002GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name   Flags
 1      1049kB  8002GB  8002GB  ext4         8TB_1
 
The problem is the fact that some hdd use some block size, but in reality it use another value. In this topic, I see different test cases (hdd directly exposed to the kvm or not - is only a supposition )
Anyway any disk with different
logical/physical like 512B/4096B I think is not usable for 4k usage. For example zfs have a special code who will try to detect/find if the hdd can use 512 B or anything else value(at the moment when the pool is made)
In the end the question is how we can know if a hdd it can use 4k or not.... In my own opinion , a good test is to put zfs on it, and then to find if zfs use for this hdd 4k or not. I want only to scratch the surface of this subject ... :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!