On: Thu, Dec 22, 2005 at 12:29:27PM -0600,Adam Thornton Wrote:

} I find, after using DIRMAINT for a long time, that I actually have  
} quite a lot of free DASD, but it's carved up into little islands  
} scattered around my volumes.  If I could consolidate those gaps into  
} fewer, larger gaps, I'd be in much better space for allocating disks  
} for Linux guests.
} 
} Is there a zero-cost tool that will do this defragmentation for me?   
} I mean, in essence it's a pretty simple tool: look at your list of  
} free cylinders, do some sort of best-fit pass to associate minidisks  
} with gaps, and then use DDR to copy them from one to the other.   
} Having done that, touch up the MDISK definitions in DIRM, and Bob's  
} yer uncle.

Depends on type of minidisk.  If they are CMS minidisks, I have done
that many times, starting from a diskmap in xedit and an xedit macro
that generates a dirmaint cmd command.

If they are Linux or other non-CMS minidisks, I have always done those
pretty much by hand.  Allocate a new md, DDR it over, delete the old md
and correct the address of the new one.

Here is the macro I used for CMS mds:

/*
  MMD - Move Mini Disk.

  Entered with the current line pointing to either a directory MDISK
  entry or a diskmap entry.

  In either case, generate and issue a dirmaint CMDISK command to
  move the mdisk to its target.

  The target is the first (and only) operand of this macro.  If a
  CP QUERY DASD arg(1) returns rc=0, it is assumed to be a volser,
  and a CMD with AUTOV will be generated.  Otherwise, an AUTOG
  will be generated.
*/

false = (1=0)
true  = (1=1)
trace O

/*
  Get the file line and analyze it.
*/
'EXTRACT /CURLINE/LINE/'
if word(curline.3,1) = 'MDISK'   /*  In the directory?  */
   then do
        ccu   = word(curline.3,2)
        dev   = word(curline.3,3)
        size  = word(curline.3,5)
        'FINDUP USER'
        'EXTRACT /CURLINE/'
        user  = word(curline.3,2)
        ':'line.1
        end
   else do
        line = substr(curline.3,9)
        user  = word(line,1)
        ccu   = word(line,2)
        dev   = word(line,3)
        size  = word(line,6)
        end

/*
  Make sure that the user is not logged on.
*/
parse upper value diagrc(08,'QUERY USER' user,80) with cp_rc .
if cp_rc ^= 45
   then do
        "MSG Can't move" user"'s" ccu "because" user "is logged on."
        'OVERLAY xxxxx'
        'SET ALT 0 0'
        '+1'
        exit 45
        end

/*
  Take a look at my arg, and see if it exists as a disk.
*/
parse upper arg target .
if length(target) = 6
   then do
        parse upper value diag(08,'QUERY DASD' target,80) with . .
not_fnd '15'x
        if not_fnd = 'was not found.'
           then group = 'AUTOG'
           else group = 'AUTOV'
        end
   else group = 'AUTOG'

/*
  Build the DIRM command and issue it.
*/
address command 'EXEC DIRMAINT FOR' user 'CMDISK' ccu dev group size
target

/*
  Done, exit.
*/
'OVERLAY mmd-ok'
'SET ALT 0 0'
'+1'
exit rc


-- 
Rich Greenberg N6LRT Marietta, GA, USA richgr atsign panix.com + 1 770 321 6507
Eastern time zone.   I speak for myself & my dogs only.     VM'er since CP-67
Canines:Val, Red & Shasta (RIP),Red, husky                   Owner:Chinook-L
Atlanta Siberian Husky Rescue. www.panix.com/~richgr/   Asst Owner:Sibernet-L

Reply via email to