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

  1. fsck (1.31) - map fixer and analyst
  2.  
  3. NOTE: this program is SHAREWARE. Read the !SHAREWARE file for more info.
  4.  
  5. fsck is a disc utility that fixes the map of an E-Format disc (hard or
  6. floppy) if it is corrupted for some obscure reason. fsck can also report
  7. some information about the way the files are allocated (such as the bytes
  8. lost because of sector boundaries) and eventually print a detailed
  9. description of the map and directories organization.
  10. fsck can also be considered as a replacement of the *CheckMap command because
  11. it is faster, less prone to crash and can give useful informations on the
  12. files allocation.
  13.  
  14.  
  15. Index
  16. -----
  17.  
  18. - Usage
  19. - What it does
  20. - The logfile
  21. - fsck and Risc PC
  22. - fsck and 'big' discs
  23. - Return values
  24. - Notes
  25. - Extra features
  26. - Disclaimer
  27. - Limitations
  28. - Bugs
  29. - Results achieved up to now
  30. - History
  31. - Credits
  32. - Conditions of use
  33. - Contacting the Author
  34.  
  35.  
  36. Usage
  37. -----
  38.  
  39. fsck [-options] [-d lostdir] [-l logfile] [pathname]
  40. Most used options:
  41.   -s   calculate statistics
  42.   -f   try to fix map if broken
  43.   -l   print the results in "logfile"
  44. Less used options:
  45.   -h   print help informations
  46.   -d   link broken part of map in directory "lostdir"
  47.   -v   print files location (-vv print also files position in zones)
  48.   -D   just display disc information recorded in the map header
  49.   -q   don't display disc information (quiet mode)
  50.   -c   produce output like *CheckMap
  51.   -m   ask the user to eventually move files instead of changing map
  52.   -n   don't try to recognise directories
  53.  
  54. The default directory where files are linked is "$.lost+found".
  55. If 'pathname' is not specified, the current disc is analysed.
  56. If 'pathname' is not a root directory (eg. ADFS::0.$.Library), fsck checks
  57. only that directory and so it cannot tell you if the map is good or broken.
  58. This could be useful if you want to know the statistics of a single directory
  59. instead of the whole disc. If the -f option is used, the disc is scanned from
  60. the root directory, regardless of 'pathname'.
  61. The -m and -n options used together cause fsck 1.20 or later to work like
  62. fsck 1.13 or earlier.
  63.  
  64.  
  65. What it does
  66. ------------
  67.  
  68. fsck scans the directory tree and checks the map to see if every file
  69. registered in the map actually exists in a directory. If not, it creates that
  70. file in a directory so that you will be able to delete it in the normal way.
  71. If the file was originally a directory, fsck tries to relink it,
  72. reconstructing the directory name and content. Even if you want to keep the
  73. relinked files or directories, you should copy them and delete the original
  74. one, because there is the risk that your map will be corrupted again,
  75. especially if you try to change them.
  76. Apart from directories and their content, the re-linked files are usually
  77. longer than the original lost file because fsck always links whole sectors
  78. (and there is no way to know the original length), their filenames are random
  79. and filetypes are always &FFF (Text).
  80.  
  81. Using the -m option, fsck could tell you that an ID is regularly allocated
  82. for another file and you have to delete it (moving the file to another
  83. directory isn't enough, you have to copy it and delete the original) and run
  84. fsck again. Without this option, fsck will change the ID in the map and
  85. rewrite it to disc. The -m option is in fact only useful if you prefer not to
  86. modify your map: anyway, remember that moving files on a corrupted disc can
  87. be quite dangerous and can eventually corrupt other parts of the disc.
  88. Sometimes the disc may be so corrupted that you will need to run fsck more
  89. than once, the program itself will tell you if a re-run is needed.
  90.  
  91.  
  92. The logfile
  93. -----------
  94.  
  95. Using the logfile (-l) option is generally really useful: if something
  96. strange happens, the author will be more helpful if he can see exactly what
  97. happened and you don't even have to try to explain what happened when you run
  98. fsck, the logfile is usually enough!
  99. The logfile contains exactly what it is printed to the screen: unless you use
  100. the -v option it will be really small (nearly 2K on a good map or nearly 10K
  101. on a quite corrupted one).
  102. You cannot save the logfile to the disc being analysed.
  103. If a file with the same name as the logfile already exists, the new data will
  104. be attached at the end of it: in this way, you can attach together two or
  105. more logfiles.
  106.  
  107.  
  108. fsck and Risc PC
  109. ----------------
  110.  
  111. fsck and CheckMap are no more equivalent on Risc PCs! In fact, Acorn changed
  112. some behaviour of the FileCore module in RISC OS 3.50 so that it can now cope
  113. with over-allocated files (ie. files that have allocated more space than they
  114. need). This sort of files on older versions of RISC OS causes CheckMap to say
  115. "Map inconsistent" and if you try to delete such files you will lose some
  116. space. On RISC OS 3.50 (or later) CheckMap no longer says "Map inconsistent"
  117. if over-allocated files are the only map problem and deleting them no longer
  118. causes lost space. Compliment Acorn!
  119. fsck still reports map corruptions in this case (on every version of RISC OS)
  120. since an over-allocated file can be considered a problem (think of a 100K
  121. file that uses up 10Mb of disc space and you will understand what I mean!).
  122. Anyway, on a Risc PC, using the -m option you are able to discover such
  123. files and you can fix the disc (assuming that your map is corrupted only
  124. because of over-allocated files) by just moving them.
  125. Remember that using the -f option fsck can cure the disc without moving any
  126. file on every version of RISC OS.
  127.  
  128.  
  129. fsck and 'big' discs
  130. --------------------
  131.  
  132. In RISC OS 3.60 Acorn included a new version of the FileCore module that
  133. supports 'big' discs (ie discs larger than 512Mb).
  134. The unregistered version of fsck (version 1.31 or later) is able to scan such
  135. discs but only the registered version will eventually allow you to fix any
  136. map corruption.
  137.  
  138.  
  139. Return values
  140. -------------
  141.  
  142. This paragraph will be interesting only for programmers who want to write a
  143. program/frontend which has to interface with fsck.
  144.  
  145. fsck returns to RISC OS a value that is 0 only if fsck was able to scan the
  146. disc and the map is good, otherwise it returns 1.
  147. fsck also sets the numeric system variable fsck$ReturnCode to a value that
  148. can be more helpful in determining why fsck failed, or 0 if the map was good.
  149. The value is formed by the following bits:
  150.  
  151. enum {
  152.   return_MAPGOOD          = 0x00000000,   /* the map is good (!) */
  153.  
  154.   return_MAP_BROKEN       = 0x00000001,   /* the map is broken, fsck -f should fix it */
  155.   return_MAP_FIXED        = 0x00000002,   /* the map was broken but has been fixed */
  156.   return_MAP_UNFIXABLE    = 0x00000004,   /* the map seems to be unfixable... */
  157.   return_ONLY_MOVE_FILES  = 0x00000008,   /* the map is corrupted but RISC OS 3.50 or later is able to fix it moving some file */
  158.   return_NEED_ELIMINATE   = 0x00000010,   /* need eliminate to fix the map */
  159.   return_NEED_HARDFIX     = 0x00000020,   /* need hardfix to fix the map */
  160.   return_NO_ACTION        = 0x00000100,   /* no useful action performed (eg. fsck -h) */
  161.   return_PARAM_ERROR      = 0x00000200,   /* bad input parameters */
  162.   return_WRONG_FS         = 0x00000400,   /* wrong file system name, disc name, number, etc. */
  163.   return_IO_ERROR         = 0x00000800,   /* error while reading/writing disc, directories, etc. */
  164.   return_MEMORY_FULL      = 0x00001000    /* not enough free memory */
  165. };
  166.  
  167. You can expect that every possible combination of these values is returned
  168. (ie. &30 means that both 'eliminate' and 'hardfix' are needed) even if
  169. generally only one error number is returned.
  170. If you are writing a 'C' program that has to call fsck you can use something
  171. like this:
  172.  
  173.  if (system("fsck ...")==0) {
  174.    /* map good */
  175.  }
  176.  else {
  177.    /* some problem occurred (not necessairily map broken!) */
  178.    /* check fsck$ReturnCode for more informations */
  179.  }
  180.  
  181. If you don't want to (or can't) check the return status you can just check
  182. the value of fsck$ReturnCode.
  183.  
  184.  
  185. Notes
  186. -----
  187.  
  188. fsck is 20-30% faster than CheckMap (actually, up to 50% faster on big and
  189. full drives!). If you really like CheckMap's output instead of fsck's one,
  190. you can use the -c option so that fsck will print the directory tree as it
  191. proceeds with the scan. You can eventually include the following alias in
  192. your boot sequence so