DEFRAGING YOUR DISKS WITH MPEX/3000 ----------------------------------- DISK FRAGMENTATION is the current buzz word on many MPE/iX manager's lips. There has been a number of packages that have recently appeared on the HP3000 market, whose sole purpose is to defragment files on your disks. The best way until now to defragment your drives was to bring the system up with an INSTALL. This had the effect of replacing files onto the disk and in the process freeing up contiguous space. This contiguous space will come in handy when you have the next Operating System update and you need to find achunk of 100,000 sectors on LDEV 1! The need for a software solution has arisen because of the downtime caused by such a lengthy procedure as an INSTALL. One product that is not new to the market is MPEX by VESOFT Inc. What is new are the applications for which this software can be used. MPEX offers its users a vast repertoire of commands and facilities that can aid and enhance the use at your HP3000 computer. Using a collection of these commands we will look at disk fragmentation on your system and show you a way of not only defragmenting your drives but in the same process, free up any unused space from within the file (condense). Using the MPEX software we will create a command file called DEFRAGX that will defragment and condense files on your disks. To monitor the effects of DEFRAGX, we will use an HP utility called DISCFREE. DISCFREE A will show us a map of the blocks in use by the files on your system. It's these blocks of contiguous space that defragmentation will effect. Also shown is the free space, this figure will be increased by the condense process of our DEFRAGX command. The DEFRAGX command is built up of 2 main sections: 1) MPEs algorithm for re-organising files is to place the file on the disk with the most space. If we sort the files in EOF order with the largest file first, the defragmentation of the disk will be even more efficient because the biggest file will be placed in the biggest space !! To do this step we will create a custom LISTF mode. Add these lines using your favourite editor: FOR RFILE IN MPEXFILESET SORT (EOF:'DESC') DO WRITELN(FULLNAME); Save this file as DEFRAG.LISTF.VESOFT so it can be located by the LISTF command which follows. This LISTF mode displays the full name of the selected files in EOF order. 2) The DEFRAGX command file itself. With your favourite editor add the following lines:- BUILD FRAGFILE;TEMP;DEV=DISC;DISC=10000,32;REC=-26,,F,ASCII;NOCCTL FILE FRAGFILE=FRAGFILE,OLDTEMP LISTF @.@.@(DEVICE=’DISC’ AND NOT OPENED),DEFRAG;OUT=*FRAGFILE ALTFILE ^FRAGFILE;XLTRIM;KEEPAMDATES;DEV=DISC Keep the contents as DEFRAGX The DEFRAGX command builds a file FRAGFILE, to hold the names of files due for defragmenting and condensing. %LISTF selects all files on the system and applies the condition DEVICE='DISC'. This condition will exclude any files that do not have a device class of DISC. Doing a SHOWDEV DISC will show a list of Ldevs currently configured as DISC on your system. This is the range of disks that DEFRAGX will use. HP's SYS files that shouldn't be moved have a class of something other than DISC ( i.e $SYSTEM_MASTER). To get a list of files that are not to be DEFRAGXed do %LISTF @.@.@(DEVICE<>'DISC'),4. The %LISTF,4 mode will show the files that have special device classes. This complete LISTF of files is output to FRAGFILE in our special DEFRAG format of FULLNAME in EOF order. This file is used as an indirect file (^) by the %ALTFILE command. The %ALTFILE command will first ;XLTRIM each file thus freeing any saveable space. Each file is then replaced back onto device DISC using HP's algorithm for replacing files. The files access and modified dates are unaltered by this process. The amount of free sectors on one sites machine before the DEFRAGX was 775,648 sectors, this amount increased to 875,488 freeing up 100,000 sectors of space, this is the file compression process at work. More importantly is the largest block available before DEFRAGX was 151,376 sectors, this increased to 414,448 sectors!! The DEFRAGX tool can be run at anytime but it's most efficient if run exclusively. This is because sessions and batch jobs are holding open space that can be utilised by DEFRAGX. The more space that DEFRAGX has to start of with the better the defragmentation it can achieve. DEFRAGX can be scheduled to run overnight or weekends and using other MPEX commands it is quite easy to stop any jobs and logoff any users. It is also recommended that any cleanup jobs are run prior to DEFRAGX, these will remove any old or unused files, freeing up valuable disk space . DEFRAGX on our system runs weekly so why not try the same on your system? The DISCFREE A should always be run before and after the DEFRAGX so that defragmentation and file compression can be monitored. This DEFRAGX command has a number of benefits over other methods of disk defragmentation: Enhanced algorithm for optimum disk defragmentation by replacing files in size order No downtime needed to accomplish the defragmentation of files Major increases in free system space by condensing files before replacing them to disk. No changes in file integrity. Files CREATOR, SECURITY, LOCKWORDS are unchanged . ACCESS and MODIFY dates are also unchanges resulting in unnecessary STOREing of files DEFRAGX is one application for which MPEX is suited. MPEX can be applied to many things, defragmentation software just defragments your disk!!