From:	SMTP%"MACRO32%WKUVX1.BITNET@uu7.psi.com" 25-AUG-1993 11:10:08.50
To:	EVERHART
CC:	
Subj:	Re: A puzzle on single disk systems

X-Listname: "VMS Internals, MACRO, & BLISS Discussions" <MACRO32@WKUVX1.BITNET>
Warnings-To: <>
Errors-To: MacroMan%WKUVX1.BITNET@uu7.psi.com
Sender: MacroMan%WKUVX1.BITNET@uu7.psi.com
From: <carl@SOL1.GPS.CALTECH.EDU>
X-Newsgroups: vmsnet.internals
Subject: Re: A puzzle on single disk systems
Date: 20 Aug 1993 19:43:22 GMT
Organization: HST Wide Field/Planetary Camera
Lines: 60
Distribution: world
Message-Id: <2539guINNchk@gap.caltech.edu>
Reply-To: MACRO32%WKUVX1.BITNET@uu7.psi.com
Nntp-Posting-Host: sol1.gps.caltech.edu
To: MACRO32@WKUVX1.BITNET
X-Gateway-Source-Info: USENET

In article <01H1XR7TXUAQ0001A5@NAUVAX.UCC.NAU.EDU>, "Anthony C. McCracken"
 <ACM@NAUVAX.BITNET> writes:
=   Just for fun:
=
=I have a single disk VAX with a single tape drive.  I need to re-initialize
=the disk in order to change the cluster factor.  VMS doesn't allow me to
=dismount the pack even if all installed images are removed and initialize
=can't initialize a pack unless it's dismounted.
=
=This is a standalone system, no clustering allowed.  The disk pack is not
=allowed to be moved to another system and re-initialized.  The only thing
=you're allowed to boot off the tape drive is standalone backup, diagnostics
=programs aren't allowed.
=
=Question:  Can it be done ?

I think so.

=           If so, how?

First backup your disk.  Then run the program included below.  Then shut down
your system.  Then do a standalone backup, specifying the /NOINITIALIZE
qualifier.  The program changes the cluster factor in the home block of the
disk.  BACKUP/NOINITIALIZE uses the information in the home block to initialize
the disk.  I haven't tried this for a system disk, but the technique works for
the disk on which I tested it.  At best, you'll have fixed your problem.  At
worst, you'll have defragmented your disk.

        LOGICAL*2 WARRAY(256), CKSM
        INTEGER*4 CHECKSUM, CLUSTER
        EQUIVALENCE(CKSM, CHECKSUM)
        OPEN(UNIT=1,FILE='SYS$SYSDEVICE:[000000]INDEXF.SYS',RECORDTYPE='FIXED',
        1       FORM='UNFORMATTED',STATUS='OLD',SHARED, RECL=128)
        TYPE 1, ' Cluster size: '
1       FORMAT(A,$)
        ACCEPT *, CLUSTER
        READ(1) WARRAY
        READ(1) WARRAY
C       WARRAY now contains the home block
        WARRAY(8) = CLUSTER
C       We've now changed the cluster factor for the disk.  Now we fix up the
C       checksums
        CHECKSUM = 0
        DO 10 I = 1, 29
10      CHECKSUM = CHECKSUM + WARRAY(I)
        WARRAY(30) = CKSM
        CHECKSUM = 0
        DO 20 I = 1, 255
20      CHECKSUM = CHECKSUM + WARRAY(I)
        WARRAY(256) = CKSM
C       And write the home block back to disk.
        REWRITE(1) WARRAY
        END
--------------------------------------------------------------------------------
Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL

Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
understanding of astronomy is purely at the amateur level (or below).  So
unless what I'm saying is directly related to VAX/VMS, don't hold me or my
organization responsible for it.  If it IS related to VAX/VMS, you can try to
hold me responsible for it, but my organization had nothing to do with it.
