Some of the hard drive in Virtual machines moved from legacy sector size of 512 bytes to a larger, more efficient sector size of 4096 bytes, generally referred to as 4K sectors.

Operating system present in VM is windows10. We have a build package installing softwares when the build is being deployed on VM irrespective of underlying hard drive. Is there any way to detect the hard drive type?

Reason being, mysql installation breaks due to 4k and workaround is only possible if installation is successful and my.cnf is available for changes.


Based on the errors i reached here, Mysql Doc. I have mysql 5.7 and it says "Running the MySQL server on a 4K sector hard drive on Windows is not supported

  • Why do you think the sector size is causing a problem? Jul 18 '18 at 20:24
  • @MichaelHampton based on the errors i reached here. dev.mysql.com/doc/mysql-windows-excerpt/5.7/en/…. I have mysql 5.7 and it says "Running the MySQL server on a 4K sector hard drive on Windows is not supported "
    – Bijendra
    Jul 19 '18 at 5:35
  • Also it's a big setup with lot of dependencies, i can't think of upgrading the mysql in short duration to latest to avoid the issue.
    – Bijendra
    Jul 19 '18 at 7:08
  • Well, you're running it on Windows, so that's probably going to be the least of your problems. You can certainly install MySQL and apply the workaround given. If you can't install MySQL, then something other than the sector size is the problem. Jul 19 '18 at 18:00

Always assume 4k sectors in a VM. While you have no way to determine the physical block size on the underlying hardware, it is a safe assumption and doesn't cause any problems if it is wrong. Often the virtual disk is stored as a file on the host, in this case the file system on the host will most likely also have a block size larger than 512 bytes.

You should be able to install mysql regardless of the sector size. Are you sure the sector size is the problem?

  • Yes, Sector is the issue. I have edited the question with detail on same
    – Bijendra
    Jul 19 '18 at 5:37
  • You don't mention what kind of host you are using for the VMs. There might be an option to set the sector size of the virtual disk.
    – RalfFriedl
    Jul 19 '18 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.