; - FILE FNDFIL.DOC ; Fndfil is a program that searches all file headers on a disk trying to locate a logical block within a file. This can be useful when the Error Logger indicates disk errors. The error log reports certain errors by logical block number (LBN). The error log report of what LBN's are bad does not lend itself to easily resolving these bad spots on the disk. This program helps you to identify what files these LBN's are in. It additionally computes the virtual block number within the identified file. Once identified, individual blocks of corrupted files can hopefully be restored or recreated from backups and thus eliminating the cause of the system errors. Please direct comments and suggestions to: Barry Zion The Federal Reserve Bank of N.Y. 95 Maiden Lane - 7th floor annex New York, N.Y. 10045 tel: (212) 791-5585 To run the program: >run fndfil DEVICE AND UNIT TO SEARCH ON:ddn: DECIMAL LOGICAL BLOCK TO SEARCH FOR:nnnnnn where ddn: is a device such as DB1: and nnnnnn is an LBN in the range 1 - max where max is the highest LBN for the particular disk Fndfil outputs a header message indicating the 24-bit LBN it is searching in octal. Then if any file header's retrieval pointers are mapping the LBN various information pertaining to the header are displayed. Once the program finishes you may wish to verify via a directory command that the file is indeed accessible. One note of importance is that the FILE ID field displayed by fndfil may be different from that displayed by a "PIP/FU" command. This is because the map area of the file header could not contain enough retrieval pointers to map the entire file. An extension header was necessary to map all blocks the file. This occcurs when a file composed of more than 102 discontinuous segments or more than 26,112 blocks. Another way of accessing the file is to use DMP and dump the entire file header as follows: >DMP TI:=ddn:[uic]filnam/HD/BL:0:0 Substitute in the file name(s) output by fndfil and check the various file header fields. The indication that an extension header is in use is a non-zero M.EFNU and M.EFSQ field in the map area. The values in these fields will be the file id of the extension header. FNDFIL will continue searching all file headers even if a file is found. This is extra insurance in case of a severely corrupt file system in which a block is allocated to more than one file. When all file headers are exhausted a file header summary is displayed showing in use and free file headers as follows: SEARCH OF ALL FILE HEADERS COMPLETED ON DR2: FILE HEADER SUMMARY SCANNED IN USE FILE HEADERS : 3090 SCANNED FREE FILE HEADERS : 3173 FILE HEADERS YET TO BE ALLOCATED : 1836 ------------------------------------------ MAX FILE HEADERS FROM HOME BLOCK : 8099 FNDFIL CAN BE BUILT BY INVOKING @FNDFILBLD.CMD This command file will assemble and task build all modules of fndfil. And when you're ready to fix all the bugs I so cleverly and unknowingly left in the program you can use @FNDFILODT.CMD. This will create a task FNDFILODT that includes ODT. ******************************************************************************* R M S f a n s t a k e n o t e As an extra added bonus for all of you RMS fans out there I have included FABERR.MAC and RABERR.MAC. These two routines can be used as error routines for all of your RMS calls involving FAB's and RAB's. When called they will translate all of the fields of the associated RMS block (FAB or RAB) into intelligible english. Sorry, I didn't bother with the STS or STV values. You will still have to look them up in the RMS macro ref manual Table A-2 or use online help "HELP RMS ERROR". ******************************************************************************* To test FNDFIL use the command file @tstfndfil.cmd. This command file will DMP the file header of the newly created FNDFIL.TSK. You can then use this data as input to the program. This will see if fndfil can at least find itself! Enter the LBN of the first (or any other) block of FNDFIL.TSK as specified by the dmp. A sample DMP follows: Dump of DB1:[301,53]FNDFIL.TSK;2 - File ID 17576,5,0 File header HEADER AREA H.IDOF 027 H.MPOF 056 H.FNUM, H.FSEQ (17576,5) H.FLEV 401 H.FOWN [301,053] H.FPRO [RWED,RWED,RWED,R] H.UCHA 200 = UC.CON H.SCHA 000 = H.UFAT F.RTYP 001 = R.FIX F.RATT 000 = F.RSIZ 1000 = 512. F.HIBK H:0 L:000333 = 219. F.EFBK H:0 L:000334 = 220. F.FFBY 0 = 0. (REST) 000000 000000 000000 000000 000000 000000 000000 000000 000000 IDENTIFICATION AREA I.FNAM, I.FTYP, I.FVER FNDFIL .TSK;2 I.RVNO 1 I.RVDT 26-MAR-85 I.RVTI 14:44:37 I.CRDT 26-MAR-85 I.CRTI 14:43:16 I.EXDT -- MAP AREA M.ESQN 000 M.ERVN 000 M.EFNU, M.EFSQ (0,0) M.CTSZ 001 M.LBSZ 003 M.USE 002 = 2. M.MAX 314 = 204. M.RTRV ********************************* SIZE LBN ********************************* 219. H:### L:###### = NNNNNN.<<<----- enter this as the LBN CHECKSUM ********************************* H.CKSM 020145 *********************************