I was trying to shrink a partition (Windows 10). For traditional hard drives, I can use the Optimize Tool to defragment the hard drive to free up disk sectors towards the end of the HD and shrink the volume as much as possible.

However, I read that the Optimize tool in Windows does not defrag SSD drives. Therefore, it's not of much use as it is for mechanic hard drives (for shrinking).

Is there a Windows tool that can "conceptually" move the sectors to the beginning of a SSD to help shrinking?

Ideally, I am looking for something from Windows or Microsoft.

Note: I looked around in Superuser, and related posts e.g. How to shrink Windows 7 boot partition with unmovable files are all about moving unmovable files for mechanical HD. They do not seem to address the issue of SSDs.

  • 1
    Outside of removing the files outside of Windows? You can defrag a SSD, you might have to find a tool that will allow, but that's the best way. A single defrag won't reduce the lifespan of the SSD.
    – Ramhound
    May 12, 2016 at 2:28

4 Answers 4


Shrinking drives under Windows can be a pain in the rectum. You need to remove any ummovable files, then defragment it, then you can shrink it.

To remove files -

  • Disable system Restore (Right click on Computer -> Properties -> System Protection -> System Restore)
  • Disable Virtual Memory/Paging File (Right click on Computer -> Properties -> Advanced System Settings -> Performance (Settings) => Advanced Tab -> Virtual Memory (Change) -> remove paging file

Defrag the drive (Auslogics Disk Defrag is free and can do this)

  • 5
    Don't forget disabling Hibernation, powercfg -h off
    – Moab
    May 12, 2016 at 20:53
  • 1
    Also don't forget to perform disk-cleanup (recycle-bin, temporary internet files, installer caches, etc)
    – F.I.V
    Aug 14, 2017 at 13:11
  • 1
    And after all that, it might not work, because Windows 10 might have placed many folders and files at the very end of the partition, which defragging couldn't care less about and will not relocate. This holds true for the builtin disk cleanup utility and other defrag utilities. Using defrag on an SSD may even degrade SSD performance, as SSD placements are purely logical and the drive controller makes some placement optimizations that the OS does not know about. This is from experience with a fresh Windows 10 install.
    – matanox
    Dec 20, 2017 at 17:23
  • I cannot help feeling that it might just be quicker and easier to put GParted (gparted.org) onto a spare USB stick, boot from that and use it to shrink the partition. You don't need to faff around with any of the stuff in this answer or the additional comments.
    – Richard
    Jul 16, 2018 at 10:31
  • 1
    @davidgo gparted will only move the files needed so that it can shrink the disk. However you’re right in that gparted cannot resize the paging file - but this will only be an issue if you’re trying to shrink the partition to be smaller than the currently used space.
    – Richard
    Jul 17, 2018 at 17:57

The command you want is defrag /PrintProgress /FreespaceConsolidate.

Defrag <Volumes> <Operations> [<Options>]

  /U | /PrintProgress   Print the progress of the operation on the screen.
  /V | /Verbose         Print verbose output containing the fragmentation statistics.
  /X | /FreespaceConsolidate
                        Perform free space consolidation, moves free space towards
                        the end of the volume (even on thin provisioned volumes). On
                        tiered volumes consolidation is performed only on the Capacity
  • this combined with the accepted answer, as well as a tool to check which files were near the end of the drive so I could delete em (I used Defraggler since I didn't know of a better tool) solved my issue, thanks! Aug 27, 2022 at 2:45
  • 1
    Tom's answer fixed an issue where I couldn't Clone an SSD using Partition wizard due to a "the volume is too fragmented" error; As Trim/optimize does not consolidate fragmented files, I needed a way to force files on an SSD to defragment, which this command does. Definitely not an everyday occurrence, or even encouraged to run on an SSD outside of very specific edge cases, but this is the closest command you can get to "Force Defragment" an SSD if you ever need to for some insane reason.
    – Dave
    Dec 26, 2022 at 22:09

When I try to shrink the partition(Windows 10 and have only one partition--C drive which I need to shrink for install Linux) with Diskpart(console command tool), it didn't work and Disk management tool didn't work either. (guide from Shrink a basic volume | Microsoft Docs)

I think reason is SSD won't work with defragment optimise tool--I did use the tool before the shrink.

So I thought about doing SSD defragmentation but what I remember is that SSD won't need defragmentation like hard-disk drive so don't have much software to do this. And I only need shrink the partition.

So I decided to use free partition software.

First, I tried with MiniTool Partition Wizard Free but I can only find split function, not the shrink.

Next, I tried with AOMEI partition assistant. But in my case, program can't recognize my primary partition.

So I thought about to use the GParted but too big file(more than 300MB) to download so I didn't try.

And I tried with EaseUS Partition Master Free Edition and it worked--after shrink, I did reboot the machine and then it moved the fragments for shrink.

You should try number of partition software which will work for your system. You might try other partition software like Paragon Partition Manager Free, Macrorit Partition Expert, Active@ Partition Manager.


You can try AOMEI partition assistant.

It should handle all of the file moving stuff for you. (It doesn't defrag, just moves the fragments).

I have used it once and it worked for me.

  • That was a pretty good first attempt at a software recommendation. I would recommend reading How do I recommend software in my answers? for a fuller understand of the guidelines.
    – robinCTS
    Jul 16, 2018 at 10:24
  • It's what I've been using in the past years, so good recommendation.
    – iBug
    Jul 16, 2018 at 12:42
  • does that move stuff automatically after you have resized the partition or do you have to move the stuff first with some special wizard thing? (i should not have any restore data in use tho, and i'm actually giving more space to C: from the next partition in the line... i probably do have swap and hibernation files tho)
    – jimmy5
    Jul 16, 2020 at 4:25
  • This doesn't work. AOMEI will give you an error that you need to defragment the volume first.
    – Wolph
    Jan 12, 2021 at 13:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .