[Info-vax] ODS-5 data/file recovery

Hein RMS van den Heuvel heinvandenheuvel at gmail.com
Fri Feb 15 12:27:57 EST 2013


On Friday, February 15, 2013 11:51:25 AM UTC-5, MG wrote:
> On 15-feb-2013 17:01, Hein RMS van den Heuvel wrote:
> 
> > Right. Image backup goes for cleanly accessible files only, physical backup
> 
> > mayget you the lost bytes, the tricky part will be to find them, all of :


> few 'hints' to get me started?  I'd be most grateful.

Marco, I'll send you  DCL script that know how to intertpret INDEXF.SYS as well as a C program. What you really need is 'the black book'.  I gave my spare copy to Fekko, close ... inthe same counrty, but not close enough

Here are a few relevant lines of code, out of context.

$!  2) Use file Id to look up file corresponding file header in INDEXF.SYS
$!
$dev =  f$parse(p1,,,"device")
$!
$! The file-ID is an offest into INDEXF.SYS
$! INDEX.SYS first starts out with 4 cluster, and then
$! a bitmap to hold a bit for each potential file header.
$! And as for every VBN, the count starts at # 1.
$!
$indexf_bitmap_vbn = (f$getdvi(dev,"cluster") * 4) + 1
$ibmapsize = (f$getdvi(dev,"maxfiles") + 4095) / 4096
$header_vbn = indexf_bitmap_vbn + ibmapsize + id -1
$!
$! Read the target block using read/key.
$! A problem is that RMS expects a 4 byte binary key whereas DCL
$! really only support string keys. By using delayed substitution
$! through the & operator we can make DCL accept most, but not
$! all, binary value.
$! First create a 4 byte string, then stick in the binary  values,
$! then pass to READ as string again
$!
$!debug dump/bloc=(start:'header_vbn',count=1) 'dev'[000000]indexf.sys
$vbn = "1234"
$vbn[0,32]='header_vbn
$open/read/share=write indexf 'dev'[000000]indexf.sys
$read/key=&vbn indexf header   ! Fails if vbn looks like quote :-(
$close indexf                   ! All done with that

--- c morcels ---

    item    getdvi_items[] = { 4, DVI$_MAXFILES, &maxfiles, 0,
                               4, DVI$_CLUSTER, &cluster, 0,
                               0, 0, 0, 0 } ;
:
/*
**  Pick up the file ID for the source file...
*/
    status=sys$parse(&fab);
    if (status & 1 ) status=sys$search(&fab);
    if (!(status & 1 )) return status;
    source_fid  = nam.nam$b_fid_nmx << 16;
    source_fid += nam.nam$w_fid_num;

/*
**  Get maxfile and cluster size from GETDVI, in order to calculate
**  the offset to apply to the file ID to get the VBN in indexf.sys
*/
    devnam_desc.addr = nam.nam$l_dev;
    devnam_desc.len  = nam.nam$b_dev;
    status = sys$getdvi ( 0, 0, &devnam_desc, getdvi_items,0,0,0,0);
    index_file_id_offset = 4 * cluster + ( maxfiles/4096 ) + 1;


fwiw,

Hein




More information about the Info-vax mailing list