I did a brief amount of research and it would appear that it has something do with the ScratchFile...whatever that is. Anyway, apparently some people suggest saving the image out to a different location/drive. I've got a spare external HDD laying around and have it plugged in and ready to go, but am not entirely sure about how to specify that I want my image file to save to the HDD and not the USB with PE on on it. Any ideas?
*>>WinPE runs from RAM, so saving to X it isn't going to be of help- if you save a huge amount of data to X:, the ram disk WinPE uses will fill and you'll run out of space. I find when using WinPE the drive letter for the thumb stick is E:. It might not be for you. You'll have to poke around by switching to different drive letters and using the 'DIR' command to determine if what you have switched to is the thumb stick. The thumb stick will have the same file structure as the 'media' folder from wherever you copied WinPE on your ADK computer.
>>When you discover which drive letter the thumb stick is, you'll have to make sure you tell DISM the drive letter. Let's say it's E and the partition with the Windows install is letter C. Here's what the DISM command would look like:
DISM /capture-image /imagefile:E:\install.wim /capturedir:C:\ /name:"Windows partition capture"
Lets assume the same circumstances but say the command was typed differently. This time the drive letter wasn't specified:
DISM /capture-image /imagefile:install.wim /capturedir:C:\ /name:"Windows partition capture"
This command would still work, however the captured image is going to be saved at the current selected directory at the WinPE command line (X:\Windows\System32\ by default). Since it uses the drive letter X, its going to be saved to the machine's RAM and isn't going to help you. You'd have to switch to a folder on the E drive (cd E:\Folder) and then run the command for it to work.
>>Lets say that's not the issue:
If you want to use your external drive (I assume its USB) first make sure that the USB port you have it plugged into is live. Not all USBs are going to work right out of the box with WinPE, especially if the port requires some sort of special driver that you would need to load onto WinPE to function. Plug it into a USB 2.0 to be safe (usually they all work) or try it in a USB 3.0 port and it might just work (I can't say for sure- I don't have that model of computer). You'll have to find the drive letter WinPE is using to designate the drive using the same method described above for finding the USB stick. I would imagine it might be G: D: F: or E:, although I can't say for sure. You'll know you have the right drive if when you use the DIR command, the selected letter has the same file structure as your external drive. (If you type the command 'notepad' at the WinPE command line, you should be able to use notepad from WinPE. Then you can go File> open and have a visual look at the drives WinPE sees, just like if you were running Windows)
Hope this helps
A few additional questions:
1) You've stated that WinPE runs off RAM. Why doesn't it run off the USB since that's where it is booting from? Does it somehow transfer over to the RAM once it has been booted?
2) Once I've capture the image, will it overwrite WinPE on my USB?
I am using the USB drive method for the test since these new computers aren't hooked up to our LAN yet or else I would opt for the shared folder option.
*>>This might answer both your additional questions:
>>WinPE works generally how Windows does altogether- all about the Windows image. Regularly, with a Windows installer you would get from Microsoft, the installer lays down a WIM found on the installer (actually it might be a highly compressed image on a .esd file) to the hard disk. It is essentially what you're doing with DISM here and you can actually do this yourself by applying a .WIM pulled right from an installer. What does this have to do with anything? WinPE works the exact same way. When you choose to boot from your WinPE media, it creates a ramdisk- a nifty little process where a portion of the machine's RAM is used like a hard disk. WinPE's .WIM image is then applied to the ramdisk and then the machine boots from that.
>>The only time the computer is reading from the USB while starting WinPE is then- it doesn't run off of the USB. It likely works this way to make sure WinPE runs smoothly and doesn't break down when needing to access a system file say if the USB were to be removed. Think of it this way: you wouldn't want your hard drive to become disconnected when Windows is running, right? It could also be because WinPE is generally intended for use in an enterprise environment where a server is used. The machine to be imaged is PXE booted and after a little negotiating with server(s) a boot file and WinPE is downloaded. It would be ideal in this situation to have WinPE set down on a ramdisk and have it run from the machine rather than having unnecessary network traffic and machines fighting for access to files for the duration the machines are in WinPE.
>>As a matter of fact no Windows installer runs from the physical media- an installer obtained from Microsoft has a little modified WinPE on it that has the install application to make it easier for non command line type people to install Windows. The WinPE image is 'boot.wim' and is always found in the 'Sources' folder on the media. The Windows image on a conventional installer is 'install.wim' or a highly compressed install.esd (when businesses purchase Windows from Microsoft they usually get the .wim; consumers get .esd).
That's probably more than you ever wanted to know about Windows, so back on track:
>>Just by capturing your Windows image to the USB should not overwrite WinPE on the USB (unless you title it 'boot.wim' and save it in the sources folder). When WinPE is running, the flash drive is just a flash drive as if it were connected to any other Windows device and should behave as such.
Ok. So it appears I've successfully captured the image to my USB drive and am ready to deploy it to one of my new computers. If I am understanding the process correctly, I will need to do the following:
**Boot to WinPE on computer that is ready to have image applied
**Run Diskpart command
-run list disk to determine disk number of hard drive (in my case it is also 0)
-select disk 0
-clean disk 0 to remove any and all partition or volume formatting from the disk
>>Question: On the technet page describing how to apply an image, it mentions that you must format the volume before applying an image if it has an existing Windows install. Does cleaning the disk and using the format commands for partitioning accomplish this? I would assume it does, but just want to make sure.
-create three "primary" partitions, the first being the SYSTEM partition, the second being the true primary partition where Windows will be eventually installed and the third being a primary partition of around 15GB.
>>Question: Do I need to specify a recovery partition? And if so, isn't the designated drive letter of choice typically R:, which would require me to choose a different letter for my temp partition? Or is this the recovery partition not valid for MBR systems?
**Exit Diskpart and begin using DISM
-Copy my image to the temporary partition.
>>Question: I don't fully understand the purpose of the temporary partition. Does it have an added benefit for applying the image off my USB (since I am not using the shared file method for this test) that I'm missing? How does this prevent things from breaking? Or will that only be relevant for the shared folder method?
-Apply image from temp partition to the designated OS partition
-Do some IMPORTANT bcdboot stuff
>>Question: At this point, should I go ahead and use Diskpart to delete the temp partition and extend the primary OS partition? Or do I first try booting things up to see that everything works properly first?
Let me know if I am understanding the process correctly. Writing it out just now kind of helped me visualize/conceptualize the process. I haven't used the command line much ever, so this is all unfamiliar to me. Think I've found something else I need to spend some time learning how to use For some reason, my "to learn" list never seems to shrink. I just keeps getting infinitely longer.
Last edited by ahelton; 19 Jul 2016 at 16:59.
1>>Diskpart's 'format' 'create par' etc... commands are the manual way to create and format hard disk partitions. Cleaning the disk will totally wipe all and everything on it so therefore give you a blank slate to work with. You can then create partitions and format them for use so yes it will work.
2>>The Recovery partition is entirely optional and I think it is just there for OEMs to drop files and stuff necessary for repairing the PC should it stop working. Frankly there is no use for it with what your doing- it'll just be a partition labeled recovery that has nothing on it. You could probably get away with having only one partition on the disk, although I would recommend making a system partition.
3>>The temp partition's sole purpose is to allow you to disconnect the USB and start another computer when you notice DISM applying the image (say when you were to automate the process with a script) since the image being applied is on the temp partition and not the USB. Since WinPE runs from RAM and the image to be applied is on the hard disk, everything should function even if the USB stick is unplugged (considering there are no to be used scripts on the USB stick). Right now the current approach of having only one USB stick to go around would mean you'd have to image one machine at a time.
4>>For good practice, at the very end you should delete the temp partition and extend the OS partition. If you want to make sure everything works then yeah boot everything up and test it without deleting the par. (if you want to). There's noting too exciting about it since it only holds the Windows image (.wim). I would think if everything does work you'd rather just leave it as is and consider it a success than having to go and extend os partition and delete the temp par (even if you're just testing).
>>It is great that you're to learn list keeps growing- it is a great thing to keep learning new stuff and expand your knowledge.