From: Gotfryd Smolik, VMS lists [gotfryd@stanpol.com.pl] Sent: Monday, April 23, 2001 11:01 AM To: Info-VAX@Mvb.Saic.Com Subject: Re: Missing 000000.dir On 19 Apr 2001, Dave Greenwood wrote: +We have a (virtual) disk that's apparently missing 000000.dir: + + $ dir vda3:[000000] + %DIRECT-E-OPENIN, error opening VDA3:[000000]*.*;* as input + -RMS-E-DNF, directory not found + -SYSTEM-W-NOSUCHFILE, no such file + +We're using VMS 7.2-1 AXP with Glenn Everhart's vddriver, although +I don't think either are at issue here. (The disk is nfs-served +to a Unix system and there was an attempt to backup/restore the +disk using Unix-based software - it seems safe to say *that* +caused the problem. It's a long story and I think we can say that +it won't happen again. Sigh.) + +Since I can still do DIR VDA3:[*] and get listings of files in +top-level directories I think we can use BACKUP to save the files, +re-INIT the disk and then restore from the backup save set. What +I'm curious about is whether there's a way to recreate the missing +000000.dir without the backup-init-restore sequence. Anyone have +any suggestions? Yes: you have missed the backlink of file named 000000.DIR :) *Probably* creating properly /ENTERed link will resolve the problem. Do: *WARNING* - be sure the filesystem is not used by other propesses. Operation on directory thru RMS is *not* supported. You may mount the device privetely to operate on the directories ! Be aware the fact, that you can this way corrupt the dirfile(s) and if you filesystem is already corrupted you can get to worse problems. You are warned :) $ CREATE/DIRECTORY the_disk:[TMP.TMP] You can use any directory name in place on TMP. It is expected, that in the directory does *not* exist a 000000.DIR file before. The work is simplest (and next steps applies only to the example) if the [TMP.TMP] dir doesn't exist before or was empty. You can READ and skip unneccesary records but that is overkill. $ OPEN/READ/SHARE=WRITE IN any_other_good_disk:[000000]000000.DIR Althought it *is* unsupported opening the dirfile, can't see any reason for problem. You already can OPEN a 000000.DIR on other unused disk, with VDDRIVER that is not a problem for you. $ READ/NOLOCK IN DIRREC $ SHOW SYMBOL DIRREC Probably the first match will have the 000000.DIR in it; but *is* possible that you have dir named b.ex. 00.DIR (means "[00]") or a file starting with "-" etc. - then you must check if the record is for 000000.DIR At end $ CLOSE IN Of course, you *can* create the symbol manually: $ DIRREC="1234000000.DIR12345678" $ DIRREC[0, 32]=%x0A000001 $ DIRREC[14*8,32]=%x00040001 $ DIRREC[18*8,32]=%x00000004 $ SHOW SYMBOL DIRREC (sure, the values are from real directory; that is much faster than manual calculation :) !) $ OPEN/READ/WRITE IO the_disk:[TMP]TMP.DIR ! Unsupported, but allowed $ READ IO DIRREC Ignore the error :) That way you position the record in file ;) $ WRITE IO DIRREC $ CLOSE IO You can check, if: $ DIR [TMP.TMP.000000] allows you "see" all files :) And that *is* the proper directory ! What wrong ? Still the backlink of 000000.DIR - probably is set to the TMP.DIR :] Haven't check if ANAL/DISK/REPAIR checks for that, probably not. [step 2] ++++++++++++++++++++++ Also you haven't the "root" set themself: $ SET FILE [TMP.TMP]000000.DIR/ENTER=[TMP.TMP.000000] You probably will "see" the "proper root": $ DIR [000000] and can remove the unneded entry: $ SET FILE [TMP.TMP]000000.DIR;/REMOVE ++++++++++++++++++++++ The backlink *still* is wrong. *Probably* setting second entry in "step 2" rather than before as: [step 2, version b] ++++++++++++++++++++++ $ SET FILE [TMP.TMP]000000.DIR/ENTER=[TMP.000000] and a: $ RENAME [TMP]000000.DIR [TMP.TMP.000000] will correct the backlink; haven't check, but all looks as expected. ++++++++++++++++++++++ Of course, the reason of my description is simple: years ago have "make visible" the fact, that ODS filesystem doesn't themself rely of the directory structure :), in one of steps have remove the 000000.DIR "loop" entry. Even if the steps before are simple, someone may say that it is not worth do it. But for fun... and experience... :) Some variation (.ex. creating the [TMP.TMP.000000] with CREATE/DIR and update FID with READ + WRITE/UPDATE) possible. Excuse for eventuall bugs and re-check: have check only some steps, mistyping possible, correction welcome... ! +Thanks, +Dave Regards - Gotfryd -- ===================================================================== $ ON F$ERROR("LANGUAGE","ENGLISH","IN_MESSAGE").GT.F$ERROR("NORMAL") - THEN EXCUSE/OBJECT=ME $! GS@stanpol.zabrze.pl =====================================================================