Change HDD Logical sector size

dMopp

Member
May 1, 2023
66
7
8
Hi, I was playing about a bit and discovered, all my 4 HDDs using 512b logical sectors instead of 4K.

See:
fdisk -l
Disk /dev/sda: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: WDC WD40EFRX-68N
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: CFD37F5A-8E44-4F4E-94EB-6D10B5A0EA03

Device Start End Sectors Size Type
/dev/sda1 34 2047 2014 1007K BIOS boot
/dev/sda2 2048 2099199 2097152 1G EFI System
/dev/sda3 2099200 7813988352 7811889153 3.6T Solaris /us


Iam using ZFS mirror with 2 disks each (so to say raid 10). Is there a way to change the sector size without loosing any data ? Or iam screwed ? (Was using the normal install way using zfs as rootfs, too)
 
Okay, nevermind. I was checking my disk again and it’s 512e, so all is fine (even I still would like to know how that would work :D )
 
You can't change it for a physical drive. You can specify a block size for ZFS vdevs and a volblocksize for zvols. This thread shows how to set the (virtual) sector sizes for (all) virtual SCSI drives of a VM (which is best done before installing anything inside a VM).
 
That was done and known. But with hdparm you can change the sector size for physical disks, if supported. Maybe you where not be aware of in the past (I had tons of cheaper ssds, where 4k native was avaiable but not configured, for whatever reason)
 

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!