30

A while ago, I nearly filled my hard drive, much more than the recommended maximum of 85% of capacity. I believe that NTFS started storing files in the space reserved for the Master File Table (MFT) and the MFT had to fragment elsewhere as it grew.
I have cleared off space on the hard drive, but the MFT apparently remains fragmented, and there's a lot of slow disk access for even very simple operations like opening a folder or small file. This is killing performance. I remember that Windows standard disk defragmenter doesn't defragment the MFT because the MFT is in use when the operating system is running. I'm running Vista Ultimate and its defragment utility has very little in the way of reporting, less than older versions.

I suspect that a solution might involve booting up from an optical disc with a basic OS ("Live CD") and running a defragment utility from that. Can anybody tell me what program to use, or how to defragment my MFT?

Thanks!

WBT
  • 1,922

5 Answers5

41

You can use the Sysinternals tool Contig:

contig.exe c:\$mft
Synetech
  • 69,547
Dmitri Sologoub
  • 411
  • 4
  • 2
17

Auslogics Disk Defrag Pro will accomplish this for you. Whilst not a free program, you can download a free trial, and if you do decide to purchase the license is available for use on up to three PCs.

Ultradefrag is a free and powerful FOSS defragmentation tool for the Windows Platform. It can defragment any system files including registry hives and paging file. It includes MFT optimization, which processes the MFT only.

Simon
  • 4,481
9

Best tool by far was the old JKdefrag, now Mydefrag. Will defrag the MFT. Also, it's free.

The original site is down but one can source to get the latest version is here: https://www.techspot.com/downloads/3720-jkdefrag-mydefrag.html

edit

Windows Defrag API, used by MyDefrag, supports defragging the MFT.

Following are the system file, stream, and stream types supported by FSCTL_MOVE_FILE in "filename:streamname:$typename" format.

$MFT::$DATA $MFT::$ATTRIBUTE_LIST $MFT::$BITMAP

And MyDefrag's script documentation:

Inode   Filename    Description
0   $MFT    Master File Table - An index of every file.
1   $MFTMirr    A backup copy of the first 4 records of the MFT.
2   $LogFile    Transactional logging file.
3   $Volume Serial number, creation time, dirty flag.
4   $AttrDef    Attribute definitions.
6   $Bitmap Contains volume's cluster map (in-use vs. free).
7   $Boot   Boot record of the volume.
8   $BadClus    Lists bad clusters on the volume.
9   $Quota  [Windows NT only] Quota information.
9   $Secure Security descriptors used by the volume.
10  $UpCase Table of uppercase characters used for collating.
11  $Extend A directory for: $ObjId, $Quota, $Reparse, $UsnJrnl.
$Extend\$ObjId  Unique Ids given to every file.
$Extend\$Quota  Quota information.
$Extend\$Reparse    Reparse point information.
$Extend\$UsnJrnl    USN Journal.
$Extend\$RmMetadata Transactional data.

While it won't run on a Live CD, it will run on Bart PE or the Ultimate Windows BootCD.

But neither is necessary to defrag the MFT.

surfasb
  • 22,896
1

I know this is an old thread but old systems is what I do. I am releasing an open source project at https://github.com/DHorse2/TaylorDo and all are welcome to use this MyDefrag library or contribute to it.

The MFT movement and defragging are done on the system running normally. They are however a few $xxx and system files that if you move them the feature will fail. Restore points being the best example.

The point of the TaylorDo product is that it provides peak performance AFTER the system boot whereas other product tends to only optimize the boot.

Edit 20240315: this project needs minor cleaning up before final release (the scheduler enable/disable); I'm keeping it open.

DHorse
  • 111
-1

there is an option on ultimatedefrag that provides a boot time defrag , however it didn't work for me but i hope it works for you

ultimatedefrag > tools >settings... > boot time

select the drive that you want , it takes a while analyze the drive . when its done analyzing you can adjust the mft file location but i recommend to leave it how it is (if you changed it there is a button to rest it to default) . then toggle the Run during next boot option and just restart the pc

for me it stack at 24% every time and then boots up the windows without defraging the file but hope it works for you . share your expertise too