Skip to content

Instantly share code, notes, and snippets.

@Anaminus
Created July 28, 2019 16:31
Show Gist options
  • Select an option

  • Save Anaminus/656d70e2a0e87158fea62063a125c18f to your computer and use it in GitHub Desktop.

Select an option

Save Anaminus/656d70e2a0e87158fea62063a125c18f to your computer and use it in GitHub Desktop.
How to shrink a Windows partition

How to shrink a Windows partition

First a shrink with the Disk Management tool is tried, which will hopefully be all that is needed. If that fails, then ntfsresize is used on linux to move otherwise unmovable files to clear the way. diskpart is then used to extend the file system back to the original size, which resolves corruption issues. Even though it is now back at the original size, the files themselves have not been moved back, so it is now possible to do a shrink the normal way.

  1. Use Disk Management to shrink to desired size.
  2. If partition cannot be shrinked to desired size, continue.
  3. Boot into linux, ensure ntfs-3g package is installed (a live CD with a DE should work).
  4. Run sudo ntfsresize -v -s $DESIRED_SIZE $PARTITION (e.g. /dev/sda1).
  5. Boot back into the disk (let it run chkdsk).
  6. Run diskpart.
  7. list volume to find the volumne number.
  8. select volume $VOLUME
  9. extend filesystem
  10. Use Disk Management to shrink to desired size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment