DISM to Capture Entire Disk As-Is
Solution 1
You can now do it easily with the new "Windows Full Flash Update", integrated in DISM starting from Windows 10 v1709
Solution 2
It is possible, but not necessarily easy. You could use /Append-Image to capture all partitions to one WIM file and then deploy each partition with DISM from that WIM file on the other side. It still isn’t a sector-based image or a disk level image, DISM is a volume imaging tool that uses WIM file-based imaging.
Another alternative is that you could Disk2VHD the reference system and then use Boot to VHD to boot the deployed systems.
Related videos on Youtube
JuliusPIV
Updated on September 18, 2022Comments
-
JuliusPIV almost 2 years
In short: Is it possible to leverage dism to capture an image of an entire disk as-is, akin to taking an image with Ghost, GParted, PartedMagic, CloneZilla etc.?
I've got a shiny new machine and before I tear into it, I'd like an image of the disk to get back to this point today. We use MDT and are in the process of standing up SCCM so I have some exposure to dism.
I know I can use dism to create WIMs of volumes with the caveat that they have to have letters assigned, right? What about entire disks as-is?
This machine has:
- 1 disk
- 5 partitions:
- Recovery 1000MB
- System 260MB
- Reserved 128MB
- Primary 462GB
- Recovery 12GB
- 5 volumes:
- Vol 0: E DVD
- Vol 1: C Windows OS
- Vol 2: WINRE_DRV Hidden
- Vol 3: SYSTEM_DRV Hidden
- Vol 4: Lenovo_Recovery Hidden
- Vol 5: D USB Boot Media
- 5 partitions:
The only way I can think of to capture all this is to
- Assign letters to the hidden volumes via diskpart (sel vol n > assign > repeat > exit) resulting in:
- Vol 1: C Windows OS
- Vol 2: F WINRE_DRV
- Vol 3: G SYSTEM_DRV
- Vol 4: H Lenovo_Recovery
- Create the initial wim:
- dism /capture-image /imagefile:\path\to\backup.wim /capturedir:c: /name:C-WinOS
- Append other volumes to the initial wim:
- dism /append-image /imagefile:\path\to\backup.wim /capturedir:F: /name:F-WINRE_DRV
- dism /append-image /imagefile:\path\to\backup.wim /capturedir:G: /name:G-SYSTEM_DRV
- dism /append-image /imagefile:\path\to\backup.wim /capturedir:H: /name:H-Lenovo_Reco
Is there a better/easier way?
-
Ramhound about 9 yearsYour method is the way. You image each partition into its own file. You then create the partitions and apply the image to the partition. I just did use this exact approach.
-
Daniel B about 9 yearsIs there any special reason why you want to use DISM? I think you’re terribly overcomplicating things. Just grab a LZO-compressed full disk image.
-
JuliusPIV about 9 years@DanielB: No 'special reason' per-se but... (a) Since I'm not the only one managing images, I find its easier for others if I keep things consistent. Some folks here may not know how to access another format. (b) I wanted to leverage existing technology & infrastructure to capture an image. I have a working 'capture-only' task sequence, but it wasn't getting everything which is what made me dive deeper into this. (c) I've also never thought of or tried creating an LZO-compressed disk image. Got any recommendations? Thanks again!
-
Daniel B about 9 yearsWhat you want to achieve here is quite different from what DISM is aimed at. You’re trying to capture the disk state, 1:1. The way to go for that is, for course, a full image. It’ll also include the partition table and any boot code. Whether you compress it or not is entirely up to you.
-
Alex S about 7 years@Phylum - How did this work out for you? I might try to do the same for a machine.
-
Alex S about 7 years@Ramhound - When would you do this WIM (File based Image) via DISM versus VHD (Sectory based Image) via a Disk2VHD / Paragon HDM style S/w?
-
Ramhound about 7 years@AlexS - The DISM process is faster. I can create a .wim image of one partition and then apply it to a different partition all using a single PowerShell script.
-
Alex S about 7 years@Ramhound - Nice. Care to share some sample scripts :) ?
-
Ramhound about 7 years@AlexS - I have numerous scripts. They are just not my scripts to just hand out, and also, outside of the scope of this question. They are also isolated on a secured system, so even I wanted to share them (I do not), I don't have the means to do so.
-
Alex S about 7 years@Ramhound - Fair enough - Could you point me to similar samples/ examples out there? Would you on this Q or if I post a question for that?
-
JuliusPIV about 7 yearshey @AlexS - By the time I had posted to SU, I had already executed and it worked well. Fortunately, I didn't need to go back to that configuration so I ultimately destroyed the WIM. If you're familiar with PowerShell, and on a recent version, like 5 - check $PSVersionTable.PSVersion - then it's worth looking into if you have an unusual layout. When I build machines from scratch, I don't create a disk layout like this; usually its manufacturers like Dell, Lenovo & HP that do things like this and this was a one-off. (and thank goodness for that!)
- 1 disk
-
WinOutreach2 about 9 yearsI missed that you were already using /Append-Image. You should also check out the official guidance on this: technet.microsoft.com/library/hh825041
-
JuliusPIV over 5 yearsI haven't tried this yet but I'll explore this further. On the surface this looks exactly like what I needed, albeit 3 years ago. ;) I really do appreciate this golden nugget!