none
[VHD][BOOT][UEFI] Boot Windows 8 From a VHD Drive On a GPT Disk Using UEFI BIOS. Proper Partition Layout To Optimize Disk Usage RRS feed

  • Question

  • Hello,

    When I've been installing Windows 8, I booted Windows 8 Setup from UEFI firmware and converted the target drive to GPT. The Windows 8 Setup program automatically repartitioned the GPT disk into 4 (four) partitions:

    Drive 0 Partition 1: Label: Recovery 300 Mbyte Type: Recovery
    Drive 0 Partition 2: Label: <EMPTY> 100 Mbyte Type: System
    Drive 0 Partition 3: Label: <EMPTY> 128 Mbyte Type: MSR (Reserved)
    Drive 0 Partition 4: Label: <EMPTY> REMAINING_BYTES_ON_THE_DRIVE Type: Primary

    Then I placed an expandable VHDX drive to Partition 4 and copied boot data (the Boot Configuration Database, BCD) to Partition 2 using bootsect tool.

    Now I have at least two partitions that are absolutely empty and don't contain any data. The Drive 0 Partition 1: Label: Recovery 300 Mbyte Type: Recovery and Drive 0 Partition 3: Label: <EMPTY> 128 Mbyte Type: MSR (Reserved) partitions are empty.

    Possibly I was wrong to let Windows Setup repartition the drive for me? Why do I need 4 partitions where I could've used just one, the last partition that could hold both the BCD and VHDX necessary to boot?

    What would be the proper partition layout for VHD boot from a GPT disk?

    Thank you.


    Well this is the world we live in And these are the hands we're given...

    Thursday, September 6, 2012 10:20 PM

