3 Replies Latest reply on Jan 3, 2019 9:01 AM by phoffmann

    ImageX image fails to apply to hard drive that is never had an OS.

    derikd62 Rookie

      We have noticed that our Windows 10 ImageX image fails to apply on hard drives that have never had an OS installed. Is there a way to resolve this issue? Here is the DiskPart commands we are using to prepare the hard drive for the image. If we apply our Windows 7 ImageW image to the drive first then we can use the ImageX image without issue.

       

      Thanks

       

      x:\windows\system32\diskpart.exe /s X:\win10_UEFI.txt

       

      win10_UEFI.txt:
      select disk 0
      clean
      convert gpt

      rem == 1. System partition =========================

      create partition efi size=500
      format quick fs=fat32 label="System"
      assign letter="S"

      rem == 2. Microsoft Reserved (MSR) partition =======
      create partition msr size=128

      rem == 3. Windows partition ========================
      rem ==    a. Create the Windows partition ==========
      create partition primary
      rem ==    b. Create space for the recovery tools ===
      shrink minimum=1000
      rem ==    ** NOTE: Update this size to match the size of the recovery tools (winre.wim) plus free space **
      rem ==    c. Prepare the Windows partition =========
      format quick fs=ntfs label="Windows"
      assign letter="C"

      rem === 4. Recovery tools partition ================
      create partition primary
      format quick fs=ntfs label="Recovery tools"
      assign letter="R"
      set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
      gpt attributes=0x8000000000000001

      list volume
      exit

        • 1. Re: ImageX image fails to apply to hard drive that is never had an OS.
          phoffmann SupportEmployee

          The problem may that you're beginning with trying to convert a disk to GPT ... except that chances are it's never been formatted (you may want to confirm by checking it yourself).

           

          Something like this - New-Partition - may help you (and you could run a PS-script to handle an "If ... ELSE..." type situation , depending on whether you're dealing with unformatted disks or not?

          • 2. Re: ImageX image fails to apply to hard drive that is never had an OS.
            derikd62 Rookie

            phoffmann thanks for your reply.

             

            I was thinking something similar. That I may need to create a petition and format the drive before proceeding. If I wanted to stay with DiskPart what do you think about this as an option.

             

            select disk 0
            clean
            create partition primary
            format quick fs=ntfs label="Windows"
            assign letter="C"
            clean
            convert gpt

            And then continue with the rest of the commands as before.

            • 3. Re: ImageX image fails to apply to hard drive that is never had an OS.
              phoffmann SupportEmployee

              As long as you "never" have to worry about more than 1 partition on the primary disk, or similar situations ... the above "looks" OK.

               

              But since I'm usually suspicious of things being more complicated, that's why I suggested the PowerShell approach (as that allows for a lot more "If.. Then ... Else..." decision capability on the box since I've no idea how simple or complex your devices are (and they are usually more complex than one would like -- often with hidden "Oh yeah and then there's THIS group of special cases..." to worry about).

               

              So I recommend ... "consider the WORST that your logic could do" and as long as that still does what you want it to, give it a try. Just treat any logic carefully ... as there's a bunch of "oops" (from a "behaving as written, rather than intended") throughout the entire sphere of IT .