Hi, I just worked with a FAT16 filesystem (Win95 / 133 MHz / 48 MB / 1.2 GB)
on a dying harddisk. No FreeDOS tools involved, but I found some bad
behaviour of MS tools. So here my suggestions:

- add a recovery mode to XCOPY which tries to copy all files, does
  twice as many attempts per sector compared to normal mode, and
  which is NOT interactive. If a sector cannot be read, the contents
  are replaced by binary 0x20 (for example - the normal IGNORE mode
  is much less useful, as random data is left in the buffer). Optionally,
  files which could be read successfully can be DELETED in the target
  directory (so only half-broken files are copied in the end). Screen
  output and errorlevels should tell which files were half-broken /
  completely unreadable, and if there were (half/completely) broken files
  at all.
  You could even allow copying DIRECTORIES, skipping over unreadable
  directory sectors (obvious ;-)). Be warned: This might be exactly what
  the RECOVER tool already does in 'file' (as opposed to 'disk') mode.

- CHKDSK surface scan should try reading sectors N times. If that fails,
  mark the sector as broken and try copying the data elsewhere, trying
  to read the broken sector M times. M being much larger than N probably.
  This is based on the observation that MS XCOPY asks what to do (abort,
  retry, ignore, fail) after every 5th attempt and that MS SCANDISK allows
  10 (!) read attempts before it is finally convinced that a sector is
  broken. Far too many if you ask me. I wonder if it makes any sense to
  try reading the data (to copy it to a fresh cluster) 10 more times after
  10 failed read attempts (which resulted in the conclusion 'sector broken')
  at all...

- DEFRAG (or CHKDSK) should have a mode 'move data around to make clusters
  A ... B empty', optionally marking the whole cluster range as bad after
  that.
  Background: First I had 1 broken cluster in the registry (system.dat).
  Then I tried to copy system.dat user.dat system.da0 user.da0 to a new
  directory, copy newdir\*.da? olddir\*.d-?, del olddir\*.da?,
  ren olddir\*.d-? *.da? ... in other words: Copy the files to fresh
  clusters. In the end there were several more broken sectors even after
  SCANDISK had 'repaired' the one broken cluster in system.dat :-(.
  Next,
  I copied several big files (all BMP and DLL files and some big EXEs) in
  similar way to new clusters. Then, I used DEBUG and a tiny program:
  debug markbad.com
  lcs:300 2 1 10
  gcs:115 <- let markbad replace all 0000 words by fff7 words: mark all
    free clusters as bad clusters, in cs:300 ... cs:2300
  wcs:300 2 1 10
  wcs:300 2 9a 10 <- in this particular case, the 2nd FAT was 0x99 sectors
    after the first FAT on disk, and of course both have to stay in sync.
  ... then repeat for the next 0x10 FAT sectors (next 4096 FAT entries)
  In the end I had declared a lot of the first 8k*32k=256 MB (32k cluster
  size) as broken, as only the first part of the disk was worn out beyond
  repair.
  Alas some files had to be replaced by new copies from CD-ROM, so I could
  not finish my project (lack of time), but:

- IF XCOPY would not ask about retrying all the time
- IF XCOPY could tell me which files are broken
- IF SCANDISK would not be so over-optimistic in surface scan
- IF DEFRAG or SCANDISK would allow me to free and mark-as-broken sectors
  in the neighbourhood of the actually broken sectors
THEN the whole task could have been done in considerably less time and with
more success, compared to my manual, tedious, rescue attempts.

Of course Win95 contains other annoying aspects, like long file names
and system/hidden/readonly files, which makes a DOS based repair harder,
but in the end the abovementioned tool improvements would have helped me
a lot. So let us do better than MS - let us introduce configurable XCOPY
critical error handling (and error messages which tell you WHICH files are
the victims of read/write errors) and configurable SURFACE SCAN 'confidence'
(be more pessimistic, but try hard to rescue data; treat sectors in the
neighbourhood of broken sectors as broken, too - copy their contents to
fresh clusters and mark the close-to-damaged-area clusters as damaged, too).
Or offer a 'turn disk area into forb*dden space' option to DEFRAG (in
command line mode, letting the user give the start/end cluster number of
the selected area as argument).

Thanks for your attention - hope you can find the time to implement
some of the above. Thanks in advance...

Eric.


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Freedos-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to