All replies

  • Hi,

    The recovery partition should include Windows RE tools. The MSR is a reserved partition that does not receive a partition ID. It cannot store user data.

    Understanding Disk Partitions
    http://technet.microsoft.com/en-us/library/dd799232(v=ws.10).aspx


    Niki Han

    TechNet Community Support

    Monday, September 10, 2012 7:02 AM
    Moderator
  • Hi, Niki,

    How do I make sure I have Windows RE tools on that partition provided that I use VHDX file residing on partition 4?

    Currently, I have all the partitions but Partition 2 and Partition 4 empty. The second partition holds just the small EFI folder with *.efi boot files that I created using bcdboot:

     

    c:\>bcdboot f:\windows /s s: /v /m {guid_of_partition_4}

    Where f:\windows is a Windows folder within the attached VHDX virtual drive that resides on partition 4 and s: is the letter of the partition 2. This partition has been formatted by Windows Setup into FAT32 and currently holds only the BCD database. The drive letter s has been assigned by me using diskpart>assign letter=s.

    Recovery partition is empty, the MSR partition is also empty.

    The question is: how do I make sure these partitions are used as necessary (that is recovery partition stores WinRE, MSR partition stores some backup data). Just as it used to be when installing Windows 8 files on partition 4.

    Because I haven't run Windows Setup on this drive (except for letting it repartition the GPT drive for me), all the partitions are empty and just not used as necessary. I'd love to know how do I recreate them without having to install Windows 8 on partition 4.

    I don't want to install Windows 8 because I already have it installed into a VHDX drive that I placed on partition 4 and added its references to the Boot Configuration Database.

    Microsoft help or KB does not delve into the details of re-using your VHDX setups unfortunately. That's the reason of this post.

    Thank you for your support.


    Well this is the world we live in And these are the hands we're given...


    Monday, September 10, 2012 9:49 AM
  • Niki,

    Could you please explain some information further? The article does not explain well what is the purpose of each partition.

    For example, when talking about ESP (the EFI, typically the second one) partition, the article tells:

    An EFI System Partition (ESP)              

    Each bootable drive must contain an ESP. The computer boots to this partition.

    What does this mean? How do I make sure the partition contains boot code?

    I used bootsect tool to add the boot code to system partition (the ESP partition) using the following command:

    bootsect /nt60 s: /force

    the nt60 switch parameter adds NT 6.0 version of the boot code.

    s: is manually assigned drive letter for the system partition (because a ESP is utility partition, it does not have drive letter assigned)

    the force switch option deletes open handles and detaches partition.

    Is it correct? Or is there any other option to make system partition bootable.

    What file system should be applied to ESP partition? The article you are referring to gives to answer on this.

    Moreover, the article reads:

    Basic system partition requirements are:... Must be configured as the active partition.

    How come? What if this partition is residing on a GPT disk? You can mark partition as active on MBR disks only!

    Also, it says that a system partition "Must be formatted as NTFS for BIOS-based systems." So why does Windows Setup format it into FAT32? The "Choosing a file system: NTFS, FAT, or FAT32" article, which is referred, does not explain what file system should be used on UEFI (at least because the article has been developed before UEFI has come to fruition).

    The article provides no information about what data is contained on Microsoft Reserved Partition (MSR). It just reads: "It contains information that is related to other system partitions and is used by Microsoft applications." What does it mean? I see that all 128 Mbytes allotted for MSR partition aren't used at all.

    The article does not explain what data should be contained on Recovery partition and how do I prepare this partition to hold WinRE environment. The Deploy a System Recovery Image also does not explain how to prepare the WinRE and deploy it to Recovery partition.

    What does this mean to say:

    mkdir S:\Recovery\WindowsREmove C:\Windows\System32\Recovery\winre.wim S:\Recovery\WindowsRE

    Where do I get this winre.wim Windows IMage archive file? Looking up %systemdrive%\Windows\System32\Recovery\ folder in Windows 8 system folder returns only ReAgent.xml configuration file. It does NOT contain the winre.wim! Where from do I get the WinRE environment?

    So  nope, unfortunately the article gives more questions than answers.


    Well this is the world we live in And these are the hands we're given...

    Monday, September 10, 2012 2:34 PM
  • I will share with you some disk part scripts I used for partitioning UEFI drives for Windows 7.  I have not tested them with Windows 8, but I imagine they'll work the same.

    This script will create the basic partitions without a Windows RE Drive:

    Select disk 0
    Clean
    Convert gpt
    Create partition efi size=200
    Assign letter=S
    Format quick FS=FAT32
    Create partition msr size=128
    Create partition primary 
    Assign letter=W
    Format quick FS=NTFS label="Windows7"

    Script 2:

    select disk 0
    clean
    convert gpt
    rem == 1. Windows RE tools partition ===============
    create partition primary size=300
    format quick fs=ntfs label="WinRE tools"
    set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
    assign letter=T
    rem == 2. System partition =========================
    create partition efi size=100
    rem ** NOTE: For 4KB-per-sector drives, change this
    rem          value to 260 **
    format quick fs=fat32 label="System"
    assign letter=S
    rem == 3. Microsoft Reserved (MSR) partition =======
    create partition msr size=128
    rem == 4. Windows partition ========================
    rem ==    a. Create the Windows partition. ==========
    create partition primary
    rem ==    b. Create space for the recovery image. ===
    shrink minimum=15000
    rem ==    c. Prepare the Windows partition. =========
    format quick fs=ntfs label="Windows"
    assign letter=W
    rem === 5. Recovery image partition ================
    create partition primary
    format quick fs=ntfs label="Recovery image"

    assign letter=R
    list volume


    Tuesday, September 11, 2012 1:26 AM
  • Hello, Stephen!

    Thank you for your scripts, they are valuable and I am sure they will serve somebody a good stead.

    However, I was rather about to ask how do I fill these partitions with necessary data, like how do I add WinRE to Recovery partition provided that I already partitioned the GPT disk using Windows Setup wizard.

    The only thing that comes is to install Windows 8 as usual, then remove all data and attach the already existing VHD. It looks rather ridiculous but I don't know of the other way to achieve that. What I have so far is 3 empty partitions consuming half a gigabyte of disk space all together. And this doesn't seem to be the good deal. Windows Setup prepared this partition layout but did not finish its work (because I didn't want to install the OS to the physical disk and installed the OS to the VHD attached).

    Now the question is: how do I make sure all partitions are used as necessary much like they should've been used if I was to install Windows 8 to physical drive rather than to the VHD like I actually did.


    Well this is the world we live in And these are the hands we're given...



    Tuesday, September 11, 2012 11:37 AM
  • I'd like to bump the question as I still have no clue how do I make Windows to create WinRE environment on my disk drive. Did anybody get a clue since when Windows 8 launched?

    Thank you.


    Well this is the world we live in And these are the hands we're given...

    Thursday, December 20, 2012 1:32 PM
  • I think what you're looking for is part of the Step by step guide Microsoft supplies here:
    http://technet.microsoft.com/en-us/library/hh825686.aspx#ProvidingAdditionalProtectionforWindowsREToolsandRecoveryImagePartitions

    If you read the article they supply a link at the end that goes to an article under "next steps" called "Sample: Configure UEFI/GPT-Based Hard Drive Partitions by Using Windows PE and DiskPart"

    http://technet.microsoft.com/en-us/library/hh825089.aspx

    I haven't tried it and it as usual seems a bit complicated (technical). I did a search on disk imaging or cloning and found that there are freeware applications out there that have a feature including the creation of recovery partitions. I just got done with the rather complex and involved process of installing Windows 8 from a USB key to UEFI on a GPT partition on an ASUS. Seriously complicated, it took me a few weeks a few hours a night getting it right.

    I found a great freeware review site called "Gizmo alerts" that has editors review freeware in different categories: check out best free disk imaging article for more info: http://www.techsupportalert.com/best-free-drive-imaging-program.htm

    Wednesday, February 20, 2013 5:40 PM
  • Thank you, Pierre!

    That's very close to what I am seeking for, however, it still does not say how I can force Windows Setup to copy WinRE data files to the created partition!

    What it does is:

    <!-- Windows RE Tools partition -->
          <CreatePartition wcm:action="add">
            <Order>1</Order> 
            <Type>Primary</Type> 
            <Size>300</Size> 
          </CreatePartition>
    

    So it does create a WinRE partition of 300 Mbytes in size but it does NOT copy the data to it! In other words, you'll end up with the same empty WinRE partition when this script is done. Am I wrong?


    Well this is the world we live in And these are the hands we're given...

    Thursday, February 21, 2013 3:56 PM
  • I'm still looking for an answer as well, if you find anything let me know. I've seen a few freeware solutions for backup, but I'd like to recreate the rescue content as it was when I bought the computer (before I messed things up and deleted the HDD content with a diskpart clean!

    So far a lot of gibberish about using the Windows 8 environment to create boot media like USB drives or a DVD but nothing on how to fill those rescue partitions with content that is accessible from F10 like the original OEM setup. I'm not a technician so those step by step MSN developer guides are too complicated for me.

    Friday, February 22, 2013 5:20 PM
  • Hello

    you can use reagent.exe to create the recovery image:

    See the TechNet Link:

    http://technet.microsoft.com/en-us/library/dd799242(v=WS.10).aspx


    Thanks, Darrell Gorter [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights. VAMT - Volume Activation Management Tool - Download link http://www.microsoft.com/downloads/details.aspx?FamilyID=ec7156d2-2864-49ee-bfcb-777b898ad582&displaylang=en

    Sunday, February 24, 2013 1:21 AM
  • Hello,

    ESP should be Fat32

    Recovery should be NTFS

    MSR should not be formatted, this is reserved space for disk utilities\services if they need some working space, this is available so those utilities do not try reallocate space from an existing volume.


    Thanks, Darrell Gorter [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights. VAMT - Volume Activation Management Tool - Download link http://www.microsoft.com/downloads/details.aspx?FamilyID=ec7156d2-2864-49ee-bfcb-777b898ad582&displaylang=en

    Sunday, February 24, 2013 1:34 AM
  • Darrell,
    don't mean to hijack this thread, but can you please take a look at this issue
     
    it impacts some non Microsoft pc's as well that have a similar partition
    structure.
     
    On Sun, 24 Feb 2013 01:34:12 +0000, Darrell Gorter wrote:
     
    >
    >
    >Hello,
    >
    >ESP should be Fat32
    >
    >Recovery should be NTFS
    >
    >MSR should not be formatted, this is reserved space for disk utilities\services if they need some working space, this is available so those utilities do not try reallocate space from an existing volume.
    >
    >
    >Thanks, Darrell Gorter [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights. VAMT - Volume Activation Management Tool - Download link http://www.microsoft.com/downloads/details.aspx?FamilyID=ec7156d2-2864-49ee-bfcb-777b898ad582&displaylang=en
     

    Barb Bowman

    http://www.digitalmediaphile.com

    Sunday, February 24, 2013 10:53 AM
  • Hello,

    ESP should be Fat32

    Recovery should be NTFS

    MSR should not be formatted, this is reserved space for disk utilities\services if they need some working space, this is available so those utilities do not try reallocate space from an existing volume.


    Thanks, Darrell Gorter [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights. VAMT - Volume Activation Management Tool - Download link http://www.microsoft.com/downloads/details.aspx?FamilyID=ec7156d2-2864-49ee-bfcb-777b898ad582&displaylang=en

    Hi, Darrell,

    Thank you for this information.

    Do you mean, MSR should be RAW?

    As for REAgentC, could you please clarify the tool usage as the article is not quite clear on implementing WinRE.

    How do I use the REAgentC tool provided that I have the above mentioned partition layout and Windows 8 setup disc?

    Thank you.


    Well this is the world we live in And these are the hands we're given...

    Tuesday, February 26, 2013 5:35 PM
  • Hello,

    Sorry was thinking about recimg

    J:\Windows\System32>recimg /?
                                                                 
    Configures the recovery image Windows uses to refresh your PC.                                                                                                                       
    RECIMG.EXE <command> <arguments>                                                                                                                                                     
    The recimg.exe command line tool lets you configure a custom recovery image               
    for Windows to use when you refresh your PC. When you create a custom                     
    recovery image, it will contain the desktop apps you've installed, and the                
    Windows system files in their current state. Recovery images do not contain               
    your documents, personal settings, user profiles, or apps from Windows Store,             
    because that information is preserved at the time you refresh your PC.                                                                                                                When you create a custom recovery image, recimg will store it in the                      
    specified directory, and set it as the active recovery image. If a custom                 
    recovery image is set as the active recovery image, Windows will use it when              
    you refresh your PC. You can use the /setcurrent and /deregister options to               
    select which recovery image Windows will use. All recovery images have the                
    filename CustomRefresh.wim. If no CustomRefresh.wim file is found in the                  
    active recovery image directory, Windows will fall back to the default image              
    (or to installation media) when you refresh your PC.                                                                                                                                 

    Note that you cannot reset your PC using a custom recovery image. Custom                  
    recovery images can only be used to refresh your PC.                                                                                                                                 

    The following commands can be specified:                                                                                                                                                                                                                                                
    /createimage <directory>                                                                  
    Captures a new custom recovery image in the location specified by                         
    <directory>, and sets it as the active recovery image.                                                                                                                                                                                                                          
    /setcurrent <directory>                                                                   
    Sets the active recovery image to the CustomRefresh.wim file in the                       
    location specified by <directory>. Windows will use this image when you                   
    refresh your PC, even if a recovery image provided by your PC's                           
    manufacturer is present.                                                                                                                                                                                                                                                        
    /deregister                                                                               
    Deregisters the current custom recovery image. If a recovery image                        
    provided by your PC's manufacturer is present, Windows will use that                      
    image when you refresh your PC. Otherwise, Windows will use your                          
    installation media when you refresh your PC.                                                                                                                                                                                                                                    
    /showcurrent                                                                              
    Displays the path to the directory in which the current active recovery                   
    image is stored.                                                                                                                                                                                                                                                               
     /help, /?                                                                                 
    Displays this help text.                           


    Thanks, Darrell Gorter [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights. VAMT - Volume Activation Management Tool - Download link http://www.microsoft.com/downloads/details.aspx?FamilyID=ec7156d2-2864-49ee-bfcb-777b898ad582&displaylang=en

    Tuesday, February 26, 2013 11:11 PM
  • Darrell,
      Can you please look into why Windows 7 file recovery "create system image" is
    broken on Microsoft Surface Pro? I have provided steps for repro at
    there is also a thread at
     

    Barb Bowman

    http://www.digitalmediaphile.com

    Wednesday, February 27, 2013 11:43 AM
  • Darrel,

    I am sorry to say, but now that I am yet more confused.

    I thought the recimg tool creates the recovery ISO. That's it creates an image of a system drive that can be later used to recover Windows by applying the created image to the existing system much like third-party backup and recovery solutions used to do. In other words, the recimg does NOT create a WinRE environment. Am I wrong?

    Thank you.


    Well this is the world we live in And these are the hands we're given...


    Wednesday, February 27, 2013 12:40 PM
  • Hello,

    Try this link then - Walkthrough: Create a Windows RE Image

    http://technet.microsoft.com/en-us/library/cc749147(v=ws.10).aspx


    Thanks, Darrell Gorter [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights. VAMT - Volume Activation Management Tool - Download link http://www.microsoft.com/downloads/details.aspx?FamilyID=ec7156d2-2864-49ee-bfcb-777b898ad582&displaylang=en

    Wednesday, February 27, 2013 7:42 PM
  • Hello,

    Try this link then - Walkthrough: Create a Windows RE Image

    http://technet.microsoft.com/en-us/library/cc749147(v=ws.10).aspx


    Thanks, Darrell Gorter [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights. VAMT - Volume Activation Management Tool - Download link http://www.microsoft.com/downloads/details.aspx?FamilyID=ec7156d2-2864-49ee-bfcb-777b898ad582&displaylang=en

    Ehmm... thanks Darrel, but I am sorry to say the article you are referring to sounds a complete nonsense; it seems to confuse WinRE to WinPE and gives no explanations as to where to get the WinRE environment's files, what if I don't need PE files in WinRE, and, finally, it refers to Windows Vista and its DVD.

    I would like to hear of somebody who were able to complete the walkthrough...

    Anyway, thank you for your help.

    If you happen to find any article that speaks of creating a WinRE environment and deploying it to WinRE partition, I'd highly appreciate if you could share it.


    Well this is the world we live in And these are the hands we're given...


    Wednesday, February 27, 2013 10:32 PM
  • Hello,

    WinRE is based on WinPE, which is where you get the image,  All you do is call the recovery environment from within WinPE.

    Look at step three this is where you tell it to load WinRE rather than boot to a CMD prompt

    AppPath=X:\sources\recovery\recenv.exe


    Thanks, Darrell Gorter [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights. VAMT - Volume Activation Management Tool - Download link http://www.microsoft.com/downloads/details.aspx?FamilyID=ec7156d2-2864-49ee-bfcb-777b898ad582&displaylang=en

    Wednesday, February 27, 2013 11:55 PM