1

I have been hopelessly trying to change the sector size of a freshly created Windows 10 VHDX file, to 4096 bytes per sector.

After searching the net and trying things, this comes closest (using Windows 10):

  • Install Hyper-V
  • Select Start button and type Powershell
  • Right mouse click "Run as Administrator"
  • Type command: Set-Vhd -Path 4Kn.vhdx –PhysicalSectorSizeBytes 4096

The latter command has been tried in all possible flavors, with full path, just the filename (after CD'ing to the folder) etc.

I always get errors:

Set-Vhd : The operation on computer 'DESKTOP-JCMNHRV' failed: Invalid class
At line:1 char:1
+ Set-Vhd -Path C:\Users\Peter\Desktop\4Kn.vhdx –PhysicalSectorSizeByte ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-VHD], VirtualizationException
    + FullyQualifiedErrorId : Unspecified,Microsoft.Vhd.PowerShell.Cmdlets.SetVhd

Any idea what to do or where to start? I don't see it anymore

The .vhdx is not attached, and I tried without any formatting inside, and later with an NTFS formatted volume.

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
Peter
  • 1,334
  • 12
  • 28
  • [SuperUser](https://superuser.com/) might be a better place for this question. – Ansgar Wiechers May 17 '16 at 11:50
  • Got it to work. Hyper-V didn't seem properly installed. I tried again via the powershell: `Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All` and after that the command worked – Peter May 17 '16 at 13:26
  • I had similar issue. The problem in my case was **a)** that the vhdx was mounted (Dah.) and **b)** the path to unmounted vhdx contained NTFS junction (for some reason it matters). – Vlastimil Ovčáčík Oct 05 '17 at 15:51

0 Answers0