Clean Mounted image to keep size below 4.7 GB ?

Discussion in 'Windows 8' started by gnugeek, Dec 21, 2012.

  1. gnugeek

    gnugeek MDL Member

    Nov 23, 2009
    171
    41
    10
    How do I clean mounted image after integrating updates and drivers? When I give the final command of commit, the resulting image is 4.8 GB.

    I found this command
    This command also removes un-needed installed updates.
    But it is for cleaning the installed OS on C: and not for Mounted image using DISM.

    Any help?

    Thanks in advance
     
  2. pisthai

    pisthai Imperfect Human

    Jul 29, 2009
    6,729
    1,954
    210
    Personally I didn't use DVD's if I could avoid them, just use USB Sticks. But you could easily us DVD9 Media with 8.5GB

    I don't think that all updates are needed! But: some of the updates are needed for some software installed. That means that for on installation may the updates needed are different than from an other installation! That said, you have to be careful what you didn't copy to your image.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. BTOR

    BTOR MDL Addicted

    Nov 18, 2009
    575
    584
    30
    That command is used for online images, for offline use the below command as admin

    DISM.exe /Image:"MOUNTPATH" /Cleanup-Image

    but this won't work if there is any pending update in your wim so check for any pending action with

    Dism /get-MountedWiminfo
     
  4. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    7,401
    23,056
    240
    #4 abbodi1406, Dec 21, 2012
    Last edited by a moderator: Apr 20, 2017
    Code:
    dism.exe /image:"mount path" /cleanup-image /startcomponentcleanup
    but the command will not be executed if there is pending operations

    =

    use the "export" command to reduce the wim size

    dism:
    Code:
    DISM /Export-Image /SourceImageFile:install.wim /SourceIndex:1 /DestinationImageFile:install2.wim /Compress:max
    DEL /S /F /Q install.wim
    REN install2.wim install.wim
    
    imagex:
    Code:
    IMAGEX /COMPRESS maximum /EXPORT install.wim 1 install2.wim
    DEL /S /F /Q install.wim
    REN install2.wim install.wim
    
     
  5. BTOR

    BTOR MDL Addicted

    Nov 18, 2009
    575
    584
    30
    #5 BTOR, Dec 21, 2012
    Last edited by a moderator: Apr 20, 2017
    yes i have mentioned it in my post, think you missed it
     
  6. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    7,401
    23,056
    240
    i didn't see your post until i put mine :biggrin:
     
  7. gnugeek

    gnugeek MDL Member

    Nov 23, 2009
    171
    41
    10
    Still the AIO image after integrating updates is above 5 GB. o_O
     
  8. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    5,682
    13,109
    180
    #8 Mr.X, Apr 30, 2014
    Last edited by a moderator: Apr 20, 2017
    Error: 0x800f0806 The operation could not be completed due to pending operations.

    Why?

    After integrating updates to Windows 8.1 with Update I need to reduce image size but that error shows up, can't figure out why this happens since no mounted images found after "dism /get-MountedWiminfo" is run.

    My code:
    Code:
    Dism /mount-wim /wimfile:W:\win81aio\win81\sources\install.wim /index:1 /mountdir:W:\win81aio\mount
     
    dism.exe /image:W:\win81aio\mount /cleanup-image /startcomponentcleanup
     
    Dism /unmount-wim /mountdir:W:\win81aio\mount /commit
     
    
    
    Dism /mount-wim /wimfile:W:\win81aio\win81\sources\install.wim /index:2 /mountdir:W:\win81aio\mount
    
    
    dism.exe /image:W:\win81aio\mount /cleanup-image /startcomponentcleanup
     
    Dism /unmount-wim /mountdir:W:\win81aio\mount /commit
    
     
  9. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    6,787
    10,365
    210
    You cannot clean-image any version of windows that has pending updates.
    The only exception is the boot.wim files after applying the 2919355 update.

    I really hope they change this in the future. It's really annoying.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    5,682
    13,109
    180
    Thanks but I don't understand the "pending updates" part. Elaborate a bit please murphy.
     
  11. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    6,787
    10,365
    210
    Basically, almost every update will set the pending flag. This is what we know for sure.
    There are a few exceptions. Servicing stack updates, camera codecs, and a few others don't set pending.
    Be that as it may, you should *NOT* try to install those updates and resetbase or even clean-image startcomponentcleanup on those few updates.
    Windows, for some reason will become very error-prone during install if you do those things if you have converted your image to esd recovery compression

    I just about drove myself crazy this month trying to squash an install error associated with this.

    I actually would never recommend using resetbase. using cleanmgr or startcomponentcleanup without resetbase is enough post-install to keep your winsxs size down.
    If anyone is really strapped for space, they should try the wimboot feature.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    5,682
    13,109
    180
    :worthy: Amazing your discoveries about these situations. Well, I guess we have to live with... for the time being :D
    Thank you.