home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / f / fsck / hard_help < prev    next >
Text File  |  1996-12-22  |  13KB  |  331 lines

  1. hardfix (1.11) - heavily damaged disc fixer
  2.  
  3. NOTE: this program is SHAREWARE. Read the !SHAREWARE file for more info.
  4.  
  5. hardfix is a disc utility that fixes the errors that can affect the boot
  6. block, the 2 copies of the map and the root directory without having to scan
  7. the whole directory tree. These sort of errors generally make the disc
  8. un-readable or un-writable!
  9. hardfix can also be used to write the bootblock, map and root directory to a
  10. file, so that you can always try to restore them in case they are totally
  11. damaged (ie. absolutely unfixable).
  12.  
  13.  
  14. Index
  15. -----
  16.  
  17. - Usage
  18. - When you need to use it
  19. - The fixable errors
  20. - The logfile
  21. - Notes
  22. - Extra features
  23. - Saved file format
  24. - Disclaimer
  25. - Limitations
  26. - Bugs
  27. - Results achieved up to now
  28. - History
  29. - Credits
  30. - Conditions of use
  31. - Contacting the Author
  32.  
  33.  
  34. Usage
  35. -----
  36.  
  37. hardfix [-options] [-[s|r] savefile] [-l logfile] pathname
  38.   -l   print the results in "logfile"
  39.   -s   save bootblock/map/root sectors to "savefile"
  40.   -r   restore bootblock/map/root sectors from "savefile"
  41.   -Q   ask before fixing
  42.  -1/-2 force to fix the first/second copy of the map
  43.  
  44. If the disc is readable, pathname can contain the disc name (eg.
  45. IDEFS::IDEDisc4.$), otherwise it must contain the disc number (eg.
  46. IDEFS::4.$).
  47.  
  48.  
  49. When you need to use it
  50. -----------------------
  51.  
  52. hardfix should not be used regularly like fsck, since the errors it fixes are
  53. usually really uncommon. Moreover fsck recognises most of the errors hardfix
  54. cures and tells you when it is needed.
  55. Anyway, you can use it regularly to save the important disc data (ie.
  56. bootblock, map and root) to a file, so that you will be able to restore them
  57. if they are completely destroyed for some mysterious reason. Moreover, you
  58. are adviced to save them before trying to fix the map with fsck or with
  59. hardfix itself: if the fix is wrong (especially if it aggravates the
  60. situation!), you can always restore your old data.
  61. Remember that restoring old maps generally causes many file corruptions! In
  62. fact, the map is costantly updated while files are saved/deleted, and even
  63. files that are not updated can be automatically moved around by RISC OS.
  64. If your map is broken, try to fix it with fsck and hardfix and eventually
  65. restore an old one only if you are sure there is nothing better to do!
  66.  
  67.  
  68. The fixable errors
  69. ------------------
  70.  
  71. hardfix is able to fix the following errors:
  72. - bootblock checksum wrong
  73. - bootblock defect list end marker missing
  74. - bootblock defect list checksum wrong
  75. - map cross check wrong
  76. - map copies different
  77. - zone checksum wrong (this is the typical cause of unreadable discs)
  78. - zone free chunk offset wrong
  79. - zone free linked list wrong (this is the typical cause of unwritable discs)
  80. - zone not correctly terminated
  81. - ID too high for the disc shape
  82. - not sector-aligned object
  83. - last object in zone too long
  84. - illegal system files
  85. - root directory identifiers wrong
  86. - root checksum wrong
  87. - root master sequence numbers different
  88. - root endmarker wrong
  89. - root reserved bytes not cleared
  90. - root address wrong
  91.  
  92. The bootblock errors should never appear, unless your disc is *really*
  93. damanged or badly formatted, and will probably be useless to try to fix it.
  94. Moreover it seems that some some disc have been made completely unreadable
  95. after hardfix 'cured' the bootblock checksum (anyway, reformatting and
  96. restoring the map and the root directory using hardfix fixed everything!).
  97. Considering this bad experience I removed the possibility to save the
  98. bootblock from the unregistered version. If you really need it (for example
  99. because the disc is unreadable due to bootblock corrupton) you *must* contact
  100. me (sending the saved disc data) and I will try to investigate. In old
  101. versions of this file I said "you *should* contact the author" but someone
  102. didn't and...
  103.  
  104. The map errors are the most common, especially the ones about free lists, but
  105. can usually be successfully cured.
  106.  
  107. The root directory errors are generally serious since they usually imply that
  108. the directory has been completely overwritten. In this case the only choice
  109. is to restore it from a previously saved file (only the root should be
  110. restored, not the bootblock and map, too!).
  111.  
  112. Using the -Q option you will be asked to choose if the error(s) has to be
  113. fixed or left intact. So you can choose to fix only the map and not the
  114. bootblock, for example.
  115. You will always be asked if the fixes has to be applied to the disc (ie. if
  116. you really want to save the fixed bootblock, map and root directory).
  117.  
  118.  
  119. The logfile
  120. -----------
  121.  
  122. Using the logfile (-l) option is generally really useful: if something
  123. strange happens, the author will be more helpful if he can see exactly what
  124. happened and you don't even have to try to explain what happened when you run
  125. hardfix, the logfile and the saved disc data is usually enough!
  126. The logfile contains exactly what it is printed to the screen, so it should
  127. be really small (nearly 1K on a good disc or nearly 5K on a quite corrupted
  128. one).
  129. You cannot save the logfile to the disc to fix!
  130. If a file with the same name of the logfile already exists, the new data will
  131. be attached at the end of it: in this way, you can attach together two or
  132. more logfiles.
  133.  
  134.  
  135. Notes
  136. -----
  137.  
  138. If the two copies of the map are different, hardfix tries to fix the less
  139. damaged. If they are apparently damaged at the same level, hardfix will ask
  140. you which map to fix. In normal cases, you are adviced to fix the map that
  141. hardfix suggests or, by default, choose the first one.
  142. The -1 and -2 options can be used to force hardfix to try to fix the first or
  143. the second copy, regardless of their state.
  144. Gordian Installer (a commercial protection system) modifies the map creating
  145. some unofficial system file (strictly speaking, the only system files allowed
  146. on E-Format discs are the bootblock, the map and the root directory). hardfix
  147. detects this corruption but always asks you if you want to fix it: if you
  148. have a Gordian protected program installed on the disc you must not fix this
  149. problem, otherwise it will no longer run and you will need a new installation
  150. floppy.
  151.  
  152.  
  153. Extra features
  154. --------------
  155.  
  156. Registered versions fully support 'big' discs (ie discs larger than 512Mb
  157. supported by the new FileCore module for RISC OS 3.60 or later) while the
  158. unregistered version will only show if there are problems but will not save
  159. the fixed data back to the disc.
  160.  
  161. A special features code is available to allow hardfix to write to the
  162. bootblock. Since this may be dangerous I'll not usually allow people to use
  163. this code (unless they need it in order to fix their disc).
  164.  
  165.  
  166. Saved file format
  167. -----------------
  168.  
  169. This is only of interest to people who wants to access to the saved file in
  170. their own programs (probably nobody!).
  171. The saved file has a header that contains the filesystem informations
  172. followed by a series of tagged object.
  173. The header consists of the filesystem name followed by a newline and then the
  174. disc number followed by another newline.
  175. Each tagged object consists of a textual tag of 4 bytes followed by the
  176. object itself. The currently recognised tags are:
  177. "BOOT" - bootblock (512 bytes)
  178. "MAP1" - the first copy of the map (the length can be calculated from the
  179.          bootblock data)
  180. "MAP2" - the second copy of the map (the same length as the first copy)
  181. "ROOT" - the root directory (2048 bytes)
  182. "RSiX" - the RISCiX partition table (only if RISCiX partitioned!) (256 bytes)
  183.  
  184. The bootblock must always come before the map, otherwise the length of the
  185. map cannot be calculated. Only 800K floppies have no bootblock: in this case
  186. the length of the map is 1024 bytes.
  187. The second copy of the map must always follow the first one.
  188. Any other tag is ignored and the file is scanned until a recognised tag is
  189. found. The tags should be word aligned (the alignement refers to the first
  190. tag even if it isn't actually word aligned inside the file because of the
  191. filesystem name).
  192.  
  193.  
  194. Disclaimer
  195. ----------
  196.  
  197. hardfix can be considered a really dangerous program since it can directly
  198. write to the bootblock, map and root directory: these are the key sectors of
  199. a disc, damaging them can result in the complete or partial loss of the data
  200. on the disc.
  201.  
  202. I tried most of the features of hardfix on my dis