Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 20, 2013, 03:55:49 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to fill all gaps in a zone of disk with a specific file?  (Read 648 times)
einstein1969
JkDefrag Supporter
***
Posts: 10


View Profile
« on: April 12, 2012, 12:50:37 am »

hi, i have a question for fill all the gaps of the last part of the disk.

The file that fill the gap is create with fsutil file createnew. So the fill i relative fast because nothing is writing in the disk (only $file)

I have most of free space allocated in the first 20% of disk. In this 20% there is data and free space. I want fill all gaps in the remaing 80% (this % is a only a example)

The Volumefree space is up to 10% for example.

i found this:

external script:
"fsutil file createnew filler.$$$ DimensionOFGapsToFill"

where DimensionOFgapsToFill is .... (This must be calculate)

and a mydefrag script:

Code:
...
VolumeSelect
  CommandlineVolumes()
VolumeActions

  FileSelect
     Not ( FileName("filler.$$$") )
  FileActions
  FileEnd

  makegap(VolumeSize*0.2)
 
  FileSelect
    All
  FileActions
    sortbysize(ascending)
  FileEnd
 
VolumeEnd


Is this correct and the fastes mode?

It will fill all gaps in the last 80% of disk?

what is the formula for DimensionOFgapsToFill?
« Last Edit: April 13, 2012, 09:04:42 am by einstein1969 » Logged
Darlis
JkDefrag Hero
*****
Posts: 1707


View Profile WWW
« Reply #1 on: April 21, 2012, 06:48:09 am »

You do not need a filler file for that. In fact, you have to use a different approach. A sorting operation needs to able to move files away so it can place the file that is next in the sorting order. If you create a gap of 20% of the volume size but there is only 10% free space, the MakeGap action will squeeze all files files in the last 90% of the disk.

If you want all files sorted, you have to make some free space at the end of disk first. Use the Consolidate script first. Then this one.
Code:
VolumeSelect
  CommandlineVolumes()
VolumeActions

  MakeGap(MaxNextZoneBegin, DoNotVacate)
 
  FileSelect
    All
  FileActions
    SortBySize(ascending)
  FileEnd
 
VolumeEnd
This will move all files to the very end of the disk and also sorts them.
Logged

Need help creating a script? Try MyDefrag Script Creator.
einstein1969
JkDefrag Supporter
***
Posts: 10


View Profile
« Reply #2 on: December 14, 2012, 10:54:06 am »

Hi Darlis, excuse me for post after long time.

I tried with this script

Code:
# MyDefrag v4.0

Title('MOD')
Description("MOD - Run Consolidate-free-space first")   // See the "Settings.MyD" file.

# MyDefrag v4 palette.
SetColor(Empty,0,0,0)                                   // Black
SetColor(Allocated,45,72,128)                           // Dark-blue
//SetColor(BusyRead,255,255,255)                          // White
//SetColor(BusyWrite,255,255,255)                         // White
SetColor(BusyRead,0,255,0) // Green
SetColor(BusyWrite,255,0,0) // Red
//SetFileColor(All,139,158,198)                           // Blue
SetFileColor(All,60,60,60) // Dark Gray
//SetFileColor(Processed,139,198,139)                     // Green
SetFileColor(Processed,255,0,255) // Fucsia
//SetFileColor(Fragmented,229,229,0)                      // Yellow
SetFileColor(Fragmented,96,96,0) // Dark Olive
SetFileColor(not(Movable),204,92,92)                    // Red
//SetFileColor(Selected,175,198,247)                      // Light-blue
SetFileColor(Selected,96,128,255) // Light-Blue2
//SetFileColor(Selected and Fragmented,255,255,0)         // Light-yellow
SetFileColor(Selected and Fragmented,192,192,0) // Light-olive
SetFileColor(Selected and not(Movable),255,115,115)     // Light-red


FileMoveChunkSize(524288*4) //524288=512KB 4194304=4MB
DiskmapFlip(no)

#Few resource
ProcessPriority(Low)
//Slowdown(80)

setvariable(sleep,5)

VolumeSelect
  CommandlineVolumes()
VolumeActions

  /* Place files at 3% into the data on the disk. */
  MakeGap(RoundUp(VolumeUsed * 0.03,1MB), DoNotVacate)

  /* Zone 1: Directories. */
  Message("Zone %1u of %2u","Zona %1u of %2u (Directories)")
  FileSelect
    Directory(yes)
  FileActions
    pause(sleep)
    Defragment(Fast)
    MoveUpToZone()
    FastFill(WithShuffling)
    AddGap(RoundUp(ZoneEnd, 1MB))
  FileEnd

  /* Zone 2: Place the MFT and some other special NTFS files. */
  Message("Zone %1u of %2u","Zona %1u of %2u (MFT&NTFsSpecialFiles)")
  FileSelect
    SelectNtfsSystemFiles(yes)
  FileActions
    pause(sleep)
    PlaceNtfsSystemFiles(Ascending,MftSize * 0.1)
  FileEnd

  /* Zone 3: files used when booting, and a gap. */
  Message("Zone %1u of %2u","Zona %1u of %2u (BootingFiles)")
  FileSelect
    ImportListFromBootOptimize()
  FileActions
    pause(sleep)
    Defragment(Fast)
