1.    02 Apr 2017 #1
    Join Date : Apr 2017
    Posts : 3
    Windows 10 Home

    How to sign an existing partition to EFI partition with diskpart


    I was trying to install linux on my UEFI mode windows 10 laptop couple days ago, unfortunately there's something went wrong during the installation process, the grub directly wrote data in my win10 system boot partition. Luckily I saved my data and all the partition still in hard disk. Now I am using command prompt to do recovery, the partition table shows that the system partition 1, size 260mb EFI partition, there's no symbol marked beside, I believe it's changed by the linux and win10 boot data are corrupted, my idea is to sign this partition as EFI and format it again, then bcdboot files later. What command should I use next? Thanks a lot!

    ps:
    partition 3 - windows C:\
    partition 5 - windows D:\
    partition 6-9 my installed linux

    Click image for larger version. 

Name:	44763731.jpg 
Views:	31 
Size:	153.6 KB 
ID:	127777
      My ComputerSystem Spec
  2.    02 Apr 2017 #2
    Join Date : May 2015
    Central IL
    Posts : 4,210
    Mac OS Sierra

    You cannot use UEFI and Secure boot with Linux on consumer equipment. It is made to work with certain Server hardware.

    Turn off UEFI and Secure boot in thr bios and you should be able to install Linux.
      My ComputerSystem Spec
  3.    02 Apr 2017 #3
    Join Date : Apr 2017
    Posts : 3
    Windows 10 Home
    Thread Starter

    Quote Originally Posted by bro67 View Post
    You cannot use UEFI and Secure boot with Linux on consumer equipment. It is made to work with certain Server hardware.

    Turn off UEFI and Secure boot in thr bios and you should be able to install Linux.
    Thx for your advice, I know that Linux couldn't install under UEFI mode or enable Secure boot, both are disable already, at the moment I am not worry about too much Linux since I can reinstall later, I really want my windows back to work.
      My ComputerSystem Spec
  4.    03 Apr 2017 #4
    Join Date : Jul 2015
    Posts : 9,341
    Windows 10 Pro

    To make the existing partition 1 an EFI System partition, the command is:

    select part 1
    set id=c12a7328-f81f-11d2-ba4b-00a0c93ec93b override

    Code:
    DISKPART> help set id
    
        Changes the partition type field for the partition with focus.
    
    Syntax:  SET ID={<BYTE> | <GUID>} [OVERRIDE] [NOERR]
    
        ID={<BYTE> | <GUID>}
    
                    Specifies the new partition type.
    
                    For master boot record (MBR) disks, you can specify a partition
                    type byte, in hexadecimal form, for the partition. Any
                    partition type byte can be specified with this parameter except
                    for type 0x42 (LDM partition). Note that the leading '0x' is
                    omitted when specifying the hexadecimal partition type.
    
                    For GUID partition table (GPT) disks you can specify a
                    partition type GUID for the partition. Recognized GUIDs
                    include:
    
                        EFI System partition:
                            c12a7328-f81f-11d2-ba4b-00a0c93ec93b
    
                        Basic data partition:
                            ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
    
                    Any partition type GUID can be specified with this parameter
                    except for the following:
    
                        Microsoft Reserved partition:
                            e3c9e316-0b5c-4db8-817d-f92df00215ae
    
                        LDM Metadata partition on a dynamic disk:
                            5808c8aa-7e8f-42e0-85d2-e1e90434cfb3
    
                        LDM Data partition on a dynamic disk:
                            af9b60a0-1431-4f62-bc68-3311714a69ad
    
                        Cluster Metadata partition:
                            db97dba9-0840-4bae-97f0-ffb9a327c7e1
    
    
                    Other than the limitations mentioned, DiskPart otherwise does
                    not check the partition type for validity except to ensure that
                    it is a byte in hexadecimal form or a GUID.
    
        OVERRIDE    Enables DiskPart to force the file system on the volume to
                    dismount before changing the partition type. When changing
                    the partition type, DiskPart will attempt to lock and dismount
                    the file system on the volume. If this parameter is not specified,
                    and the call to lock the file system fails, (because some other
                    application has an open handle to the volume), the entire
                    operation will fail. When this parameter is specified, the
                    dismount is forced even if the call to lock the file system
                    fails. When a file system is dismounted, all opened handles to
                    the volume will become invalid.
    
        NOERR       For scripting only. When an error is encountered, DiskPart
                    continues to process commands as if the error did not occur.
                    Without the NOERR parameter, an error causes DiskPart to exit
                    with an error code.
    
        Intended for Original Equipment Manufacturer (OEM) use only.
    
        A partition must be selected for this operation to succeed.
    
        Caution:
    
            Changing partition type fields with this parameter might cause your
            computer to fail or be unable to start up. Unless you are an OEM or an
            IT professional experienced with GPT disks, do not change partition
            type fields on GPT disks using this parameter. Instead, always use the
            CREATE PARTITION EFI command to create EFI System partitions, the
            CREATE PARTITION MSR command to create Microsoft Reserved partitions,
            and the CREATE PARTITION PRIMARY command without the ID parameter to
            create primary partitions on GPT disks.
    
        This command does not work on dynamic disks nor on Microsoft Reserved
        partitions.
    
        Example:
    
        SET ID=07 OVERRIDE
        SET ID=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
      My ComputerSystem Spec
  5.    06 Apr 2017 #5
    Join Date : Apr 2017
    Posts : 3
    Windows 10 Home
    Thread Starter

    Thank you so much for the info, I successfully set the partition as EFI, I also did copied the boot file into it but unfortunately it still didn't work out, I can't see windows boot manager in my bios and my hard disk is still invisible in the boot menu, my windows still can't boot, after couple days hard working, I gave up. Now am waiting for my Asus laptop recovery media which includes a factory re-install image from Asus service center, to see if I could reset my laptop and do a clean reinstall.

    Click image for larger version. 

