Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 18, 2013, 12:51:57 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: need help with my script and ways how MyDefrag works  (Read 1363 times)
hINDUs
JkDefrag Junior
**
Posts: 8


View Profile
« on: July 05, 2010, 07:44:53 pm »

hi, i have made script for my partition, but i have a few issues
the script:
Code:
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.
« Last Edit: July 05, 2010, 07:47:22 pm by hINDUs » Logged
poutnik
JkDefrag Hero
*****
Posts: 1105


View Profile
« Reply #1 on: July 05, 2010, 08:47:57 pm »

Hi,

I have few questions:

Why do you insist in defragmentation of such huge files, especially if comparable with remaining free space ?
Have you evaluated gain what you get for such effort ?

And why do you run defragment + fastfill after sorting ? If 4 GB files gets wrapped around a temporary locked files, it will be moved again.

Sorting, Defragment() without fast/chunksize and shuffling by Fastfill comes to you with a big price -time and disk moaning.

You have too many fileactions in the zones, like

     SortBySize(Ascending)
     Defragment()
     Defragment(ChunkSize(100))
     FastFill()
     FastFill(WithShuffling)
     ForcedFill()

It is like shooting, poisoning, burning, throat cutting, stabbing and window falling of the same person to be sure it is dead.
I am afraid you will get extremely ( this forum likes this word, I do not, but this time I make exception ) low gain for extremely high effort.

Before applying actions, think twice :
What they really do ?
What is their intention ?
How they interfere ?
What is their gain ?
what is effort needed ?
Are they balanced ?
What is stability of result ?
Is all that torture ever worthy to do that ?
« Last Edit: July 05, 2010, 08:50:28 pm by poutnik » Logged

It can be fast, good or easy. You can pick just 2 of them....
Treating Spacehog zone by the same effort as Boot zone is like cleaning a garden by the same effort as a living room.
Darlis
JkDefrag Hero
*****
Posts: 1707


View Profile WWW
« Reply #2 on: July 05, 2010, 08:58:59 pm »

- how to force MyDefrag to use the "NTFS reserved area" (dark blue)
Just move it away. You can easily do so by changing the PlaceNtfsSystemFiles statement to PlaceNtfsSystemFiles(Ascending, 1MB). Then remount the volume (by running chkdsk or restarting) and the reserved area is (almost) gone.
You should also consider placing the MFT and directories further into the volume (about 3GB) for a better access time (see the MyDefrag standard scripts).

I agree with poutnik. You won't feel a performance difference with a not fragmented file and a file that is in 2-5 fragments which are close together (wrap around fragmentation from the SortBy actions). Trying to defragment everything on an almost full disk means a lot of work for the disk and is very time consuming. Also note that ForcedFill() strongly fragments files again.
Logged

Need help creating a script? Try MyDefrag Script Creator.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!