3

I need to migrate my Server 2012 R2 Fileserver (physical) to another Server (virtual). That's why I need to create VHDX Files to run them later in Hyper-V

All my drives were no problem, except the C Drive.

Whenever I boot the created C Drive, I get this error:

Error Screenshot Hyper-V

If I simply open the VHDX on my filesystem, or on any server, I get the following error which says you need to format the F: Drive before you can use it:

Error F: drive

As you can see, the VHDX strangely contains 2 drives, and one of them (F:) is not formatted. that's why I can't use the VHDX file, because it does not recognize this drive I guess. I guess this is where EFI is located.

I tried to create the VHDX in 3 different ways. For the first two ways I tried Disk2VHD

like this (I tried it with the \\?\volume and without the \\?\volume partition):

Disk2VHD Screenshot

The third way I tried is directly from Hyper-V where I could say I wanted to create a VHDX from a physical drive.

Hyper-V wizard

but all of them get the same end result, the corrupted VHDX.

I read somewhere that I need to mountvol x: /s first to make my EFI Partition visible for disk2vhd, but mountvol does not seem to have a /s anymore?

How can I get a working VHDX? Thanks

SimonS
  • 767
  • 3
  • 13
  • 28
  • A generic step, but can you boot on the install media to do a bootrec /fixboot ? or even bootrec /RebuildBcd – yagmoth555 Mar 26 '18 at 12:15
  • @yagmoth555 you mean start the newly created machine with an WindowsServer.iso and the C-drive attached? – SimonS Mar 26 '18 at 12:54
  • Yes It's what I meant – yagmoth555 Mar 26 '18 at 13:07
  • @yagmoth555 in diskpart, I see that the "onknown" volume is the C:\ drive, and the actual C drive is E. I guess if I could change them it should work. but diskpart does not save the changes.... trying to do a bootrec.... – SimonS Mar 26 '18 at 13:19

1 Answers1

1

I suggest bootrec /fixboot or bootrec /rebuildbcd while booting the VM with the disk attached, but to write a bit more for my tip in your case, as I seen your C drive is actually the E drive, check bcdedit please too;

Boot the virtual machine from the correct Microsoft Windows installation media (Correct architecture and version of the operating system). Select the appropriate keyboard layout and language options and click Next. Click Repair your computer. Select the operating system to be repaired and click Next. Click Start > Run, type cmd and click OK. Type bcdedit and press Enter. Under the Windows Boot Manager title with the identifier set to {bootmgr}, you may see that the device is set to boot. Similarly, under the Windows Boot Loader with the identifier set to {default}, you may see that the device and osdevice are set to boot. These items should be set properly for your environment. Usually these appear as partition=C:. In some cases the {default} identifier may have them set to partition=E:.

Run these commands to correct the configuration:

Note: bcdedit is located in this path: c:\windows\system32.

bcdedit /set {bootmgr} device partition=C:

bcdedit /set {default} device partition=C:

bcdedit /set {default} osdevice partition=C:

Type exit at the command prompt and select Shutdown. The reconfigure should now complete successfully. If it fails again, repeat Steps 1 to 7 and then run these commands to set the default device to partition=E:

bcdedit /set {bootmgr} device partition=C:

bcdedit /set {default} device partition=E:

bcdedit /set {default} osdevice partition=E:
RBT
  • 223
  • 2
  • 10
yagmoth555
  • 16,300
  • 4
  • 26
  • 48
  • 1
    I did it slightly different, with `DISKPART` i removed the letter from the C-drive `remove letter=C` then assign letter=C to the E-drive, then `bootrec /RebuildBcD` and I had to change Generation 2 VM to Generation 1 for it to work – SimonS Mar 27 '18 at 05:43