MoveUpToZone()
    FastFill()
  FileEnd

  /* Zone 4: files used by the most used programs, and a gap. */
  Message("Zone %1u of %2u","Zona %1u of %2u (ProgramPrefetchFiles)")
  FileSelect
    ImportListFromProgramHints("*.pf")
  FileActions
    pause(sleep)
    Defragment(Fast)
    MoveUpToZone()
    FastFill()
  FileEnd

  /* Zone 5: regular files and a gap. */
  Message("Zone %1u of %2u","Zona %1u of %2u (RegularFiles)")
  FileSelect
    not(
      Size(50000000,0)
      or (LastAccessEnabled(yes) and LastAccess(,1 month ago))
      or DirectoryName("$RECYCLE.BIN")
      or DirectoryName("RECYCLED")
      or DirectoryName("RECYCLER")
      or DirectoryName("$*")
      or DirectoryName("Downloaded Installations")
      or DirectoryName("Ehome")
      or DirectoryName("Fonts")
      or DirectoryName("Help")
      or DirectoryName("I386")
      or DirectoryName("IME")
      or DirectoryName("Installer")
      or DirectoryName("ServicePackFiles")
      or DirectoryName("SoftwareDistribution")
      or DirectoryName("Speech")
      or DirectoryName("Symbols")
      or DirectoryName("ie?updates")
      or DirectoryName("dllcache")
      or DirectoryName("Installshield Installation Information")
      or DirectoryName("System Volume Information")
      or DirectoryName("windows.old")
      or FileName("*.7z")
      or FileName("*.arj")
      or FileName("*.avi")
      or FileName("*.bak")
      or FileName("*.bup")
      or FileName("*.bz2")
      or FileName("*.cab")
      or FileName("*.chm")
      or FileName("*.dvr-ms")
      or FileName("*.gz")
      or FileName("*.ifo")
      or FileName("*.iso")
      or FileName("*.log")
      or FileName("*.lzh")
      or FileName("*.mp3")
      or FileName("*.msi")
      or FileName("*.old")
      or FileName("*.pdf")
      or FileName("*.rar")
      or FileName("*.rpm")
      or FileName("*.tar")
      or FileName("*.wav")
      or FileName("*.wmv")
      or FileName("*.vob")
      or FileName("*.z")
      or FileName("*.zip")
      or FileName("*.mkv")
      or FileName("*.ogg")
      or FileName("*.flv")
      )
  FileActions
    pause(sleep)
    Defragment(Fast)
    MoveUpToZone()
    FastFill()
  FileEnd

  MakeGap(MaxNextZoneBegin, DoNotVacate)

  Message("Zone %1u of %2u","Zona %1u of %2u (AllOtherFiles)")
  FileSelect
    All
  FileActions
    pause(sleep)
    SortBySize(ascending)
  FileEnd
 
VolumeEnd

after running the script that consolidate free space. I running many time but is very slow and the result is this:



 Sad
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #3 on: December 15, 2012, 10:55:58 pm »

Is this correct and the fastes mode?
I would say yes, the script should do what you want. Your theory is correct, your script will first select (but not move) all files except your filler file, and then move your filler file into the gaps. An alternative would be to use the ExcludeFiles command to exclude everything except you filler file.
Logged
einstein1969
JkDefrag Supporter
***
Posts: 10


View Profile
« Reply #4 on: December 18, 2012, 11:04:57 pm »

Thanks for your response.

I would create a script that fast fill a zone.

i.e.

Code:
  Setvariable(Z1,ZoneBegin or ZoneEnd) //what is correct?
 
  FileSelect
    .... and not (Filename("Filler*.$$$"))
  FileActions
    ....
  FileEnd

  Makegap(Z1)

  FileSelect
    Filename("Filler1.$$$")
  FileActions
    sortbysize(ascending)
  FileEnd


There is a method for calculate the size of the gaps of the zone to fill and select a corresponding filler of that dimension?


« Last Edit: December 19, 2012, 01:33:24 am by einstein1969 » Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #5 on: December 22, 2012, 01:30:46 pm »

There is a method for calculate the size of the gaps of the zone to fill and select a corresponding filler of that dimension?
See the "ZoneSize" and "ZONE222N" variables. Please note that these variables are only available inside the zone, between FileActions and FileEnd, and that the values can be different before and after you perform actions on the files. For a full list of variables see Variables. Some simple expressions are possible, such as adding and subtracting, for more information see NUMBER. You may also be interested in the RunProgram command, which can run an outside program from inside a MyDefrag script. It might be useful in your case to create the filler file.
Logged
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!