Name:	67249407.jpg 
Views:	11 
Size:	110.7 KB 
ID:	128674

    Quote Originally Posted by NavyLCDR View Post
    To make the existing partition 1 an EFI System partition, the command is:

    select part 1
    set id=c12a7328-f81f-11d2-ba4b-00a0c93ec93b override

    Code:
    DISKPART> help set id
    
        Changes the partition type field for the partition with focus.
    
    Syntax:  SET ID={<BYTE> | <GUID>} [OVERRIDE] [NOERR]
    
        ID={<BYTE> | <GUID>}
    
                    Specifies the new partition type.
    
                    For master boot record (MBR) disks, you can specify a partition
                    type byte, in hexadecimal form, for the partition. Any
                    partition type byte can be specified with this parameter except
                    for type 0x42 (LDM partition). Note that the leading '0x' is
                    omitted when specifying the hexadecimal partition type.
    
                    For GUID partition table (GPT) disks you can specify a
                    partition type GUID for the partition. Recognized GUIDs
                    include:
    
                        EFI System partition:
                            c12a7328-f81f-11d2-ba4b-00a0c93ec93b
    
                        Basic data partition:
                            ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
    
                    Any partition type GUID can be specified with this parameter
                    except for the following:
    
                        Microsoft Reserved partition:
                            e3c9e316-0b5c-4db8-817d-f92df00215ae
    
                        LDM Metadata partition on a dynamic disk:
                            5808c8aa-7e8f-42e0-85d2-e1e90434cfb3
    
                        LDM Data partition on a dynamic disk:
                            af9b60a0-1431-4f62-bc68-3311714a69ad
    
                        Cluster Metadata partition:
                            db97dba9-0840-4bae-97f0-ffb9a327c7e1
    
    
                    Other than the limitations mentioned, DiskPart otherwise does
                    not check the partition type for validity except to ensure that
                    it is a byte in hexadecimal form or a GUID.
    
        OVERRIDE    Enables DiskPart to force the file system on the volume to
                    dismount before changing the partition type. When changing
                    the partition type, DiskPart will attempt to lock and dismount
                    the file system on the volume. If this parameter is not specified,
                    and the call to lock the file system fails, (because some other
                    application has an open handle to the volume), the entire
                    operation will fail. When this parameter is specified, the
                    dismount is forced even if the call to lock the file system
                    fails. When a file system is dismounted, all opened handles to
                    the volume will become invalid.
    
        NOERR       For scripting only. When an error is encountered, DiskPart
                    continues to process commands as if the error did not occur.
                    Without the NOERR parameter, an error causes DiskPart to exit
                    with an error code.
    
        Intended for Original Equipment Manufacturer (OEM) use only.
    
        A partition must be selected for this operation to succeed.
    
        Caution:
    
            Changing partition type fields with this parameter might cause your
            computer to fail or be unable to start up. Unless you are an OEM or an
            IT professional experienced with GPT disks, do not change partition
            type fields on GPT disks using this parameter. Instead, always use the
            CREATE PARTITION EFI command to create EFI System partitions, the
            CREATE PARTITION MSR command to create Microsoft Reserved partitions,
            and the CREATE PARTITION PRIMARY command without the ID parameter to
            create primary partitions on GPT disks.
    
        This command does not work on dynamic disks nor on Microsoft Reserved
        partitions.
    
        Example:
    
        SET ID=07 OVERRIDE
        SET ID=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
      My ComputerSystem Spec

 


Similar Threads
Thread Forum
"We couldn't create a new partition or locate an existing one"
So I'm trying to install Windows 10 32-bit on a friend's laptop from a USB stick and it's giving me this error, no matter what I do. I've tried setting the partition as active, I don't have anything else plugged in, and I've unplugged and replugged...
Installation and Upgrade
Windows couldn't create a partition or locate an existing one
I had a kali linux installed in my computer. Then I tried to install Windows 10 using a bootable USB drive. (I created it by downloading the windows 10 ISO and then creating USB drive using Rufus.) But when I was trying to install windows 10, it...
Installation and Upgrade
inconsistent partition info in disk manager / diskpart
Hello Forum! I hope I can find a guru here, who can explain the "interesting" phenomena of different partition types (in disk manager it's actually listed in the "status" column) being displayed by disk manager vs diskpart. The setup: disk0...
Performance & Maintenance
Solved "We couldn't create a new partition or locate an existing one" error
When I try to do a clean install of Win10 Home 64-bit on a Dell Inspiron N5010 (a little over 4 years old) using the Media Creation Tool on a USB, I get to the "Where do you want to install Windows?" screen and when I select the Drive 0 Unallocated...
Installation and Upgrade
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 18:35.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums