Dism / Imaging question


  1. Posts : 505
    Windows 10 Pro (Mix of Builds) / Linux Mint
       #1

    Dism / Imaging question


    Hello Gang, Long time no posts from me.

    Personally been a fun year so far, heart surgery, but on the job side I'm FINALLY somewhere where I'm loved and I love the people I'm with, plus I'm learning a crapton of stuff!

    Ok, a lot of that has delved into dism / imaging and powershell scripting. It really has been fun.

    Ok, my setup and the question:

    Have an optiplex mini desktop, booted it up to 10, preformed all updates, etc. up to 21H2 19044.1682 , ran a prep script I wrote which consolidated 3 scripts we used to run to get the machine prepped for use in the organization (removing bloat, setting support options, etc.)

    I then rana sysprep on it: /oobe / generalize / shutdown (This time I didnt use an unattend file, hadnt yet made one for this model)

    It ran and shutdown. I immediately boot into a win PE drive (Latest) and used dism to capture my c drive image.

    My question though, is somehow, something has changed from my previous results: the system I took the image off of, when rebooting it up goes to an winload.efi BSOD. I don't recall having that issue before.

    Troubleshooting, it appears the BCD is gone on it.

    Now, that said, I took my brand new image of C, booted the "Source" PC and wiped C, then applied the image, and that works, it boots to oobe. In addition and other separate PC I boot to PE, wipe C amd apply the image, and it boots to oobe.

    I'm happy on the appearance that the image itself is good (so far), but am scratching my head as to why the source PC behaves as such after I did the sysprep and took the image.

    With this limited info on the process, anyone have any ideas? (Hey, and long as I can use the image itself, reapplying it to the source PC and the others in the line is not a problem for me, I definitely believe I've ruled out the image itself being bad ...)

    I appreciate al the wonderful people here!

    Marc
      My Computer


  2. Posts : 2,800
    Windows 7 Pro
       #2

    Dism does not take the system partitions in consideration when restoring an OS image to a system.

    When you say wiped the C: did you mean the Volume... if it's the case there is still a UEFI partiton on the machine and that's why it booted...

    To restore a whole working machine you also need to capture and apply the systems, and recovery partitions.
      My Computers


  3. Posts : 505
    Windows 10 Pro (Mix of Builds) / Linux Mint
    Thread Starter
       #3

    I apologize, I did mean the volume. I'm not capturing all of the partitions/volumes into one WIM file, just the C drive volume

    Previously on these optiplexes, I could image the OS volume, while generalized, they were being applied to other machines of same model/HW, the drive structure was the same as far as recovery and other partitions ....
      My Computer


  4. Posts : 505
    Windows 10 Pro (Mix of Builds) / Linux Mint
    Thread Starter
       #4

    Still not sure what to do. I've previously not had this issue, once sysprepped the source machine could still boot to OOBE, whether or not I chose to boot it to winPE to capture an image off of it.

    Something in the sysprep process is screwing the BCD here and I don't know what.

    I'm running sysprep.exe /oobe / generalize /shutdown /unattend: <xml file path>

    The fact that I'm talking the OS only hasnt matted int eh past between models, there are HP Laptops. For my Dell Optiplex's, I have one wim of the C volume I took after sysprepping and it applies just fine to the 4 models I have...

    Any other thoughts? I'm using the 22000 version of WinPE and sysprep
      My Computer


  5. Posts : 2,800
    Windows 7 Pro
       #5

    Ok, I'm not sure how you do this. But if you are restoring the image on a brand new drive. This is the procedure I follow.

    Fist I optimize the image I want to capture:
    Code:
    DISM /image:C:\ /optimize-image /boot

    Then I capture It:
    Code:
    Dism /Capture-Image /ImageFile:"D:\Images\W10xxx.wim" /CaptureDir:C:\ /Name:Win10xxx

    On the destination machine depending if it is MBR or UEFI I use one of the following:
    Code:
    diskpart /s CreatePartitions-xxx.txt

    MBR:
    Code:
    rem == CreatePartitions-BIOS.txt ==
    rem == These commands are used with DiskPart to
    rem    create three partitions
    rem    for a BIOS/MBR-based computer.
    rem    Adjust the partition sizes to fill the drive
    rem    as necessary. ==
    select disk 0
    clean
    rem == 1. System partition ======================
    create partition primary size=100
    format quick fs=ntfs label="System"
    assign letter="S"
    active
    rem == 2. Windows partition =====================
    rem ==    a. Create the Windows partition =======
    create partition primary
    rem ==    b. Create space for the recovery tools  
    rem       ** Update this size to match the size of
    rem          the recovery tools (winre.wim)
    rem          plus some free space.
    shrink minimum=650
    rem ==    c. Prepare the Windows partition ====== 
    format quick fs=ntfs label="Windows"
    assign letter="W"
    rem == 3. Recovery tools partition ==============
    create partition primary
    format quick fs=ntfs label="Recovery"
    assign letter="R"
    set id=27
    list volume
    exit

    UEFI:
    Code:
    rem == CreatePartitions-UEFI.txt ==
    rem == These commands are used with DiskPart to
    rem    create four partitions
    rem    for a UEFI/GPT-based PC.
    rem    Adjust the partition sizes to fill the drive
    rem    as necessary. ==
    select disk 0
    clean
    convert gpt
    rem == 1. System partition =========================
    create partition efi size=100
    rem    ** NOTE: For Advanced Format 4Kn drives,
    rem               change this value to size = 260 ** 
    format quick fs=fat32 label="System"
    assign letter="S"
    rem == 2. Microsoft Reserved (MSR) partition =======
    create partition msr size=16
    rem == 3. Windows partition ========================
    rem ==    a. Create the Windows partition ==========
    create partition primary 
    rem ==    b. Create space for the recovery tools ===
    rem       ** Update this size to match the size of
    rem          the recovery tools (winre.wim)
    rem          plus some free space.
    shrink minimum=500
    rem ==    c. Prepare the Windows partition ========= 
    format quick fs=ntfs label="Windows"
    assign letter="W"
    rem === 4. Recovery partition ======================
    create partition primary
    format quick fs=ntfs label="Recovery"
    assign letter="R"
    set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
    gpt attributes=0x8000000000000001
    list volume
    exit

    Then I restore the image:
    Code:
    rem == ApplyImage.bat ==
    
    rem == These commands deploy a specified Windows
    rem    image file to the Windows partition, and configure
    rem    the system partition.
    
    rem    Usage:   ApplyImage WimFileName 
    rem    Example: ApplyImage E:\Images\ThinImage.wim ==
    
    rem == Set high-performance power scheme to speed deployment ==
    call powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
    
    rem == Apply the image to the Windows partition ==
    dism /Apply-Image /ImageFile:%1 /Index:1 /ApplyDir:W:\
    
    rem == Copy boot files to the System partition ==
    W:\Windows\System32\bcdboot W:\Windows /s S:
    
    :rem == Copy the Windows RE image to the
    :rem    Windows RE Tools partition ==
    md R:\Recovery\WindowsRE
    xcopy /h W:\Windows\System32\Recovery\Winre.wim R:\Recovery\WindowsRE\
    
    :rem == Register the location of the recovery tools ==
    W:\Windows\System32\Reagentc /Setreimage /Path R:\Recovery\WindowsRE /Target W:\Windows
    
    :rem == Verify the configuration status of the images. ==
    W:\Windows\System32\Reagentc /Info /Target W:\Windows

    Hope this helps give some inspiration to find whats not going right.
      My Computers


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

    There is a difference when Applying an Image to an existing partition..
    And Setting up a New Drive - with a New Drive you have to Create the Partition(s), Apply the Image, Create the Boot Files, and set the Recovery Location...... Thus same method as Malok....
      My Computer


  7. Posts : 2,800
    Windows 7 Pro
       #7

    This batch was approved by Chuck Norris.
      My Computers


  8. Posts : 505
    Windows 10 Pro (Mix of Builds) / Linux Mint
    Thread Starter
       #8

    Thank guys, I'll look at this.

    Maylok - The procedure I had going was under ( I just want everyone to understand what I was doing):

    https://docs.microsoft.com/en-us/win...iew=windows-11

    For the particular model, I would power up the unit booting directly to WinPE and:

    Diskpart, list vol, note C volume, capture the individual partitions as factory, C drive, and then assigning letters to recovery, etc to get those.

    I'd then reboot the system oobe and setup with all windows and app updates, run our clean up scripts and then run sysprep as indicated above, oobe generalize and shutdown (with or without an unattend on occasion)

    I'd then ideally boot to PE again and take the C partition capture. Had not needed the others before, I could apply the C partition wim back to any of the that model and I'd be good, and the source machine the image was taken from would boot to OOBE.

    That's where the process has gone wrong now, on this HP lappy model series (I have two of them), after sysprep runs and it shuts off per direction, I can boot to PE and capture images of any of the partitions, had only taken C and as above could apply it to the same model onwards, but now the source machine cant boot having a screwed up BCD and winload.efi BSOD. and if that C partition is applied to to others, same thing.

    I thought it might be the HP Sure Start bios settings, but tried it with those off (from another thread I read)

    BTW, the above works for the Dell Optiplex desktops I have, I have one C partition of a sysprepped machine wim file and can flash that to any of the others no problem. Have been running this way for about a year, first time running into this. In fact the otheer day I recently made a new Optiplex C partition wim because the one I had was about three feature updates "behind" and I wanted to have a machine on 21H2 after applying it's C image.
      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 10:50.
Find Us




Windows 10 Forums