7

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

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?

JuliusPIV
  • 158
  • 1
  • 1
  • 11
  • 3
    Your 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. – Ramhound Apr 07 '15 at 16:24
  • Is 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. – Daniel B Apr 07 '15 at 16:42
  • @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! – JuliusPIV Apr 07 '15 at 19:47
  • What 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. – Daniel B Apr 08 '15 at 06:32
  • @Phylum - How did this work out for you? I might try to do the same for a machine. – Alex S Jun 01 '17 at 15:06
  • @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? – Alex S Jun 01 '17 at 15:08
  • 1
    @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. – Ramhound Jun 01 '17 at 17:25
  • @Ramhound - Nice. Care to share some sample scripts :) ? – Alex S Jun 01 '17 at 18:13
  • @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. – Ramhound Jun 01 '17 at 18:17
  • @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? – Alex S Jun 01 '17 at 18:18
  • 1
    hey @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!) – JuliusPIV Jun 05 '17 at 21:01

2 Answers2

5

You can now do it easily with the new "Windows Full Flash Update", integrated in DISM starting from Windows 10 v1709

TheUnexpected
  • 432
  • 1
  • 6
  • 15
  • 1
    I 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! – JuliusPIV Jan 01 '19 at 14:57
4

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.

WinOutreach2
  • 481
  • 3
  • 4
  • I missed that you were already using /Append-Image. You should also check out the official guidance on this: https://technet.microsoft.com/library/hh825041 – WinOutreach2 Apr 15 '15 at 14:07