Sysinternals Homepage
Forum Home Forum Home > Sysinternals Utilities > Miscellaneous Utilities
  New Posts New Posts RSS Feed - Defragmenting $MFT with Contig
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Defragmenting $MFT with Contig

 Post Reply Post Reply
Author
Message
StuartMW View Drop Down
Newbie
Newbie


Joined: 01 October 2008
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote StuartMW Quote  Post ReplyReply Direct Link To This Post Topic: Defragmenting $MFT with Contig
    Posted: 01 February 2011 at 9:55pm
I tried defragmenting $MFT on my Vista SP2 machine and got the following

C:\>contig -v $MFT

Contig v1.6 - Makes files contiguous
Copyright (C) 1998-2010 Mark Russinovich
Sysinternals - www.sysinternals.com

------------------------
Processing C:\$Mft:
Scanning file...
C:\$Mft is already in 1 fragment.
------------------------
Processing C:\$Mft::$BITMAP:
Scanning file...
Scanning disk...
File is 7 physical clusters in length.
File is in 2 fragments.

Found a free disk block at 10223693 of length 8 for entire file.
Moving 7 clusters at file offset cluster 0 to disk cluster 10223693
Move cluster status: STATUS_INVALID_PARAMETER

------------------------
Summary:
     Number of files processed   : 1
     Number of files defragmented: 0
     All files were either already defragmented or unable to be defragmented.
Obviously the defragmentation failed but why? STATUS_INVALID_PARAMETER implies an error in calling a defrag API function (bug in Contig). Can someone shed some light?

Back to Top
DennisVG View Drop Down
Newbie
Newbie


Joined: 21 August 2008
Location: Belgium
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote DennisVG Quote  Post ReplyReply Direct Link To This Post Posted: 08 February 2011 at 12:45pm

Hello Stuart,

The minimum number of fragments for the Mft is 2,
this is because the first file entries, the first 16 I believe,
the ones for metadata files, are at a fixed location.
So the beginning of the Mft is at a fixed location,
the rest is treated as a regular file and can be in more than 1 fragment.
When you (contig in this case) try to move that first part of the Mft, you get an error.

Additional logic to overcome this special situation is needed in contig.

Dennis

Back to Top
StuartMW View Drop Down
Newbie
Newbie


Joined: 01 October 2008
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote StuartMW Quote  Post ReplyReply Direct Link To This Post Posted: 08 February 2011 at 3:18pm
Originally posted by DennisVG DennisVG wrote:


Additional logic to overcome this special situation is needed in contig.

Thanks for the explanation Dennis. So it is a (minor) bug in Contig v1.6 but its a reporting issue not a functional one.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down