none
imagex mount and unmount images on different computers RRS feed

  • Question

  • Hello,

    I've created a WinPE bootable USB with an mounted image on it located in \mount.  During the upgrade process, I want to import some files into the folders in the \mount directory to preserve some settings obtained from my script.  Once I have those files in the /mount folder I want to unmount the folder and commit the changes to the image and then apply that image to that computer.

    The mount process takes about 5 minutes on the USB hard drive so I was hoping to already have the image mounted when I boot so that I only have to unmount it and then apply it.  However, I receive an error when I try to unmount it

    "Did not find an image mounted to \mount"

    Where is the mount information stored?  It doesn't look like you can easily mount an image to a usb on Computer A and then Unmount /Commit to the same usb on Computer B

    Monday, November 4, 2019 6:17 PM

Answers

  • I figured it was something like this, but I have another idea. Leaving the OS image alone, just handle the files separately. You can copy the files to a temp dir, and capture the temp dir as its own WIM file. Then you can deploy the OS wim and the data wim separately.

    If the file sizes are not very large, you can even put the temp dir on the ramdisk and capture from there. You'll have some fiddling to do to make sure the paths line up, but it shouldn't be too difficult.

    Alternatively, you could copy all that stuff up to a network drive (or a dir on the USB HDD) and just do an xcopy (or whatever) onto the new HDD after image deployment.

    Here is an example of such a scenario I use in production:

    diskpart /s z:\diskpart_12efi.txt
    DISM /APPLY-IMAGE /IMAGEFILE:z:\company\image.wim /INDEX:1 /APPLYDIR:W:\
    MD w:\folder1
    MD w:\folder2
    xcopy z:\company\folder1 w:\folder1 /e
    xcopy z:\company\folder2 w:\folder2 /e
    bcdboot w:\windows /s s: /f uefi

    Where Z is network drive.

    • Edited by Tripredacus Tuesday, November 5, 2019 9:58 PM code sample
    • Marked as answer by GreenJa Tuesday, November 12, 2019 4:40 PM
    Tuesday, November 5, 2019 9:54 PM

All replies

  • If I am reading this right, this process will not work:

    1. Boot to WinPE. Mount image. Shut down WinPE.

    2. Boot to WinPE. Unmount image.

    The mounting is instance based, as is the WinPE. WinPE is not an OS, so you cannot do this... but even if it wasn't you wouldn't want this to happen because you may have an invalid mountpoint (such as if you were to reboot or lose power to a technician computer as defines in ADK documentation)...Everything is stored in the ramdisk, once the WinPE is rebooted or the computer is powered off, the ramdisk ceases to exist.

    You would need to unmount /commit while in the first booted instance of WinPE.

    What are you trying to accomplish, specifically?


    • Edited by Tripredacus Monday, November 4, 2019 8:35 PM
    Monday, November 4, 2019 8:34 PM
  • Thanks for the quick reply.  I'll try to explain it a little better.   

    I have written a powershell script that gets launched when WinPE boots from my USB key.  This script backs up some SQL databases and various config files.  The next thing it does is push down the new image.  From there once that new OS boots I will have to restore those databases and config files.

    What I'm hoping to do is to have the image already mounted in a folder on the USB key (before WinPE boots).  From there, I could just have my script backup the SQL databases and config files from the hard drive directly into the mount folder.  Then I could unmount the image and commit the changes and push the image down saving me having to restore the files afterwards.

    I know that I can mount the image, manipulate and unmount /commit all within WinPE but the mount takes a little more than 5 minutes so I was hoping to just have it on the USB key already.

    Monday, November 4, 2019 9:09 PM
  • ImgaeX can’t meet your demand, current situation is normal and expected, in my opinion, your thread is correct, what we can do is just wait for minutes…

    Maybe some third-party image processing software can make it, but I am afraid that it is very difficult to unmount images on different computers with command.

    Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, November 5, 2019 6:39 AM
    Moderator
  • I figured it was something like this, but I have another idea. Leaving the OS image alone, just handle the files separately. You can copy the files to a temp dir, and capture the temp dir as its own WIM file. Then you can deploy the OS wim and the data wim separately.

    If the file sizes are not very large, you can even put the temp dir on the ramdisk and capture from there. You'll have some fiddling to do to make sure the paths line up, but it shouldn't be too difficult.

    Alternatively, you could copy all that stuff up to a network drive (or a dir on the USB HDD) and just do an xcopy (or whatever) onto the new HDD after image deployment.

    Here is an example of such a scenario I use in production:

    diskpart /s z:\diskpart_12efi.txt
    DISM /APPLY-IMAGE /IMAGEFILE:z:\company\image.wim /INDEX:1 /APPLYDIR:W:\
    MD w:\folder1
    MD w:\folder2
    xcopy z:\company\folder1 w:\folder1 /e
    xcopy z:\company\folder2 w:\folder2 /e
    bcdboot w:\windows /s s: /f uefi

    Where Z is network drive.

    • Edited by Tripredacus Tuesday, November 5, 2019 9:58 PM code sample
    • Marked as answer by GreenJa Tuesday, November 12, 2019 4:40 PM
    Tuesday, November 5, 2019 9:54 PM
  • Thanks for this.  There is a lot of good material in that post that I'll be able to use.

    Jason

    Tuesday, November 12, 2019 4:40 PM