MBR2GPT Failing in task sequence


  • Hi,

    I'm trying to add a task in MDT to convert MBR 2 GPT and also set Lenovo bios to UEFI once done. The steps seem to be failing, but cant pinpoint why.

    I cant seem to post images for some reason, but im using the guide from here:

    The lenovo_uefi.vbs script is as follows

    Dim strRequest,objWMIService,objItem

    Set objWMIService = GetObject("WinMgmts:" &"{ImpersonationLevel=Impersonate}!\\.\root\wmi")

    For Each objItem in objWMIService.ExecQuery("Select * from Lenovo_SetBiosSetting")
        ObjItem.SetBiosSetting "SecureBoot,Enable;", strReturn
        WScript.Echo " SetBiosSetting: " + strReturn

    For Each objItem in objWMIService.ExecQuery("Select * from Lenovo_SaveBiosSettings")
        ObjItem.SaveBiosSettings ";", strReturn
        WScript.Echo " SaveBiosSettings: " + strReturn

    My deployment keeps failing with error 0x80004005

    Not sure if thats the correct location to have those in place, if i move it down under state restore, it then runs in full windows OS, not PE. Not sure if i should raise it higher earlier on in the post install section.

    Im running latest MDT, with windows 10 1709 deployment, lenovo machines.

    Any help would be great.


    Friday, May 18, 2018 7:59 AM

All replies

  • To move from MBR to UEFI, you need to take additional BIOS settings into account. Enabling secure boot is not enough - unless, of course on Lenovo systems enabling Secure Boot also changes other relevant settings.

    Here is an excerpt from HP system settings:

    Legacy Boot Options
    UEFI Boot Options
    Configure Legacy Support and Secure Boot
    	Legacy Support Enable and Secure Boot Disable
    	*Legacy Support Disable and Secure Boot Enable
    	Legacy Support Disable and Secure Boot Disable

    Aside from that: 0x8004005 is a generic error. Please grab your BDD.log and post it to a public hosting site.  Could you also elaborate on your scenario? Are you trying to convert an existing installation to GPT partition schema or are you applying this during a wipe-and-load scenario? The latter is more tricky but can be done...


    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    Friday, May 18, 2018 8:50 AM
  • Hi Anton,

    Thanks for the quick reply. I'll have to get the logs next week and upload them.

    In the meantime, yes its primarily for wipe and load scenarios. But also for inplace upgrades. We are imaging from v1511 to v1709 so we are utilizing the builtin user backup/restore within MDT (USMT Hardlinks). in a  nutshell, new installs, and inplace upgrades.

    Ive got mbr2gpt running fine within windows during the final task sequence of installing apps, however i would prefer to do it earlier on, just after OS install in the PE environment.


    Friday, May 18, 2018 8:57 AM
  • Hi Anton,

    Ive just had a look through the bdd log and cant see any major issues. Anything in particular i should be looking out for?


    Sunday, May 20, 2018 10:47 PM
  • I am not entirely sure since I am not familiar with your task sequence. This is why I would need to see your BDD.log to gain a better understanding of your approach to MBR2GPT conversion. As stated above 0x8004005 is a generic error, but BDD.log usually includes an error that actually leads to TS failure.


    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    Tuesday, May 22, 2018 9:49 AM
  • Lenovo has the ThinkBIOS Config Tool on their blog that should be able to help with configuring BIOS Settings.  It can generate output files, can be used in MDT and SCCM, has a gui.  Check it out at

    Also, just to make sure I am following you, are you trying to take a computer and just convert the drive and BIOS all at the same time or are you attempting to just wipe and reload and want to change the BIOS Settings?  Clarifying your needs here that is all.


    Wednesday, May 23, 2018 8:43 PM
  • Hi Anton/Lawson,

    Ive done with a workaround at the moment, where mbr2gpt runs a little later in the task sequence during app deployment. Not ideal, but it seems to only work there and not in winPE.

    With the bios, i did come across that ThinkBios config tool, but it looks like these particular models arent supported, so i've manually scripted a popup reminder to change bios settings on next boot. Again a workaround.

    As for your last question Lawson, its to wipe and reload, then change.

    at the moment we have  a fleet of machines all running on MBR / legacy boot. Latest image will get them running on to UEFI with GPT.

    Ideally i would like to create the GPT partition from the beginning and not worry about the conversion, however i dont think this is possible if wanting to use user data backup/restore with USMT hardlinks.

    Is anyone able to confirm this? When i try to run the deployment where it creates a GPT partition, i get errors thrown if i try and backup/restore a user profile. Obviously it works fine if I choose not to backup anything.


    Thursday, May 24, 2018 4:08 AM
  • What models are you using?
    Thursday, May 24, 2018 3:02 PM
  • Have you tried following approach: start in legacy mode, apply BIOS settings, apply OS image, run mbr2gpt as the last TS step prior to the first reboot? We are using this approach at one of our customers to push systems configured for Windows 7 to Windows 10 compliance levels without any hard reboots in WinPE to apply updated BIOS configuration. Just to clarify - the sequence of steps involved outlined above is for wipe-and-load scenarios. Feature updates TS are not that different however.


    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    Friday, May 25, 2018 7:56 AM