To install Ubuntu alongside Windows 7, I have to shrink Windows 7 partition C:. But due to some unmovable files, I cannot shrink as much as I plan by using Windows own shrinking tool. I guess many of you who have both OSes on the same hard drive must have similar experience. How to solve this problem?

Any reference that can help is also appreciated!

Thanks and regards!


I have identified what unmovable file currently stop further shrinking:


If I understand correctly, the file belongs to Windows Search. Can I set up somewhere in Windows system settings to temperately eliminate the file and similar ones (because there are many similar files under the same directory which I guess will also stand in the way of shrinking and unmovable by defrag)?

closed as off-topic by chaskes, Eric Carvalho, Richard, waltinator, Rinzwind May 10 '14 at 7:48

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – chaskes, Eric Carvalho, Richard, waltinator, Rinzwind
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Turn off Windows Search and delete the file (and the ADS attached to it). Or use Safe Mode. The file will be created again. – user8290 Feb 19 '11 at 16:10
  • I am in the same situation. How did you find out which file is locked? – WeGoToMars Oct 23 '15 at 20:01
  • Use this disk-partition.com/articles/… – masterxilo Dec 19 '18 at 20:08

Just had the same problem, but the instructions in Working around Windows' "Shrink Volume" inadequacies worked well for me. (The title mentions Vista, but it worked well for Windows 7 too.)

It's a bit long to repeat here, but the main points are

  • Close every program you can (any file currently in use is treated as unmovable, including browser cache files)
  • Run the Windows Disk Cleanup Wizard
  • Disable pagefile, kernel memory dump, system restore and hibernation (the primary system level unmovable files)
  • Run a defragmenter that can move files to the start of the disk

On a 60 GB SSD with about 35 GB free space, "Shrink Volume" in Windows 7 initially freed a paltry 100 MB, but following the steps in the article it was able to free the whole 35 GB.

See also the ubuntuguide.org documentation on multiple OS installation.


The old fashioned way before Windows finally came up with their own resize tool: gparted. Best done from the live cd.

  • 1
    Defrag before shrinking – Takkat Feb 8 '11 at 7:08
  • 1
    gparted do not move files when shrinking. @Takkat: windows defrag tools respect unmovable files, so the OP problem remains. – enzotib Feb 8 '11 at 8:00
  • @enzotib: Thanks for telling others! You know what I was asking about! – Tim Feb 8 '11 at 12:11
  • 3
    @enzotib: not true. From the ntfsresize man page ( which gparted uses ): Defragmentation is NOT required prior to resizing because the program can relocate any data if needed, without risking data integrity. – psusi Feb 8 '11 at 18:56
  • 2
    you are right, according to man page, but this differ from my experience. – enzotib Feb 9 '11 at 12:00

There's a great defrag utility for Windows that can move all the files to the front of the disk, as well the little bit of space used between files (interstice problem): dirms (dirms-cl).

Running the defrag in safe mode may help with the unmovable file. Of course, what will certainly help is to make sure the filesystem is not in use before defragmenting (by booting Windows from CD/DVD or by using another computer for the defrag operation).

Does not work with Windows 7.

  • 1
    Unfortunately, the link to dirms is broken (there's a new website about another topic). I would recommand MyDefrag (formerly JKDefrag) that works well under all versions of Windows. – Michaël Polla Sep 19 '17 at 14:52

if you plan to dual boot with partitions on the same physical drive I recommend you use the Windows partition method as detailed here but you should always defrag the hard drive first.

While gparted is an excellent partition tool it does not take into consideration the fragmented data on the drive.

Trust me - from past experience once you make the mistake of not defragging the Windows partition using Windows tools you will screw up the windows install and will end up having to re-install it as well.

  • THanks! But I do know defrag and I defrag everytime before attempt to shrink. I was asking about unmovable Windows system files that now stop me from further shrinking. Any idea? – Tim Feb 8 '11 at 12:10
  • You don't say what the immovable files are and probably the question to ask how to move them should not be asked here. Try "pagedefrag" can do lots, also delete the page file and then recreate it this is one way to move it. – robin0800 Feb 8 '11 at 12:52
  • @robin0800: I have updated my post with the file that stands in the way. Thanks! – Tim Feb 8 '11 at 13:06
  • 1
    The files are probably in use, so you can't move them. I think you may need to do a defrag before windows is up and running. I don't think the bundled version that comes with windows probably does not support that (in XP and older it was a defeatured commercial product), but there are some commercial ones that do. Diskkeeper and PerfectDisk come to mind, but there are others. – jwernerny Feb 8 '11 at 15:37
  • 1
    This is FUD. Fragmentation does not matter at all to gparted. It simply adjusts the length of the filesystem after relocating any files that are beyond the new end point ( if you are shrinking it ). – psusi Feb 8 '11 at 19:01

Kill the explorer.exe using task manger and reload it. Then try to shrink the partition



Well, I've just spent a day trying to get various defraggers to move the (extremely stubborn) unmovable metadata which Win7 puts in the middle of the drive for safety. None worked (Raxco, Ultradefrag, Win7 defragger). Finally I used MiniTools Partition Wizard (free for home use) which 'knows' about Win7 and does not mess up the Win installation. From what I have read, GParted (which I know and love) seriously risks screwing things royally, and I could not take the risk. Partition Wizard seems a very slick program, BTW. I used the CD version - much safer.

Not the answer you're looking for? Browse other questions tagged or ask your own question.