hi, i have made script for my partition, but i have a few issues
the script:
Title('Defrag P TF2 OK')
Description("Defragment P: for TF2 optimize")
AppendLogfile("MyDefrag_P.log","LogHeader")
VolumeSelect
Name("p:")
VolumeActions
AppendLogfile("MyDefrag_P.log","LogBefore")
// Move files from the NTFS reserved area to normal disk space.
ReclaimNtfsReservedAreas()
// ZONE (1) All the NTFS system files.
FileSelect
SelectNtfsSystemFiles(yes)
FileActions
PlaceNtfsSystemFiles(Ascending, 0)
AddGap(RoundUp(ZoneEnd, VolumeSize * 0.0001))
FileEnd
// ZONE (2) Directories "no files".
FileSelect
Directory(yes)
FileActions
SortByName(Ascending)
AddGap(RoundUp(ZoneEnd, VolumeSize * 0.0001))
FileEnd
// ZONE (3 - gcf, 4 - old, 5 - the rest)
// all .gcf (big one's too!)
FileSelect
DirectoryPath("p:\Steam") && FileName("*.gcf")
FileActions
SortByName(Ascending)
Defragment(Fast)
FastFill()
FileEnd
// old, unchanged files
FileSelect
DirectoryPath("p:\Steam") && CreationDate(,2010/01/01 00:00:00)
FileActions
SortByName(Ascending)
Defragment(Fast)
FastFill()
FileEnd
// the rest
FileSelect
DirectoryPath("p:\Steam")
FileActions
Defragment(Fast)
FastFill()
AddGap(RoundUp(ZoneEnd, VolumeSize * 0.01))
FileEnd
// ZONE (6)
FileSelect
DirectoryPath("p:\Burnout(TM) Paradise The Ultimate Box")
FileActions
SortByName(Ascending)
Defragment(Fast)
FastFill()
FileEnd
// ZONE (7)
FileSelect
DirectoryPath("p:\p\big files")
FileActions
SortByName(Ascending)
Defragment()
FastFill()
FileEnd
// ZONE (8)
FileSelect
DirectoryPath("p:\p\another big files")
FileActions
SortByName(Ascending)
Defragment()
FastFill()
FileEnd
// GAP Everything that follows will be placed at the "end" of the disk!
// MakeGap(RoundUp(ZoneEnd + VolumeSize * 0.1, VolumeSize * 0.01))
MakeGap(MaxNextZoneBegin - VolumeFree * 0.01)
// ZONE (9)
FileSelect
( FileName("*.*") and not (FileName("*.gcf") or FileName("*.rar") or FileName("*.zip") or FileName("*.7z") or FileName("*.mp3")) )
FileActions
// IgnoreWrapAroundFragmentation(no)
//MaxRunTime(5 minutes)
SortBySize(Ascending)
//Defragment(Fast)
Defragment()
//Defragment(ChunkSize(100))
//FastFill()
//FastFill(WithShuffling)
//ForcedFill()
//MoveDownFill()
//MoveToEndOfDisk()
FileEnd
// ZONE (10)
FileSelect
( FileName("*.*") and not (FileName("*.gcf")) )
FileActions
//MaxRunTime(5 minutes)
SortBySize(Ascending)
//Defragment(Fast)
Defragment()
Defragment(ChunkSize(100))
FastFill()
FastFill(WithShuffling)
ForcedFill()
//MoveDownFill()
//MoveToEndOfDisk()
FileEnd
// ZONE (11)
FileSelect
all
FileActions
SortBySize(Ascending)
Defragment()
//Defragment(ChunkSize(100))
//FastFill()
FastFill(WithShuffling)
//ForcedFill()
//MoveDownFill()
//MoveToEndOfDisk()
FileEnd
AppendLogfile("MyDefrag_P.log","LogAfter")
VolumeEnd
AppendLogfile("MyDefrag_P.log","LogFooter")
WhenFinished(Exit)
this partition is 165gb, non-system, mainly games, media files and work files. it is 95% full all the time, only got a few GB of free space
i wanted to run Steam and in particular "Team Fortress 2" Steam game as fastest as possible, defragment all the files and have them in their zones
the script is slow as it moves all the data on partition on every time (i run it every few weeks)
this script is far from ideal, i change it a lot, but i think it works for me ... but... :
firstly: when defragmenting big files (1-4 gb, they are in there's zones, but fragmented, or not its "right" place) MyDefrag moves them to biggest gap available, then smaller and smaller, ending with moving 4kb chunks (the cluster size) - what is painfully and horribly slow (
the speed drops from 10-50 MB/s to 4-20KB/s) -
how to stop this moving at, let's say 1mb chunk size? , or to speed it up?
secondly: when its processing some of the last zones (9-11), it's very often "giving up" and leaves files fragmented (red) - when closing MyDefrag and running it again, it defragments this files successfully but again, a few minutes later it again "gives up" and leave the file fragmented... (thats why i have there
MaxRunTime(5 minutes) statement - i run MyDefrag in a loop to fully defragment this zones, also that's why i got such much crap commented out in these zones - i have to try different things to get this zones to fully defragment. no files on this partition are in open state, are not used, AV software is off) -
how to force MyDefrag to not "give up" on those files?- how to force MyDefrag to use the "NTFS reserved area" (dark blue)
any discussion about this script, how to improve it, and the ways how MyDefrag works is greatly welcome and appreciated.