Operating System - OpenVMS
1827876 Members
1731 Online
109969 Solutions
New Discussion

Deliberately creating file fragmentation

 
SOLVED
Go to solution
John A.  Beard
Regular Advisor

Deliberately creating file fragmentation

Hi folks,

Does anyone have a simple DCL script that I can use to create multiple file fragments on an ODDS-2 disk. We are wanting to run this on a scratch disk that we can test Raxco's PerfectDisk against. I saw something similar here a long time ago, but I have had no success in locating it so far.

Thanks.. John
Glacann fear críonna comhairle.
4 REPLIES 4
Karl Rohwedder
Honored Contributor
Solution

Re: Deliberately creating file fragmentation

A very simple script:

$ open/wr l1 a.dat
$ open/wr l2 b.dat
$ i=0
$1:
$ i=i+1
$ write l1 "datensatz"
$ write l2 "datensatz"
$ if (i.lt.1000000) then $ goto 1
$ close l1
$ close l2

creates 2 interleaved files, can easily be extended...

regards Kalle
John A.  Beard
Regular Advisor

Re: Deliberately creating file fragmentation

Thanks..... I will deploy it now.
Glacann fear críonna comhairle.
Jon Pinkley
Honored Contributor

Re: Deliberately creating file fragmentation

If you are planning to compare this to another product, or even the different optimization levels of Perfect Disk, I would recommend making a physical backup of the "fragmented" disk, so you will be able to restore it to a known state when tying another option.

Which version of PerfectDisk and which platform are you doing your testing on?
it depends
Hein van den Heuvel
Honored Contributor

Re: Deliberately creating file fragmentation

Before running this, or something like this, make sure to de-optimize the RMS settings.
Check your cluster size.
Check the dis default extent
$ SET RMS/EXT=<1-cluster>
$ SET RMS/BLOC=<1/2 cluster>

Be sure to write/sym a good long string ( F$FAO(!1000*x) )
Add a 3rd file to be deleted to validate fragmented free space work.
Add still more files every so many records.


But really... how realistic will any such trivial test be? Can you clone a real application disk? Will files be opened/closed during defrag tests?

Cheers,
Hein.