From:	CSBVAX::MRGATE!@KL.SRI.Com,@wiscvm.wisc.edu:ZRGC002@DTUPEV5A.BITNET@SMTP 29-JUL-1987 15:15
To:	EVERHART
Subj:	Allocation bitmap for disks/Associate bad LBN with file

Received: from wiscvm.wisc.edu by KL.SRI.COM with TCP; Tue 28 Jul 87 12:00:54-PDT
Received: from DTUPEV5A.BITNET by wiscvm.wisc.edu ; Tue, 28 Jul 87 13:53:45 CDT
Date:     Tue, 21-Jul-1987 21:10:22.03 GMT+1
From:     <zrgc002%DTUPEV5A.BITNET@wiscvm.wisc.edu> (Christoph D. Gatzka)
Subject:  Allocation bitmap for disks/Associate bad LBN with file
To:       <info-vax@sri-kl.arpa>

I wrote a short program that will search for a bad block, provided you know
the bad block's LBN and will at the same time print an allocation bitmap of
your disk with '*' marking allocated blocks and ' ' marking free blocks.

DOES ANYBODY HAVE A PROGRAM TO DIRECTLY ACCESS INDEXF.SYS FOR THIS INFORMATION ?

Create the allocation information like this:

$ set proc/priv=all
$ def sys$output sys$usrroot:[zrgc002]disk.ana
$ du/head/block=count=0 dub3:[000000...]*.*;*

Then run this pascal program over disk.ana:

program a(input,output);

var ein:text;
    bitmap:packed record case boolean of
false:(a:packed array[0..790000]of char);
true:(b:packed array[0..10000]of packed array[1..80]of char);end;
    zeile:varying[132]of char;
    zeile2:varying[80]of char;
    i,j,lbn,count:integer;
begin
open (ein,'disk.ana',old);
reset (ein);
while not(eof(ein))
 do begin
     readln (ein,zeile);
     if zeile.length > 44
      then if substr (zeile,9,6) ='Count:'
            then
             begin
              readv (substr(zeile,15,15),count);
              readv (substr(zeile,38,zeile.length-37),lbn);
              if count> 0 then
              for i:=lbn to lbn+count-1
               do begin
               bitmap.a[i]:='*';
              if (i=632766) or (i=632769) or (i=13463) or (i=42000)
               then writeln ('lbn:',lbn,' count: ',count,' i:',i);
               end;
            end;
    end;
close(ein);
for j:=0 to 790000-1
 do if bitmap.a[j]<>'*' then bitmap.a[j]:=' ';
open (ein,'bitmap.karte');
rewrite (ein);

for j:=0 to 10000
 do begin
    zeile2.body:=bitmap.b[j];
    zeile2.length:=80;
    writeln (ein,zeile2);
    end;
end.

This will produce a list of the logical block numbers found on sys$output
(search disk.ana with any editor for 'lbn' to associate the file with the
lbn) and an allocation map named "bitmap.karte".

 Christoph D. Gatzka                zrgc002@dtupev5a.bitnet
 Student of medicine

 University of Tuebingen
 Germany
