Clean install Windows 10, preserving the EFI partition

Page 1 of 2 12 LastLast

  1. Posts : 2,450
    Windows 10 Pro x64
       #1

    Clean install Windows 10, preserving the EFI partition


    I want to clean install Windows 10 on a new hp laptop, to get rid of the hp bloatware.

    What I usually do to clean install, is boot from a Windows 10 installation USB, use a diskpart script (by pressing Shift+F10 at setup) to create the 4 reuired partitions, namely:
    EFI (100MB), MSR (16MB), Windows (Rest of disk – 950MB), WindowsRE (950MB).
    The script is the following:
    Code:
    rem ================ Disk preparation =================
    select disk 0
    clean
    convert gpt
    
    rem ============= 1. EFI System partition =============
    create partition efi size=100
    format quick fs=fat32
    
    rem ====== 2. Microsoft Reserved (MSR) partition ======
    create partition msr size=16
    
    rem ============== 3. Windows partition ===============
    create partition primary
    shrink minimum=950
    format quick fs=ntfs
    assign letter="W"
    
    rem =============== 4. WinRE partition ================
    create partition primary
    format quick fs=ntfs label="WinRE"
    set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
    The problem that I want to solve is to clean install, delete all partitions with the exception of the EFI partition, which is currently set to 260MB and not the usual 100MB, as it holds in an “HP” directory the hp Diagnostics (run when we press F2 at boot) and data used for BIOS updates.

    This HP directory, I wanna preserve is currently as follows:
    Code:
        Directory: F:\EFI\HP
    
    Mode                LastWriteTime         Length Name                                                                  
    ----                -------------         ------ ----                                                                  
    d-----       16/01/2020     12:01                DevFw                                                                 
    d-----       16/01/2020     01:17                BIOS                                                                  
    d-----       16/01/2020     01:17                BiosUpdate                                                            
    d-----       16/01/2020     01:17                SystemDiags
    Mind you that the current EFI partition is already saved in a Macrium Reflect image.

    Clean install Windows 10, preserving the EFI partition-mr_backup.png

    What are the proposed steps to do this, clean install by preserving the existing EFI partition?

    What I though was to alter the script to create a 260MB EFI partition, clean install normally and after completion, restore the 260MB EFI from the Macrium Image. Will that work, or more things are needed?

    Any suggestion is more than welcomed!
      My Computer


  2. Posts : 4,144
    Windows 3.1 to Windows 11
       #2

    Select Disk 0
    Select Partition 3 & Format
    Select Partition 4 & Format
    Install windows using current disk format/Partitions

    OR Manually Delete the 3 Partitions - Keeping the EFI
    Code:
    rem ================ Disk preparation =================
    select disk 0
    
    rem ====== 2. Microsoft Reserved (MSR) partition ======
    create partition msr size=16
    
    rem ============== 3. Windows partition ===============
    create partition primary
    shrink minimum=950
    format quick fs=ntfs
    assign letter="W"
    
    rem =============== 4. WinRE partition ================
    create partition primary
     format quick fs=ntfs label="WinRE"
    set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
      My Computer


  3. Posts : 2,450
    Windows 10 Pro x64
    Thread Starter
       #3

    Kyhi said:
    Select Disk 0
    Select Partition 3 & Format
    Select Partition 4 & Format
    Install windows using current disk format/Partitions

    OR Manually Delete the 3 Partitions - Keeping the EFI
    Code:
    rem ================ Disk preparation =================
    select disk 0
    
    rem ====== 2. Microsoft Reserved (MSR) partition ======
    create partition msr size=16
    
    rem ============== 3. Windows partition ===============
    create partition primary
    shrink minimum=950
    format quick fs=ntfs
    assign letter="W"
    
    rem =============== 4. WinRE partition ================
    create partition primary
     format quick fs=ntfs label="WinRE"
    set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
    Thanks a lot Jimmy.
    Reading about the diskpart commands, I saw that
    You cannot delete the system partition, boot partition, or any partition that contains the active paging file or crash dump information.
    i.e the windows partition.

    That's why I posted the question, so sorry for sounding stupid, but how to delete them manually? Boot to PE and use minitool?
      My Computer


  4. Posts : 2,799
    Linux Mint 20.1 Win10Prox64
       #4

    Assuming you've already have backup of this drive.
    Saving the EFI partition might not be enough, The BCD might contain custom key(s) and WinRe.wim might contain the diagnostic software.

    You can try to install Windows using dism command, leave everything else alone:
    1. Boot up Windows Installation media. On first screen, Hold SHIFT+F10 to get command prompt.
    2. Type: echo list disk | diskpart to identify the Windows OS drive letter, it might not be C. Also the drive letter of the installation media.
    3. Format X drive: format X: /y /Q /FS:NTFS /V:WINDOWS where X is the drive letter of Windows found in step 2
    4. Navigate to root folder of the installation media found in step 2, find out if sources\install.wim or sources\install.esd existed, use it on the next command,use install.esd if install.wim does not exist:
      dism /Get-WimInfo /WimFile:sources\install.wim ==> get index # of Windows edition you want to install and use it on the next command
      dism /Apply-Image /ImageFile:sources\install.wim /index:# /ApplyDir:X:\
      where X is the drive letter formatted in step 3 and # is the index for the Windows edition.
    5. reboot
      My Computer


  5. Posts : 2,450
    Windows 10 Pro x64
    Thread Starter
       #5

    topgundcp said:
    You can try to install Windows using dism command, leave everything else alone:
    1. Boot up Windows Installation media. On first screen, Hold SHIFT+F10 to get command prompt.
    2. Type: echo list disk | diskpart to identify the Windows OS drive letter, it might not be C. Also the drive letter of the installation media.
    3. Format X drive: format X: /y /Q /FS:NTFS /V:WINDOWS where X is the drive letter of Windows found in step 2
    4. Navigate to root folder of the installation media found in step 2, find out if sources\install.wim or sources\install.esd existed, use it on the next command,use install.esd if install.wim does not exist:
      dism /Get-WimInfo /WimFile:sources\install.wim ==> get index # of Windows edition you want to install and use it on the next command
      dism /Apply-Image /ImageFile:sources\install.wim /index:# /ApplyDir:X:\
      where X is the drive letter formatted in step 3 and # is the index for the Windows edition.
    5. reboot

    Thank you Dino. I really appreciate it!
      My Computer


  6. Posts : 4,144
    Windows 3.1 to Windows 11
       #6

    you may also want to look into C:\Recovery for a custom *.ppkg file
    this would be the OEM customizations package (wim)

    Some OEM's (Dell) also create an EFI.wim which is the EFI partition package

    Creating OEM Rescue Media will contain all the Bare Metal Reset Packages
      My Computer


  7. Posts : 2,450
    Windows 10 Pro x64
    Thread Starter
       #7

    Kyhi said:
    you may also want to look into C:\Recovery for a custom *.ppkg file
    this would be the OEM customizations package (wim)

    Some OEM's (Dell) also create an EFI.wim which is the EFI partition package

    Yep...you're right.

    Code:
    PS C:\windows\system32> dir C:\Recovery\Customizations\
    
    
        Directory: C:\Recovery\Customizations
    
    
    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    -a----       16/01/2020     11:32     5947892758 FactoryApps_TU.ppkg
    but this looks to me a backup of the bloatware I want to avoid.

    I'm thinking of booting with the legendary Kyhi Rescue disk, delete with minitool or AOMEI the 3 partitions and then start the usual installation process by creating the 3 deleted partitions.
      My Computer


  8. Posts : 4,144
    Windows 3.1 to Windows 11
       #8

    that package also contains the OEM Drivers....
    But yes Mostly the Bloatware....
    I would also use DISM to export the current 3rd Party Drivers from Current OS...

    One Note about Dino's command - WinPE will be assigned drive letter X
    So the proper drive letter to assign would be to assign drive letter W

    I have an Image-Prep Batch file that will prep the Install.wim with Exported Drivers, Genuine Ticket for activation
    and also allow you to add driver to WinRE in case of Touch PC
    https://www.tenforums.com/attachment...-image-prep.7z

    Just Mount the New OS media - drag-drop the Install.wim or esd onto the cmd
    Follow the screen prompts
      My Computer


  9. Posts : 2,799
    Linux Mint 20.1 Win10Prox64
       #9

    @ddelo
    If you wish to fresh install Windows 10. Here's a little program I wrote, just copy the executable to the root folder of the installation media then run. Answer 3 questions: Windows Edition, Mode (gpt/mbr), disk # to install on. Take about 5 min. Once done, reboot.

    You can also install Windows on another disk while Windows is running without having to disconnect anything.

    EZWinInstall.rar
      My Computer


  10. Posts : 2,450
    Windows 10 Pro x64
    Thread Starter
       #10

    @Kyhi
    Jimmy,
    One of the reasons I wanna clean install is the 3rd party drivers installed in the hp factory image.
    They have installed every possible driver for all possible devices they use with the current laptop model. So for instance I have more than 10 audio device drivers whereas I only need the Realtek one. So exporting the current drivers won't help a lot.
    That's why I thought of using your (customized) rescue disk and delete the 3 partitions leaving only the EFI, before using the W10 installation disk (iso).
      My Computer


 

  Related Discussions
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 02:17.
Find Us




Windows 10 Forums