home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / discutils / _a_l / fsck / fsck_help < prev    next >
Encoding:
Text File  |  1994-06-26  |  13.7 KB  |  285 lines

  1. fsck (1.13) - a disc utility from UNIX (!)
  2.  
  3. NOTE: this program is SHAREWARE. Read the !SHAREWARE file for more info.
  4.  
  5. fsck is a disc utility that tries to fix the map of an E-Format disc (hard
  6. or floppy) if it is corrupted for some obscure reasons. fsck can also report
  7. some informations about the way the files are allocated (such as the bytes
  8. lost because of sectors boundaries) and eventually print a detailed
  9. description of the map and directory organization.
  10.  
  11.  
  12. Usage
  13. -----
  14.  
  15. fsck [-options] [-d lostdir] [-l logfile] pathname
  16.   -s   calculate statistics
  17.   -f   try to fix map if broken
  18.   -d   link broken part of map in directory "lostdir"
  19.   -v   print files location (-vv print also files position in zones)
  20.   -D   just display disc information recorded in the map header
  21.   -q   don't display disc information (quiet mode)
  22.   -l   print the results in "logfile"
  23.   -I   force fsck to run even if ImageFSFix module is installed
  24.   -a   automatically move files for a better fix and run fsck again
  25.  
  26. The default directory where files are linked is "$.lost+found".
  27. If 'pathname' is not a root directory (eg. ADFS::0.$.Library), fsck checks
  28. only that directory and so it cannot tell you if the map is good or broken.
  29. This could be useful if you want to know the statistics of a single directory
  30. instead of the whole disc. If the -f option is used, the disc is scanned from
  31. the root directory, regardless of 'pathname'.
  32.  
  33.  
  34. What it does (or tries to do...)
  35. --------------------------------
  36.  
  37. fsck scans the directory tree and checks the map to see if every file
  38. registered in the map actually exists in a directory. If not, it creates
  39. that file in a directory so that you will be able to delete it in the
  40. normal way. Even if you want to keep that file, you should copy it and
  41. delete the original one, because there is the risk that your map will
  42. be corrupted again if you try to change the re-linked files. Note that
  43. the re-linked files are usually longer than the original lost file
  44. because fsck always link whole sectors (and there is no way to know the
  45. original length) and that the filenames are random and filetypes always
  46. &FFF (Text).
  47. If fsck tells you that an ID is regularly allocated for another file, you
  48. have to delete it (moving the file to another directory isn't enough, you
  49. have to copy it and delete the original) and run fsck again. At the end of
  50. the scan, fsck will tell you again which files should be eventually deleted.
  51. Sometimes the disc may be so corrupted that you will need to run fsck more
  52. than once, the program itself will tell you if a re-run is needed. All these
  53. operations can be automated using the -a option. Anyway, fsck cannot
  54. automatically move directories, so you have to do it manually; furthermore,
  55. if fsck has some problems moving a file, you will be informed to do it
  56. manually.
  57.  
  58.  
  59. Notes
  60. -----
  61.  
  62. fsck is a bit slower than CheckMap (15% slower without calculating statistics
  63. or circa 2 times slower with statistics). However you can generally use fsck
  64. instead of CheckMap (with -af options) so that it will check and (eventually)
  65. fix the map. This will also give you (always, even without -s) the "Free
  66. space chunks statistics" (see below).
  67. Remember that it is better if you close all the open files on the disc that
  68. fsck is examining (ie. don't *spool on it!!). If you run fsck in a TaskWindow
  69. remember to avoid any save of data on that disc while fsck is running because
  70. this will have VERY VERY DANGEROUS consequences if you use the -f option!!!
  71. fsck has some problems with the ImageFSFix module (that is usually loaded by
  72. ArcFS or SparkFS). This module allows applications that are stored as image
  73. files to appear and behave like common applications. Unfortunately it also
  74. causes fsck to consider them as directories: usually this means that you will
  75. have some warning messages about files with SIN=0 but this can prevent fsck
  76. to properly fix the map. So, if the module is loaded, fsck will complain
  77. about it and will not run unless the -I option is specified.
  78. fsck has been tried on a RiscPC and it worked without problems (but the -f
  79. option has not been tried because the map was not corrupted, yet!). This
  80. means that (un)fortunately Acorn didn't change the file system SWIs on the
  81. new machine... I hope they fixed the bug that caused the corruptions...
  82. fsck will always (except with -q) show the "Free space chunks statistics":
  83. if your disc has a lot of small free space fragments you should try to
  84. *Compact it (even more than once if needed), because your disc is very likely
  85. to become corrupted... (see the "Can a serious filing system corrupt discs?"
  86. section to understand more on this).
  87. Using the -a option without the -f option will cause fsck to move the needed
  88. file but then fsck isn't run again (because it should be useless without -f).
  89.  
  90.  
  91. Disclaimer
  92. ----------
  93.  
  94. fsck never tries to write directly in the map but simply creates files in
  95. a directory. This means that if something goes wrong you will have a
  96. directory that contains unreadable files and (in the worst case) undeletable,
  97. but the map is not changed and the other files untouched. Anyway some
  98. serious corruptions will follow when you will start to write to the corrupted
  99. disc! I am sorry for you but I AM NOT RESPONSIBLE for any loss of data on
  100. your discs, so use fsck at your own risk. I tested it on many floppies and
  101. it worked fine, even if the disc was heavily damaged, and I finally used
  102. it on my corrupted hard disc that has been fully cured!
  103. Remember that unless you specify the -f option, fsck will not write to your
  104. disc and you are encouraged to make a backup copy of your important data
  105. before running fsck -f.
  106.  
  107.  
  108. Limitations
  109. -----------
  110.  
  111. Actually fsck can't fix broken directories (but see the elim_help file),
  112. unmapped files (ie. files that are linked in some directories but are not
  113. present in the map), map checksum errors, unchained free space, very small
  114. wasted space in map and physically damaged discs (!).
  115. If you encounter one of that problems, please contact me, I'll try to add
  116. some new features. I can be more helpful if you mail me the fsck printout (ie.
  117. use the "-l logfile" option, run it in a taskwindow, use the spool command or
  118. the redirection: "fsck ... { > filename }" or "fsck ... > filename"). Remember
  119. not to spool/redirect the output of fsck to the disc it is examining!!
  120.  
  121.  
  122. Bugs
  123. ----
  124.  
  125. Sometimes if fsck is stopped using the escape key a strange disc error is
  126. reported. This error isn't real but you are adviced to reset the computer
  127. if this will happen to avoid some dangerous consequences. Anyway, this only
  128. happened once, so don't worry about it!
  129. It seems that sometimes fsck needs to be rerun even if it doesn't advice you
  130. to do so... probably this bug has been cured now.
  131.  
  132.  
  133. Can a serious filing system corrupt discs?
  134. ------------------------------------------
  135.  
  136. Yes, it can! UNIX has his own fsck command (but it is included in the
  137. system!!!), no comment on MS-DOS please ;-), and RISC OS has his own
  138. problems too! No system will be able to survive to an unexpected power-down
  139. but RISC OS seems to corrupt discs quite regularly! :(
  140. I think, but these are only my guesses, mind you, that there is a problem
  141. in the FileCore module that prevents the auto-compaction of E-Format discs
  142. to work properly. When the compaction fails there could be a system crash,
  143. with the HD light turned on, and a map corruption. Probably the files are
  144. moved in the map but not physically, or some sectors moved over a file that
  145. has not yet moved!
  146. This could be the cause of some strange corruption on my HD (one day a
  147. sprite file was mixed with a text file!) and also of the inconsistency of
  148. the map of a lot of different people (with different HD interfaces).
  149. The fact that the auto-compaction works fine on floppies makes me think
  150. that the problem lies in the multi-zone format of hard disc but I can't
  151. be sure...
  152. One of the things I have never understood is where the auto-compact takes
  153. the memory to use for moving the file(s). It could be possible that the
  154. corruptions take place when it run out of memory...
  155. Recently I started to issue the *Compact command on my HD, because this
  156. will lower the possibility of an auto-compaction. A quite full HD seems to
  157. increase the chance of corruption, probably because if the free space is
  158. limited an auto-compaction is likely to happen.
  159. I'd like to know what you think on this subject, especially if you have
  160. different opinions or if you know the FileCore module better than me
  161. (maybe someone from Acorn?).
  162.  
  163.  
  164. Results achieved up to now
  165. --------------------------
  166.  
  167. If you run fsck on your corrupted HD, please let me know! If it wasn't able
  168. to fix it, I'll try to modify it to cope with your problem. If you want to
  169. stay anonymous tell me not to include your name (eventually send me an
  170. anonymous mail!!!).
  171.  
  172. Positive results:
  173.  1) some 800K ADFS floppy (used during development).
  174.  2) 100Mb IDE (ICS interface) partitioned in 84Mb/16Mb (both partitions
  175.     fixed). Owner: Sergio Monesi (ie. me!)
  176.  3) 100Mb IDE (ICS interface). Owner: Cristian Ghezzi
  177.  4) 314Mb SCSI (Serial Port Alpha SCSI interface). Owner: K. Bailey
  178.  5) 60Mb IDE (A4 portable). Owner: G. Castagno
  179.  6) 48Mb SCSI (Oak 16 Bit interface). Owner: A.M. Baardholt
  180.  7) 40Mb ST506. Owner: A. Goodfellow
  181.  8) 80Mb IDE (A5000). Owner: Julian Wright
  182.  9) 240Mb SCSI (HCCS 8 bit interface) partitioned in 2*120Mb. Owner: Kai
  183.     Schlichting.
  184. 10) 245Mb IDE (A5000). Owner: H. M.
  185. 11) 80Mb IDE (A5000). Owner: Mike Henry
  186. 12) 121Mb SCSI (Lingenuity SCSI interface). Owner: R. Z.
  187. 13) 100Mb SCSI (Oak interface). Owner: JP Hendrix
  188.  
  189. Probably many other discs have been fixed but their owner didn't contacted
  190. me...
  191.  
  192. Negative results:
  193.  1) Someone reported problems on his 170Mb HD but he hasn't yet mailed me
  194.     any logfile: fsck recovered only part of the lost space but the map is
  195.     still inconsistent. Anyway fsck didn't damaged his disc and was at least
  196.     able to give him back more than 1Mb of lost space!
  197.  
  198.  
  199. History
  200. -------
  201.  
  202. 1.00   First fully working version. Released only via e-mail.
  203. 1.01   Fixed a bug concerning filing system names. Added -D option. Now fsck
  204.        generally need only one run to fix a heavily corrupted disc. Added
  205.        eliminate program.
  206. 1.02   Changed again the method to check filing system names (Thanks to
  207.        Keith Bailey). Added percentages in statistics. Checks boot block
  208.        checksum and shows defect list.
  209. 1.03   Now it is possible to scan a single directory instead of the whole
  210.        disc. You can specify 'relative' pathnames (eg. @.Examples) instead
  211.        of full paths (Thanks to Julian Wright). At the end of the scan fsck
  212.        will tell you which files should be eventually deleted. Added
  213.        statistics about fragmented files and free blocks sizes. Changed the
  214.        'F's and 'D's with a rotating wheel... Added -q and -l options.
  215. 1.04   Cured a serious bug that has always been present but never caused
  216.        problems (until 1.03). Added ImageFSFix check and -I option. Now fsck
  217.        understands RISCiX partitions.
  218. 1.10   RISCiX partitions are now fully supported (ie. mapped out). First
  219.        version distributed as SHAREWARE.
  220. 1.11   Added -a option. The logfile is appended to the end of the file if it
  221.        already exists and now it contains the creation date. Great speed
  222.        increase (up to 2 times faster without -s and 5 times faster with
  223.        -s!!!). Now fsck is just 25% slower than *CheckMap (or 2 times slower
  224.        with -s)! Added the note about "Free space chunks statistics" (see
  225.        the section Notes).
  226. 1.12   Another speed improvement (just 10%)! fsck isn't yet as fast as
  227.        *CheckMap but I'm working on it ;-) Fixed a possible dangerous
  228.        behaviour of -a option. Added a warning for HD boot blocks marked as
  229.        defect. Slowed down the wheel. Added files MapExpl and StatsHelp. 
  230. 1.13   Faster again (15% with -s, 3% without)!! Now statistics are just a bit
  231.        slower than normal mode. Automatic creation of lostdir. More messages
  232.        at the end of the process that can help to understand what happened
  233.        (ie. the disc is fixed, fixable, unfixable, etc.) and more helpful
  234.        error messages (no more "Can't find 'AD::0.$': incorrect FS") if the
  235.        floppy drive is empty!
  236.  
  237.  
  238. Thanks go to:
  239. -------------
  240.  
  241. - Keith Bailey who discovered that the first 3 versions of fsck were
  242.   completely useless on his SCSI!! The 4th version finally fixed his
  243.   map problems (twice!). Thanks for the comment about the clock too! :-)
  244. - Adam Goodfellow and Atle Mjelde Baardholt for the beta-testing.
  245. - Hans Ole Rafaelsen who tried fsck on 1.6Mb floppies.
  246. - Julian Wright for his beta-testing, suggestions, PRM docs and interest.
  247. - Ernest Ong who suggested me to write a map-corruptor program to test fsck:
  248.   'eliminate' is ready, now I am working on 'corrupter' ;-)
  249. - Cristian Ghezzi who let me play with his RISCiX partitioned SCSI for a
  250.   whole day to discover some stupid fsck bug.
  251. - Andreas Schubert (Platon) who tried fsck on his RiscPC.
  252. - Kai Schlichting who said that fsck was one of the most useful 'Unix ports'
  253.   for RISC OS, a program that the Acorn world really needed. Kai has been
  254.   the first who sent me 'something' to register!
  255. - Mike Henry who has been the first who sent me some pounds to register
  256.   (actually he sent me 10 pounds instead of the 5 I ask!).
  257. - the person who spread on Internet a document describing the E-Format
  258.   structure.
  259. - Mohsen Alshayef for his !ArcTools, a very useful utility that allowed
  260.   me to search in the ROM FileCore module for some code...
  261.  
  262.  
  263. Conditions of use
  264. -----------------
  265.  
  266. fsck can only be distributed with eliminate and it's companion files.
  267. Read the !SHAREWARE file for the conditions of use and distribution of the
  268. whole package.
  269.  
  270.  
  271. I can be contacted at the following address:
  272.  
  273. Sergio Monesi
  274. Via Trento e Trieste 30
  275. 20046 Biassono (MI)
  276. Italy
  277.  
  278. E-mail address:
  279. pel0015@cdc8g5.cdc.polimi.it
  280. If you don't receive a reply (or if the message is bounced) I can also be
  281. contacted at:
  282. sergio@phantom.com
  283. or:
  284. sergio@g386bsd.first.gmd.de
  285.