FSV - Recover Deleted Files =========================== Users' Guide ============ On RSX, when a file is created a file header is created for it in the Index File. When the file is deleted the header remains unchanged, but is de-allocated. Thus, for a period of time (until the header is re-used or the blocks the file occupies are re-used), it is theoretically possible to recover the file by finding the header and hence the allocation pointers for the file. This can be useful in either of two cases:- (i) Some programs are accidentally deleted and need to be recovered. (ii) The file structure becomes corrupt making them inaccessible. In either case, if FILSAV is run immediately, it is possible, usually, to recover the files. The program can be run in any of the valid RSX ways:- RUN $FSV or FSV or FSV command-line The first two will result in a prompt of FSV> which will re-prompt after each filename until CTRL-Z is typed. Note that before running, LUN 1 must be assigned to the drive on which the input disk is loaded (but not mounted) and LUN 2 to the output disk for the new files. Thus, if the first format is used, the relevant LUN assignments must be built into it at taskbuild time. FILSAV will accept a command-file as input. There are only two legal lines that can be specified to FSV:- 1. Specify starting block for File Header Search FSV>nnnnnn where nnnnnn is the octal number of the first block you want FSV to read when searching for file-headers. This can be useful if you know that all file-headers sit in a certain part of the disk. 2. Specify a filename to be restored FSV> filespec where filespec defines the file to be recovered. The only relevant parts of this are the filename, extension and version number. If a UIC is specified it defines the UIC for the output file, but is ignored as far as the input file is concerned as the UIC in the file header is the Owner UIC, not the UIC under which the file is stored. Obviously no device may be specified. If no version number is given, FSV lists out each version of the file encountered together with the number of blocks, and then selects the one with the highest number of blocks. FSV may report the following error message:- NO SUCH FILE - if no file header could be found corresponding to the filespec given. FSV - Recover Deleted Files =========================== System Guide ============ The task is very simple in concept. It assumes that the input device (the one on which the 'deleted' or 'lost' files reside), is assigned to LUN 1, and that the output device (the one on which the files are to be put), is assigned to LUN 2. It then reads the input disk 90 blocks at a time and searches each block to see if it is the missing file header for the required file (it does this simply by checking to see if the block contains the relevant filename, extension and version (if specified) in the correct format in the right place - the odds against any other block containing them is very high). If no version number is specified it searches for each one and selects the one with the most blocks allocated. In either case it then creates an output file on LUN 2 from the information in the blocks pointed to by the retrieval pointers in the header just found. FSV is a non-privileged task with a taskname of ...FSV, and uses six units (well 1, 2, 5, & 6 anyway), of which unit 1 should be assigned to SY: and unit 2 to LB:, and should be built with the macro library [1,1]MACLIB.MLB (for $BASTS) and the object library [1,1]OBJLIB.OLB (for RADASC & suchlike). As it stands FSV is horribly primitive (but appears to work). The reason it searches the whole disk for the file header rather than the Index File only is a fear that the Index File may be clobbered - but it really should do either dependent on a switch. Also, at the moment, the disk with the deleted file must be taken offline immediately - which is awkward in a muti-user environment. Maybe one day I'll tidy it up a bit!