I am trying to defrag the hard drive partition that Windows is running on so I can shrink the partition and create a second one. I have cleared off almost 400GB (which will allow space for an ideal 350GB to be moved to a separate partition), and am currently in the mode of fragmenting the drive to allow for the shrink. I am using Auslogics Disk Defrag which is being very helpful, but it is saying that there is an unmovable file at the end of the partition called swapfile.sys.

I have turned off the pagefile.sys for that partition, and have it dedicated on another partition, but I am unsure what to do next.

I was thinking of having some pre-os launched defrag that could sort out the files before windows loads them up and makes them unmovable, but I can't find any software like that. Any help would be great.


I have just been thinking, I am doing all this because I am dual booting Windows and Linux and creating a common storage place between them where I can store my data (documents, pictures, source code, mysql database files, web root data, etc), so, how can I defrag the Windows disc from the Linux side? Because then none of the files there will be open, so none are unmovable.


Scratch the last edit, it seems there are problems when defragging a windows partition from linux, but now i'm thinking, go into the windows recovery console and do a defrag there. Can anyone tell me how to do that?

  • As far as I know, there is no way to disable swapfile.sys or move it to another partition. The easiest solution is probably not to defrag your partition before resizing it.
    – Dennis
    Jan 22, 2013 at 21:20

1 Answer 1


The thing to do is Move user date outside of the OS. 1) One way to do this is to move your profile folder to another volume or partition. The way to achieve this is to modify the path in HKLM/Software/Microsoft/CurrentVersion/ProfileList

2) During setup of windows create a response file that moves the entire Users folder to another partition. see http://answers.microsoft.com/en-us/windows/forum/windows_7-files/win7-how-do-i-move-user-folder-to-a-different/565f16a5-e5ed-43c9-8422-4f56aebb296e I've tested this a number of times. Moving the C:/ProgramData folder really is something that Windows 8 didn't like. But moving C:/Users seems pretty ok.

3) A third way that is a bit more compatible with how Microsoft sees the world is to move the My Documents, My Videos, My Pictures etc. folder to another location by right clicking each of these folder and set the location.

The problem with either 1) or 2) is that it is not supported by many Microsoft tools. Backup, Upgrade, Reset (windows 8) do not support having the users profiles in another location that the main drive (C:/) The reason conjectured by me is that volumes might get reordered during boot rendering the Profiles and the hence prevent secure logon.

You must log in to answer this question.

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