Jump to content
IGNORED

Utility to salvage a disk with bad directory (MyDos/Ataridos)?


Larry

Recommended Posts

I have a Turbo Basic file checking utility that is a descendent of David Small's "Disk Checker" from Creative Computing. I've added some new features to it, and I'd like to add a couple more, including sorting the directory on Type 3 MyDos disks/images (unfinished, but already in process).

 

I've also toyed with the idea of incorporating a utility to salvage files from a damaged disk where one or more directory sectors is damaged/unreadable. Probably would not need it often, but still seems like a useful tool. The general idea would be to salvage all the "easy" files that still have valid directory entries. Then start going through the remaining files on the disk and recovering them one at a time. These would get "temporary" filenames that the user could change after recovery.

 

Has anyone run into a BASIC utility like this? (Not wanting to reinvent the wheel.)

 

-Larry

 

 

Link to comment
Share on other sites

Hi guys-

 

Thanks, Roy. This utility by Russg appears to do part of what I'm thinking of.

 

I don't think so, Bob. I went through the Diskey manual and it performs a few file functions, but I didn;t see anything about dealing with a damaged directory.

 

As usual, this will probably turn out to be much more complicated than I anticipate -- probably by an order of magnitude!

 

-Larry

Link to comment
Share on other sites

As usual, this will probably turn out to be much more complicated than I anticipate -- probably by an order of magnitude!

 

-Larry

 

Shouldn't be that difficult:

 

1) Read & Store VTOC.

2) Scan directories and save each directory entry into an array.

3) Trace each valid directory entry and store the used sectors in a temporary Vtoc.

4) Read each unused sector in the temporary Vtoc and see if it has a valid sector link, if valid, then scan remaining unused sectors for the same file entry that's saved in the sector links. Then when you get to the last sector of the file, you have the total sector count and starting sector.

In the above step you would also compare the stored VTOC to the rebuilt one and check for cross-linked files.

5) Write updated directory sector and return to step 4 until all remaining unused sectors are scanned...

Link to comment
Share on other sites

Yes, in concept, seems pretty uncomplicated. But normally when I start actually writing code, then the fun begins! :-D

 

Here's a related question -- will AtariDos and MyDos always select the lowest available free sector to be the first sector of the file (or subdirectory)? It looks that way and seems the logical way to do it, but...

 

-Larry

Link to comment
Share on other sites

Page 30 in the Diskey manual?

 

Special File Copy.

 

Other than the filename, all you need from the directory is the starting sector in order to trace the file. Work backwards from the last sector, which you can find by scanning. I think it gets complicated when you have a disk where a lot of files have been deleted and directory entries were re-used.

 

Bob

 

 

 

Hi guys-

 

Thanks, Roy. This utility by Russg appears to do part of what I'm thinking of.

 

I don't think so, Bob. I went through the Diskey manual and it performs a few file functions, but I didn;t see anything about dealing with a damaged directory.

 

As usual, this will probably turn out to be much more complicated than I anticipate -- probably by an order of magnitude!

 

-Larry

Link to comment
Share on other sites

I'll look at DW (version I was in Basic and was listable, IIRC, and it is a monster-sized program), but I use it all the time, and do not believe it can salvage files with a damaged directory. That is the crux of what I'm looking at. And yes, a Basic stand-alone utility would be very desirable if such a thing exists.

 

There are lots of disk utilities that can recover a file by tracing links. What happens if the link chain is broken? And without the Directory to know where to begin? Not saying that it could not be done by using a disk editor and painfully going through much of a disk with some good detective skills, but it would not be very direct. I've got a pretty good plan on how to do it, but I would have thought that this would have been done before.

 

@Bob-

Yes, that's it! Didn't see it before. I'll give that a try on a damaged directory, but that sounds exactly like what I had in mind.

 

-Larry

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...