home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 October / PCO1097.ISO / FilesBBS / OS2 / DFS235S.ARJ / DFS235S.ZIP / DFS.DOC < prev    next >
Encoding:
Text File  |  1997-08-18  |  60.2 KB  |  1,330 lines

  1.  
  2.    Display File Systems; version 2.35 18-08-97  (c) 1994-1997; Jan van Wijk
  3.  ════════════════════════════════════════════════════════════════════════════
  4.  
  5. CONTENTS
  6. --------
  7.  Introduction, purpose of the program                                    1
  8.  Status of the program and change history                                2
  9.  Terminology used                                                        3
  10.  Summary of commands                                                     5
  11.  Command reference, general DFS commands                                 6
  12.  Command reference, HPFS specific commands                              18
  13.  Diagram of an example HPFS structure                                   22
  14.  Examples of DFS usage                                                  23
  15.  Known limitations                                                      24
  16.  Considered improvements                                                24
  17.  
  18.  
  19.  
  20.  
  21. Introduction, purpose of the program
  22. ------------------------------------
  23.  
  24.  The DFS program is a disk and filesystem browser with an emphasis on the
  25.  HPFS filesystem and disk partitioning.
  26.  It will support different file-systems besides HPFS in the near future.
  27.  
  28.  The program has been built while studying the HPFS filesystem.
  29.  It's main purpose is getting to understand the file-system as it resides
  30.  on the disk itself, in the data-structures laid down in disk-sectors.
  31.  Over time, additional logic was implemented to allow analysis of all
  32.  sorts of disk problems on HPFS volumes.
  33.  The tool has been used a few times over the past years to analyse some
  34.  real-life disk problems in a large systems-integration project.
  35.  Also it has proven very usefull in teaching others the internals of HPFS
  36.  Most of my knowledge of the file-system is based on the excellent lectures
  37.  "HPFS Internals" at the 1994, 95 and 96 ColoradOS/2 conferences by
  38.  Doug Azzarito and on peeking arround on a lot of HPFS volumes using DFS.
  39.  
  40.  Further improvements will probably be in more advanced recovery commands
  41.  and other filesystems like FAT and NTFS.
  42.  Also a port to NT itself is finished and under test right now.
  43.  
  44.  
  45. Availability
  46. ------------
  47.  
  48.  1) IBM internal: REQUEST DFS FROM NLX0093 at EAMSVM1
  49.  
  50.  2) Compuserve:   GO OS2BVEN, open Filemanagers library section;  DFS.ZIP
  51.  
  52.  3) HOBBES (WWW): ftp://hobbes.nmsu.edu/pub/os2/util/diskutil/DFSxxxS.ZIP
  53.     or shadow:    ftp://ftp.cdrom.com/pub/os2/util/diskutil/DFSxxxS.ZIP
  54.  
  55.  You can also download this and some other software and information from
  56.  my homepage at Compuserve:
  57.  
  58.                          http://ourworld.compuserve.com/homepages/jvwijk
  59.  
  60.  On special (e-mail) request a 16-bit OS/2 and tracing/debug versions and
  61.  the (beta) Win NT version are also available.
  62.  
  63.                                                                               
  64. Status of the program
  65. ---------------------
  66.  
  67.  This version of the program is free for anyone to use, it was written
  68.  in my own time using my own equipment.
  69.  
  70.  However, I would very much appreciate any feedback by e-mail or a simple
  71.  postcard to:
  72.                             ┌───────────────────┐
  73.                             │  Jan van Wijk     │
  74.                             │  Blekerstraat 83  │
  75.                             │  1315 AC  Almere  │
  76.                             │  Netherlands      │
  77.                             └───────────────────┘
  78.  
  79.  If you supply an e-mail address you will be put on the DFS mailing-list.
  80.  
  81.  
  82.  Further development depends on my own needs and feedback I receive from
  83.  other users, al work has to be done on spare time...
  84.  Improved versions of the program might be in the form of SHAREWARE.
  85.  
  86.  Suggestions and other comments regarding DFS and filesystems are welcome.
  87.  
  88.  You can reach me at my userid at CompuServe: 100603,2437 or jvwijk
  89.  
  90.                      or through the Internet: jan.van.wijk@cmg.nl
  91.                                           or: jvwijk@compuserve.com
  92.                                           or: janvw@ibm.net
  93.  
  94.  
  95.  
  96. Change History
  97. --------------
  98. 1.00  27-11-94     DHPFS initial version, hex dump super+spare blocks
  99. 1.39  20-07-95     32-bit port; Sector Lookup table; bug-fixes
  100. 1.52  13-09-95     new '/' cmd shortcut; First released version!     <== BBS
  101. 1.56  26-09-95     RUN cmd runs REXX dhpfs macro's
  102. 1.62  13-10-95     Added Free-space and inconsistency reporting
  103. 1.64  16-10-95     Cleanup for delivery on ColoradOS/2 CDROM
  104. 1.69  24-06-96     Fixed trap on non-HPFS volumes (open FAT, Enter ==> trap)
  105. 1.70  20-12-96     Update ColoradOS/2, DASD limits; REQUESTABLE (OS2FISYS forum)
  106. 1.84  14-01-97     DFS first distributed version to include partitioning info
  107. 1.87  19-01-97     Fixed MBR/EBR walk; multiple cmds using #, BM-labels in part
  108. 1.90  20-01-97     New fixroot and saveto commands for recovery actions (KULVM)
  109. 1.91  21-01-97     New fixcp command to fix CodePage reference          (KULVM)
  110. 1.96  27-01-97     Dynamic loading of REXX support
  111. 2.00  03-02-97     Removable media (NEWDASD); (part) D: cmd; invisible primary
  112. 2.01  06-02-97     CopyOutput command for REXX
  113. 2.06  16-03-97     Updated ACL support on HPFS386; Scan badsectors
  114. 2.08  25-03-97     Added cluster/bytes-per-sector knowledge for partitions
  115. 2.12  06-04-97     Added logical volume support using "DASD" type access
  116. 2.20  19-05-97     Win NT beta version; Search speedup; prio command; cleanup
  117. 2.22  28-05-97     Final preparation for other file-system support; cleanup
  118. 2.24  10-06-97     Added Img and Sim commands; date/time on dirblocks;
  119. 2.25  15-06-97     Added Wrim command; Improved lock implementation (nested)
  120. 2.27  19-06-97     Base cmd; Fixed bug in HPFS "saveto" cmd
  121. 2.28  21-06-97     Added autobase command for HPFS (find HPFS partition start)
  122. 2.29  29-06-97     Fixed Bootmgr clustersize; added Deleted Fnode/Alloc support
  123. 2.30  06-07-97     Improved 'find' syntax and functionality; Undelete support
  124. 2.31  13-07-97     Fixed case-insensitive find, '+' option; fix dirmap % error
  125. 2.32  20-07-97     Reporting & ALBLK fixes to saveto; new "ca" cmd CheckAlloc
  126. 2.33  27-07-97     Fnode & Alloc display update; minor fixes
  127. 2.35  18-08-97     Path info in Fnode display and "list" output; MEM cmd
  128.  
  129.                                                                               
  130. Terminology used
  131. ----------------
  132.  
  133.  Sector         512 bytes of data
  134.                 This is the smallest amount of data manipulated by the
  135.                 disk subsystems and is also the basic allocation-unit
  136.                 for the HPFS file-system
  137.  
  138.  CHS            Cylinder Head Sector (addressing)
  139.                 This is the classical way of addressing physical sectors
  140.                 on a disk. It is used in the PC's BIOS, in partition tables
  141.                 and in low-level disk-IO API's (IOCTL, INT-13).
  142.                 In most implementations the addressing ranges are limitted
  143.                 causing all sorts of problems with large disks/partitions.
  144.                 Example: maximum cylinder=1024 limit for BIOS/INT-13
  145.  
  146.  PSN            Physical Sector Number
  147.                 This is the zero-based, unsigned-LONG, number for a
  148.                 sector on a physical disk. Addressing on a disk using
  149.                 PSN's id often referred to as Relative Block Addressing
  150.                 (RBA) or Logical Block Addressing (LBA)
  151.  
  152.  LSN            Logical Sector Number
  153.                 This is the zero-based, unsigned-LONG, number for a
  154.                 sector on a logical partition. The partition can be seen
  155.                 as a linear sequence of sectors.
  156.  
  157.  SLT            Sector/Cluster Lookup Table
  158.                 An array of information about sectors or groups of sectors,
  159.                 containing the type of the sector(s) and the LSN of a
  160.                 directly related sector (usualy an Fnode).
  161.                 It is currently implemented for HPFS only.
  162.  
  163.  Cluster        A (small) group of adjecent sectors that are handled by the
  164.                 operating system as one allocation-unit.
  165.                 It is used on FAT filesystems to allow large partitions at
  166.                 the cost of more wasted "slack" space, and on NTFS to balance
  167.                 performance, slack-space etc.
  168.                 HPFS does not use sector-clustering (or a cluster-size of 1!)
  169.  
  170.                 DFS will try to account for clustering where needed, for
  171.                 example in size calculations and where sector/cluster pointers
  172.                 are used in the file-system internal structures.
  173.  
  174.                                                                               
  175.  
  176.  Partition      An area on a physical disk that holds a single logical
  177.                 file-system like FAT, HPFS, Boot-manager, NTFS etc.
  178.                 There is an index to find partitions in the form of a
  179.                 set of partition-tables in the MBR/EBR chain.
  180.  
  181.  MBR            Master Boot Record
  182.                 The first sector on the physical disk, located at PSN 0 =
  183.                 Cylinder 0, Head 0, Sector 1
  184.                 It contains the initial boot code called from the BIOS and
  185.                 the main partition table that holds the primary partitions
  186.                 and the start of the chain of extended boot records (EBR).
  187.  
  188.  EBR            Extended Boot Record
  189.                 It contains no boot code but only a partition table that
  190.                 holds the location of a single logical partitions.
  191.                 It usualy is located on the cylinder just before the actual
  192.                 logical partition itself, at Head 0, Sector 1.
  193.                 Each EBR will also point to the next EBR if more logical
  194.                 partitions exist on the same disk.
  195.  
  196.  Volume         A logical volume as seen by the active operating system,
  197.                 with a logical drive-letter associated to it.
  198.                 It can be either a hard-disk partition with a filesystem
  199.                 recognized and mounted by the operating system, or some
  200.                 other storage-medium like floppy disk or CD-Rom.
  201.                 Note: Network drives or other "virtual" file-systems can also
  202.                       be refered to as volumes. However, DFS will not be able
  203.                       to access them because such devices usualy cannot be
  204.                       accessed using "open volume" (DASD) methods.
  205.  
  206.  Shortname      The leading part of a filename, as contained in an HPFS fnode
  207.                 and usefull for undelete. The maximum length is 15 characters
  208.  
  209.                                                                               
  210. Summary of commands
  211. -------------------
  212.  
  213.  DFS takes commands from the keyboard and displays the results to the screen,
  214.  scrolling text upward. It can also be copied to a file for later analysis.
  215.  
  216.  The commands are single words or (hexadecimal) numbers.
  217.  Most commands have one or more parameters of wich some are optional.
  218.  
  219.  DFS keeps track of the current- and some other usefull SN's so they
  220.  can be referenced faster, without having to type them in. They are:
  221.  
  222.      Name          Cmd       Description
  223.      ----          ---       -----------
  224.      up            'u'       up in hierarchy
  225.      down          Enter     down in hierarchy
  226.      this          't'       this (current)
  227.      xtra          'x'       Extra, alternative
  228.  
  229.  You can display and analyse either a physical disk, a partition or a volume.
  230.  A physical disk can be opened using the 'disk' command.
  231.  
  232.  A logical-partition or volume needs to be opened first with the 'part' or
  233.  'vol' commands respectively. The following prompt will show some status info.
  234.  After opening an HPFS partition, using 'Enter' a few times will take you
  235.  to the superblock, root-directory, possible sub-directories upto some file.
  236.  
  237.  Multiple commands can be chained if separated with the '#' character.
  238.  
  239.  An overview of the available commands is given below, it can also be
  240.  referenced from within the program using the '?' command.
  241.  
  242.  ??               = Show active filesystem name, commands and help info
  243.  ???              = Show all recognized sector-types for current filesystem
  244.  part [dr/nr][No] = Show partitions,  or select one using nr or drive-letter
  245.  vol  [drive][No] = Show all volumes, or select one using drive-letter
  246.  im   img         = Open a file with a FS-image (.img) for display & analysis
  247.  sim  img [f [s]] = Save to FS-image, starting from LSN [f], size [s] sectors
  248.  wrim img [f [s]] = Write FS-image to disk-sectors start at LSN [f], size [s]
  249.       xx          = Analyse & display sector, SN xx; xx = 1 to 8 hexadecimals
  250.  H,h  xx   [size] = Hex-dump sector or half-sector, SN xx, s sectors or bytes
  251.  t a|h     [size] = This SN, display in Ascii/Hexadecimal, s sectors or bytes
  252.  .NNN    [listid] = Display numbered FS-entity marked .NNN from a sector list
  253.  list [listid][+] = Display LSN's in sector list, id = Dir, Alloc, Bad or Find
  254.  SLT  [type i ln] = Display SLT for sectors of 'type' at index i, ln lines
  255.  id          [xx] = Identify current or specified sector, using the SLT
  256.  f[op] [t] [str]] = Find [options] sectors of [t]ypes containing [str]
  257.       options are : * = repeat; - = backward; $ = Ign-case; @[pos] = position
  258.  Enter, u, x      = Show next with <Enter>, up with 'u' or extra LSN with 'x'
  259.  walk    [disknr] = Select a physical disk and walk the MBR/EBR chain
  260.  scan [wr [NoId]] = Scan bad-sectors; use read/Write verify; No automatic id
  261.  log       [file] = Log (append) to 'file' (.log); (No file => stop logging)
  262.  run macro        = Run a DFS macro in a REXX .cmd file
  263.  q                = Quit FS display; 2.35 18-08-97  (c) 1994-1997; Jan van Wijk
  264.  
  265.  EXTERNALS      Any command not recognized as a valid DFS internal command
  266.                 will be passed to the default command-processor (COMSPEC).
  267.                 Usefull commands: CHKDSK, CD, DIR, ...
  268.                 Note: FDISK, SETBOOT etc will not work if a physical disk
  269.                 is currently opened by DFS itself.
  270.                                                                               
  271. Command reference, general DFS commands
  272. ---------------------------------------
  273.  
  274.  
  275.  disk [nr]    = Select specified physical disk for physical addressing
  276.  
  277.  Purpose:       Select a physical disk
  278.  
  279.  Parameters:    nr      optional   Physical disk number, default is 1
  280.  
  281.  Output:        Disk Geometry and default display of sector 0 (usualy MBR)
  282.  
  283.                 The returncode (rc) will be zero for a valid disk number
  284.                 or equal to the number of disks otherwise.
  285.                 This can be usefull from REXX scripts.
  286.  
  287.  
  288.  walk [nr]    = Walk the MBR/EBR chain of partition-tables for specified disk
  289.  
  290.  Purpose:       Show all partitioning information for the specified disk
  291.  
  292.  Parameters:    nr      optional   Physical disk number, default is 1
  293.  
  294.  Output:        Disk Geometry, MBR and all linked EBR's in partition format
  295.  
  296.  
  297.  lock         = Lock physical disk, to allow writing to it (fixroot)
  298.  
  299.  Purpose:       Lock a physical disk
  300.  
  301.  Parameters:    none
  302.  
  303.  Output:        none
  304.  
  305.  
  306.  unlock       = Unlock physical disk, after writing to it (fixroot)
  307.  
  308.  Purpose:       Unlock a physical disk
  309.  
  310.  Parameters:    none
  311.  
  312.  Output:        none
  313.  
  314.                                                                               
  315.  part [i][ns] = Select specified partition, or show the list of partitions
  316.  
  317.  Purpose:       Select a disk partition for analysis
  318.  
  319.  Parameters:    i       optional   Number specifying the partition as shown
  320.                                    by the 'disks' or 'part' commands
  321.                         or   d:    Drive-letter for a partition (part C:)
  322.                         or   +     To get a verbose list
  323.                         or   !     To force a new scan of physical disks
  324.                                    If no parameter is specified the list of
  325.                                    partitions will be displayed.
  326.  
  327.                 ns      optional   Do not start SLT thread automaticaly (HPFS)
  328.                                    When specified, the SLT will be build later
  329.                                    when the 'SLT' cmd is issued to display it.
  330.  
  331.  Output:        Either the list of partitions or the default display for the
  332.                 first sector of the partition (usualy a boot-sector).
  333.  
  334.  Remarks:       The command "d:" where d is any existing drive-letter will
  335.                 be interpreted as a "part d:" command. This means that the
  336.                 C: partition can be opened just by typing "C:"
  337.  
  338.                 The returncode (rc) will be zero for a valid partition id
  339.                 or equal to the number of partitions otherwise.
  340.                 This can be usefull from REXX scripts.
  341.  
  342.                 An example of the list ouput in table form (default) is:
  343.  
  344.  Opened phys. disk : 1          Cyl: 327 H: 64 S:32            Size:   327.0 Mb
  345.  Number of physical disks found: 1
  346.  ┌──┬──┬──┬─────────────────┬────────┬────────┬───────────┬────────┬─────────┐
  347.  │id│PD│Dr│Type, description│Format  │Creator │Label Info │BM-Name │ Size Mb │
  348.  ├──┼──┼──┼─────────────────┼────────┼────────┼───────────┼────────┼─────────┤
  349.  │01│ 1│--│Prim 0a Boot Mgr │FAT     │        │«OS/2    » │        │     1.0 │
  350.  │02│ 1│C:│Prim 07 Inst. FS │HPFS    │OS2 20.0│OS2        │OS/2    │   170.0 │
  351.  │03│ 1│D:│Log  07 Inst. FS │HPFS    │OS2 20.0│OS2        │STARTUP │     5.0 │
  352.  │04│ 1│E:│Log  07 Inst. FS │HPFS    │OS2 20.0│OS2        │        │   145.0 │
  353.  │05│ 1│--│Hide fe PS/2 syst│FAT16   │IBM  5.y│6M OPEN 525│        │     6.0 │
  354.  └──┴──┴──┴─────────────────┴────────┴────────┴───────────┴────────┴─────────┘
  355.  
  356.  Number of physical disks   = The number of disks reported by the system
  357.  Opened phys disk ...       = opened disk with Cylinder, Head, Sector and Size
  358.  Part nn WARNING: ...       = Any informal, strange or alarming conditions
  359.  
  360.  Where:   id                = The selection-id used by DFS for this partition
  361.           PD                = Physical drive number; 1..max
  362.           Dr                = Drive letter, a capital plus a semicolon (C:),
  363.                               or a lowercase drive-letter for hidden partitions
  364.           Type, description = Type-info and hex value of the type, type-info:
  365.                               Prim = Primary (active, accessible)
  366.                               Hide = Hidden  (primary or special)
  367.                               Log  = Logical volume in an extended partition
  368.           Format            = The filesystem format string found in the
  369.                               bootrecord for this partition or --none--
  370.           Creator           = The OEM identification string from the bootrec
  371.                               of "fdisk" if no valid bootrecord is found
  372.           Label Info        = The volumelabel as found in the bootrecord, or
  373.                               the «BM-label» of the current Bootmgr selection
  374.                               Note: The FAT volume-label will not be shown here
  375.           BM-Name           = The name for this partition as registered in
  376.                               the OS/2 boot-manager information area's
  377.           Size Mb           = The gross size of the partition in megabytes
  378.                                                                               
  379.  vol [letter] = Select specified logical volume, or show the list of volumes
  380.  
  381.  Purpose:       Work with logical volumes including floppies and CD-rom
  382.  
  383.  Parameters:    Drive-letter for the volume
  384.  
  385.  Output:        Either the list of volumes or the default display for the
  386.                 first sector of the volume (usualy a boot-sector).
  387.  
  388.  Remarks:       Network or other "virtual" file-systems are not supported.
  389.  
  390.  
  391.  im   img         = Open a file with a FS-image (.img) for analysis
  392.  
  393.  Purpose:       Work with a saved binary image
  394.  
  395.  Parameters:    img     Filename for the image, default extention is '.img'
  396.  
  397.  Output:        The default display for the first sector of the image
  398.  
  399.  Remarks:       File-system type is derived from first (boot) sector
  400.  
  401.  
  402.  sim  img [f [s]] = Save FS-image (.img) start from LSN [f], size [s] sectors
  403.  
  404.  Purpose:       Save specified sectors as a binary image for use with 'IM'
  405.  
  406.  Parameters:    img     Filename for the image, default extention is '.img'
  407.                 f       Start LSN for save, default is 0
  408.                 s       Size of the saved image in sectors, default is 256
  409.                         '$' can be used to save all sectors of the disk/volume
  410.  
  411.  Output:        none
  412.  
  413.  Remarks:       When '.' is specified for s, sector 'f' upto 'this' is saved
  414.                 When '.' is specified for f, the start-sector is 'this'
  415.                 When '.' is specified for both, only the 'this' sector is saved
  416.  
  417.  
  418.  wrim img [f [s]] = Write FS-image to disk-sectors start at LSN [f], size [s]
  419.  
  420.  Purpose:       Write sectors back from an image to opened partition or volume
  421.  
  422.  Parameters:    img     Filename for the image, default extention is '.img'
  423.                 f       Start LSN for write, default is 0
  424.                 s       Size of the written sector area, default size of image
  425.  
  426.  Output:        none
  427.  
  428.  Remarks:       '.' can be specified for the f and s parameters, see 'sim' cmd
  429.  
  430.  
  431.  fs  fs-name [No] = Force analysis using specified file-system knowledge
  432.  
  433.  Purpose:       Use specific FS knowledge if the default is not correct
  434.  
  435.  Parameters:    fs-name File-system name, like FAT or HPFS
  436.                 No      Do not try to build SLT automatically
  437.  
  438.  Output:        none
  439.  
  440.  Remarks:       Only HPFS is realy supported at the moment, and depending on
  441.                 disk or image contents DFS might behave strangely or even trap
  442.                                                                               
  443.  
  444.  base [sn [sl]]   = Set base limits start and end values, defining partition
  445.  
  446.  Purpose:       Force a different partition start sector-nr
  447.  
  448.  Parameters:    sn      Sector-number to use as start for partition ==> LSN 0
  449.                 sl      Sector-number to use as end for partition (optional)
  450.  
  451.  Output:        none
  452.  
  453.  Remarks:       Can be used if start of partition / partition-tables are bad
  454.                 Try to find the PSN for the first sector of the partition
  455.                 and use the "base" cmd followed by an "FS xxxx" command
  456.  
  457.  
  458.  PSN  xx      = Analyse & display sector using PSN xx
  459.  
  460.  
  461.  Purpose:       Display sector using Physical Sector Number addressing
  462.  
  463.  Parameters:    xx = 1 to 8 hexadecimals
  464.  
  465.  Output:        Sector display, format selected based on sector-contents
  466.  
  467.  Remarks:       The SN is specified in hexadecimal format, however the first
  468.                 digit needs to be decimal to avoid misinterpretation.
  469.                 Prefixing the SN with '0' will avoid any conflicts.
  470.  
  471.                 Output that scrolls of the screen can be repeated using
  472.                 the 't' command. (display 'this' sector)
  473.  CHS c  h  s  = Analyse & display sector using CHS specication
  474.  
  475.  
  476.  Purpose:       Display sector using Cylinder, Head and Sector addressing
  477.  
  478.  Parameters:    c       mandatory  The zero-based decimal Cylinder number
  479.                                    Range 1 to disk-specific maximum and
  480.                                    usualy below 1024.
  481.  
  482.                 h       mandatory  The zero-based decimal Head number
  483.                                    Range 0 to disk-specific maximum but
  484.                                    never more than 255
  485.  
  486.                 s       mandatory  The one-based decimal Sector number
  487.                                    Range 1 to disk-specific maximum but
  488.                                    never more than 63
  489.  
  490.  Output:        Sector display, format selected based on sector-contents
  491.  
  492.  Remarks:       Output that scrolls of the screen can be repeated using
  493.                 the 't' command. (display 'this' sector)
  494.                                                                               
  495.  
  496.       xx      = Analyse & display sector, SN xx; xx = 1 to 8 hexadecimals
  497.  
  498.  
  499.  Purpose:       Display a sector in the most usefull format
  500.  
  501.  Parameters:    none
  502.  
  503.  Output:        Sector display, format selected based on sector-contents
  504.  
  505.  Remarks:       The SN is specified in hexadecimal format, however the first
  506.                 digit needs to be decimal to avoid misinterpretation.
  507.                 Prefixing the SN with '0' will avoid any conflicts.
  508.  
  509.                 Logical addressing (LSN) is actualy used, however when a
  510.                 physical disk is selected the offset for logical addressing
  511.                 is set to 0. The result is that LSN's equal PSN's.
  512.  
  513.                 Output that scrolls of the screen can be repeated using
  514.                 the 't' command. (display 'this' sector)
  515.  
  516.  
  517.  
  518.  H,h [xx [s]] = Hex-dump sector or half-sector, LSN xx, s sectors/bytes
  519.  
  520.  Purpose:       Display current or specified sector in hex-dump format
  521.  
  522.  Parameters:    xx      optional   LSN of sector to dump
  523.  
  524.                 s       optional   size to dump:  1..63   specifies sectors
  525.                                                  64..xxx  specifies bytes
  526.                                    Default is 512 bytes for the 'H' command
  527.                                           and 256 bytes for the 'h' command
  528.  
  529.  Output:        Hex-dump of the sector
  530.                 On every line 16 bytes of data will be displayed, each line
  531.                 containing:
  532.                   - the relative offset in the record (4 hex digits)
  533.                   - 16 bytes in hexadecimal; separator after 8 bytes
  534.                   - the same 16 bytes represented as ASCII
  535.  
  536.  Remarks:       The ASCII representation is filtered, non-printable
  537.                 characters are represented with a PERIOD character
  538.  
  539.  
  540.  
  541.  t a|h [s]    = This LSN, display in Ascii or Hex;  s sectors/bytes
  542.  
  543.  Purpose:       Display current sector in ASCII, EA, HEX or default format
  544.  
  545.  Parameters:    a|h     optional   Specifies display format as:
  546.                                       a = ASCII
  547.                                       h = HEX
  548.                                    none = default (based on sector-contents)
  549.  
  550.                 s       optional   size to dump:  1..63   specifies sectors
  551.                                                  64..xxx  specifies bytes
  552.  
  553.  Output:        Sector display in requested format
  554.  
  555.  Remarks:
  556.  
  557.                                                                               
  558.  f[op] [t] [str]] = Find [options] sectors of [t]ypes containing [str]
  559.  
  560.  Purpose:       Perform a sector search starting from the current LSN
  561.                 until a sector of the specified type and optionaly
  562.                 containing a specified ASCII/HEX string is found.
  563.  
  564.  Parameters:    op      optional   Search options, default is '+'
  565.                                    *      = automatic repeat (find all ...)
  566.                                    +      = verbose output even when repeating
  567.                                    -      = search towards lower sector numbers
  568.                                    $      = Use case-insensitive string compare
  569.                                    @[pos] = compare at sector position [pos]
  570.                                             (with type dependant defaults)
  571.  
  572.                                    Note: Use no spaces betwee 'f' and options!
  573.  
  574.                 t       optional   Types of sector wanted, default is any KNOWN
  575.                                    specify multiple types in a single string
  576.  
  577.                     DFS generic sector types
  578.                     '*' = any sector
  579.                     'r' = Master   Boot Rec    'e' = Extended Boot Rec
  580.                     'b' = Fsys boot sector     'R' = Fsys reserved sec
  581.                     '!' = any known type       'u' = Unidentified data
  582.                     '$' = Free space           '.' = <Past-partition!>
  583.  
  584.                     HPFS specific sector types
  585.                     'I' = File data            'E' = EA data
  586.                     'A' = ACL data             'B' = Boot area
  587.                     's' = HPFS superblock      'p' = HPFS spareblock
  588.                     'H' = Hotfix table         'h' = Hotfix data
  589.                     'x' = Bad sector-list      'X' = Bad sector
  590.                     'S' = Spare dirblocks      'D' = Directory fnode
  591.                     'f' = Fnode for a file     'z' = Fnode deleted
  592.                     'a' = Allocation block     'Z' = All-block deleted
  593.                     'd' = Directory block      'P' = Dir-band (free)
  594.                     'Q' = Dir-band bitmap      'c' = Codepage info
  595.                     't' = Codepage data        'i' = HPFS386 User-id
  596.                     'm' = Bitmap Tables        'M' = Bitmap data
  597.  
  598.                     For an up-to-date list, use the '???" command
  599.  
  600.                 str     optional   A string of bytes that have to be present
  601.                                    in the wanted sector.
  602.                                    When the '$' string option is not given, it
  603.                                    can be specified as a mix of ASCII and HEX.
  604.                                    The starting mode is ASCII, switching to
  605.                                    HEX and back is done with the ' character.
  606.                                    Leading whitespace is skipped, in HEX mode
  607.                                    spaces can be used to improve readability.
  608.  
  609.                         Example 1: last'0d0a'first
  610.  
  611.                                    This will search for the word "last"
  612.                                    followed by a carriage-return line-feed
  613.                                    combination and the word first
  614.  
  615.                         Example 2: 'e9bd13 0d4023 49 42 4d 3a38 2e'
  616.  
  617.                                    This will search for a byte sequence,
  618.                                    in this case the start of COMMAND.COM
  619.                                                                               
  620.  
  621.  
  622.  Output:        Sector display, format selected based on sector-contents,
  623.                 or a single line with position and type info when repeating
  624.  
  625.  
  626.  Remarks:       This command is also very usefull to find a specific fragment
  627.                 of disassembled code anywhere on the disk, to resolve the
  628.                 name of an EXE, DLL or device driver causing traps or hangs.
  629.  
  630.                 Backward search can be usefull on HPFS to find the preceding
  631.                 fnode when looking at some random file-data.
  632.                 Note: the 'id' command will do this more reliably but depends
  633.                       on the sector-lookup-table to be filled.
  634.  
  635.  
  636.  list  [id][opts] = Display LSN's in sector list, id = Dir, Alloc, Bad or Find
  637.  
  638.  Purpose:       Display one of the sector-number lists maintained by DFS
  639.  
  640.  Parameters     id      optional   Identifier for LSN list, valid values are:
  641.  
  642.                                    d = Dir,   result or dir-block display
  643.                                    b = Bad,   result of 'scan' command
  644.                                    f = Find,  result of 'f' command
  645.                                    m = Mem,   result of 'mem' commands
  646.  
  647.                 opts    optional   + = Use verbose output, one line per LSN
  648.                                    f = Incluse PATH info on Fnode LSN's on
  649.                                        verbose output (requires + too)
  650.  
  651.  Output:        List of sector numbers in compact or verbose format
  652.  
  653.  Remarks:       The default list-identifier will be set to a specific list
  654.                 each-time one of the lists is modified or listed.
  655.                 List also available for REXX in the dfs_sn. stem variable
  656.  
  657.  
  658.  mem [c #]|[lsn]  = Memory list of LSN's clear or update
  659.  
  660.  Purpose:       Add an LSN to the LSN memory list for later use with .NNN
  661.  
  662.  Parameters:    c #     optional   Clear command, limit list-size to # entries
  663.  
  664.                 lsn     optional   LSN to add to the list, special values are:
  665.                                    x, u, d, t for Xtra, Up, Down and This
  666.  
  667.  Output:        none
  668.  
  669.  Remarks:       The LSN memory can be listed using "list m" [+f]
  670.  
  671.  
  672.  .NNN        [id] = Display numbered FS-entity marked .NNN from a sector list
  673.  
  674.  Purpose:       Display one of the entries from the list last shown
  675.                 It can be applied on Directory- as well as Allocation-lists
  676.                 The number (NNN) to use is displayed to the left of the list
  677.  
  678.  Parameters:    NNN                The zero-based decimal entry number to show
  679.  
  680.                 id      optional   Identifier for LSN list (see list command)
  681.  
  682.  Output:        Sector display, format selected based on sector-contents
  683.                                                                               
  684.  
  685.  
  686.  Enter        = down in hierachy (Enter = down)
  687.  
  688.  Purpose:       Display the next, most likely wanted, sector
  689.  
  690.  Parameters:    none
  691.  
  692.  Output:        Sector display, format selected based on sector-contents
  693.  
  694.  Remarks:
  695.  
  696.  
  697.  
  698.  u            = up in hierachy
  699.  
  700.  Purpose:       Display the sector that is higher in the hierarchy (parent)
  701.  
  702.  Parameters:    none
  703.  
  704.  Output:        Sector display, format selected based on sector-contents
  705.  
  706.  
  707.  
  708.  x            = Extra LSN
  709.  
  710.  Purpose:       Display the sector marked as eXtra
  711.  
  712.  Parameters:    none
  713.  
  714.  Output:        Sector display, format selected based on sector-contents
  715.  
  716.  Remarks:
  717.                                                                               
  718.  
  719.  SLT [t i s m]   = Show SLT for 'type', at index i, size s, error-mask m
  720.  
  721.  Purpose:       Display (selection of) the Sector Lookup Table
  722.  
  723.  Parameters:    t       optional   Sector-types to include in the displayed
  724.                                    list. Default is all types ('*')
  725.                                    Types are same as specified for 'f' cmd
  726.  
  727.                 i       optional   Start index in the SLT to display
  728.  
  729.                 s       optional   Number of entries to display, default
  730.                                    will result in one screen-full
  731.  
  732.                 m       optional   Error filtering mask, * = all errors
  733.                                    4-digit Hexadecimal value, each set bit
  734.                                    will include a specific error value.
  735.  
  736.  
  737.  Output:        One line for each entry in the SLT, containing:
  738.                         LSN        Start LSN for a range of sectors
  739.                         size       Number of sectors in the range
  740.                         ref        Other sector refering to this range (fnode)
  741.                         type       Type of the sectors in the range
  742.                         error      4-digit Hexadecimal error value:
  743.  
  744.                            0x0001  Linked to some structure, but not in bitmap
  745.                            0x0002  Allocated in bitmap, but not linked
  746.                            0x0008  Fnode is a directory but DirFlag is not set
  747.                            0x0010  Fnode datalength greater than Dir-entry size
  748.                            0x0020  Fnode datalength smaller than Dir-entry size
  749.                            0x0040  Fnode datalength greater than allocated size
  750.                            0x0080  Fnode datalength smaller than allocated size
  751.  
  752.  Remarks:       Sector ranges might overlap, the smallest matching range will
  753.                 hold the best identification for a specific sector.
  754.  
  755.                 The start-index will default to the position of the sector
  756.                 last searched using the 'i' cmd.
  757.  
  758.                 If needed the SLT will be built in a background thread.
  759.  
  760.  
  761.  id [xx]      = Identify, using sector lookup table
  762.  
  763.  Purpose:       Display the type for a specific sector and one major reference
  764.  
  765.  Parameters:    xx      optional   LSN of sector to identify, default is
  766.                                    the current sector
  767.  
  768.  Output:        One line specifying corresponding SLT entry, followed by
  769.                 a line specifying the type of the sector itself and a
  770.                 sector display of the 'ref' sector, in a format based
  771.                 on sector-contents
  772.  
  773.  Remarks:       Sector ranges might overlap, the smallest matching range will
  774.                 be considered best.
  775.  
  776.                 This function is extremely usefull to relate file-data sectors
  777.                 from fragmented files to the Fnode for the file.
  778.                 It will tell you exactly to wich file a certain sector belongs.
  779.                                                                               
  780.  log       [file] = Log (append) to 'file' (.log); (No file => stop logging)
  781.  
  782.  Purpose:       Close current LOG, open new and capture DFS output in it
  783.  
  784.  Parameters:    File specification
  785.                 If no parameter is specified, logging is stopped.
  786.  
  787.  Output:        Concatenated output of DFS commands given after the
  788.                 'log' command, upto next 'log' or 'q' command.
  789.                 ANSI control characters for colors and cursor-positioning
  790.                 are not written to the logfile.
  791.  
  792.  Remarks:       There is no check on available space on the destination
  793.                 drive, file may end up empty if disk(ette) is full.
  794.                 The same logfile specification can be used more than once,
  795.                 output will be concatenated.
  796.                 On each 'log' command the current logfile will be closed.
  797.  
  798.  
  799.  trace [lvl]  = Set trace level for DFS internal functions
  800.  
  801.  Purpose:       Investigate unexpected behaviour and debug DFS
  802.  
  803.  Parameters:    lvl     optional   Trace level; 0 = no trace
  804.  
  805.  Output:        The resulting trace-level, after this the output will be
  806.                 normal output mixed with extra trace information showing
  807.                 API return-codes and DFS internal variables
  808.  
  809.  Remarks:       Only available in the special DFSTRACE.EXE version
  810.  
  811.  
  812.  prio  [lvl]  = Set relative priority of the DFS main thread
  813.  
  814.  Purpose:       Increase (search) speed with +, or decrease system impact
  815.  
  816.  Parameters:    lvl     optional   Prority level; + and ++ = high(est),
  817.                                                   - and -- = low(est)
  818.  
  819.  Output:        The resulting prio-level
  820.  
  821.  Remarks:       When running on low(est) priority in the background, DFS
  822.                 will almost come to a halt.
  823.  
  824.  q                = Quit FS display; 2.35 18-08-97  (c) 1994-1997; Jan van Wijk
  825.  
  826.  Purpose:       Exit DFS program
  827.  
  828.  Remarks:       Opened physical disk and logfile will be closed on exit
  829.                 Asynchronious running threads will be aborted.
  830.  
  831.  
  832.  cd [path]    = Change current Directory
  833.  
  834.  Purpose:       Change both the current directory and the current drive
  835.  
  836.  Parameters:    path    optional   Absolute or relative path specification
  837.  
  838.  Output:        The resulting current drive and directory
  839.  
  840.  Remarks:       '.' and '..' can be used in the relative path specification
  841.                                                                               
  842.  run mf [arg] = Run a REXX macro from DFS
  843.  
  844.  Purpose:       Execute a REXX script using the 'DFS' environment
  845.  
  846.  Parameters:    mf      mandatory  Macro file specification
  847.  
  848.                 arg     optional   Arguments to the REXX macro
  849.  
  850.  Output:        Any output from the REXX macro including (OS/2) commands
  851.                 executed from the macro.
  852.  
  853.  Remarks:       DFS commands can be issued from within the macro, this
  854.                 is the default environment (Address DFS).
  855.                 Commands for CMD.EXE must be addressed using 'Address Cmd'
  856.  
  857.                 The following REXX variables will be available after
  858.                 each executed DFS command from a macro:
  859.  
  860.                 rc            The returncode from the DFS command
  861.  
  862.                 dfs_disknr    Physical disk number currently open
  863.                 dfs_partid    Partition-id for selection with "part"
  864.                 dfs_drive     The opened drive letter, including a colon.
  865.                 dfs_afsys     The attached filesystem, like "HPFS" or "FAT"
  866.                 dfs_sect      The last retrieved sector(s), binary buffer
  867.                 dfs_type      Type of last retrieved sector, this is a string
  868.                               starting with the type-character (see 'F' cmd)
  869.                               followed by a textual description.
  870.  
  871.                 dfs_this      SN of the last retrieved sector
  872.                 dfs_down      SN of most likely sector to retrieve now
  873.                 dfs_up        SN of sector up in hierarchy
  874.                 dfs_next      SN of next in sequence
  875.                 dfs_prev      SN of previous in sequence
  876.                 dfs_down      SN of up in hierarchy
  877.  
  878.                 dfs_sn.0      Number of sector-numbers in the SN stem variable
  879.                 dfs_sn.n      nth sector-number in the SN stem variable, coming
  880.                               from DFS output for directories and allocation.
  881.                               They correspond to the '.NNN' command
  882.  
  883.                               Note: SN's are in an 8-digit Hexadecimal format
  884.  
  885.                 The number of disks and partitions can be resolved using the
  886.                 returncode (rc) from the commands "disk 0" and "part 0" or
  887.                 "part" respectively.
  888.  
  889.                 REXX is dynamically loaded, when the run-command is exectuted
  890.                 It requires REXX.DLL and REXXAPI.DLL in the libpath.
  891.  
  892.  
  893.  copyoutput [stem-name]      Copy output from last-command to REXX stem-var
  894.  
  895.  Purpose:       Allow output to be captured and processed from REXX
  896.  
  897.  Parameters:    stem    optional   name of stem variable, ending in a '.'
  898.                         default:   "dfs_output."
  899.  
  900.  Output:        none
  901.  
  902.  Remarks:       The <stem>.0 will hold the number of lines
  903.                 <stem>.1 through <stem>.n the actual cmd-output
  904.                                                                               
  905.  
  906.  scan [wr [NoId]] = Scan bad-sectors; use read/Write verify; No automatic id
  907.  
  908.  Purpose:       Identify bad sectors on a physical disk or logical volume
  909.  
  910.  Parameters:    write   optional   'w' to use full read/write/verify sequence
  911.  
  912.                 NoId    optional   'n' to disable automatic SLT lookup
  913.  
  914.  Output:        Progress indication based on sector-numbers, and one line for
  915.                 each bad-sector found, plus an SLT display of a related sector
  916.                 like the fnode, if automatic SLT display is enabled.
  917.  
  918.  Remarks:       For REXX, the dfs_sn.0 stem variable will hold the number of
  919.                 bad-sectors found and dfs_sn.1 through dfs_sn.n the actual
  920.                 bad sector numbers (can be shown with the 'list' command)
  921.  
  922.                 Without the write option, only a single 'read' will be done
  923.                 for each sector, this can be executed on a running system
  924.                 with open files on the disk/volume to be checked.
  925.  
  926.                 With the write option a "read/write-inverse/read/write-normal"
  927.                 sequence is done for each sector with contents checking.
  928.                 The contents of each sector will stay the same, so the function
  929.                 can be safely executed on formatted disks with live data.
  930.                 This sequence takes at least 4 times more time to complete
  931.                 and also, for safety, the disk will be locked. This means that
  932.                 the write option can only be used when the complete physical
  933.                 disk is not being used.
  934.  
  935.  Remarks:       Also available for REXX in the dfs_sn. stem variable
  936.  
  937.  
  938.  screen [arg] = Switch output to the screen on or off
  939.  
  940.  Purpose:       Allow output to logfile only
  941.  
  942.  Parameters:    arg     optional   'on' or 'off' to switch mode
  943.  
  944.  Output:        none
  945.  
  946.  Remarks:       The returncode (rc from REXX) will indicate the setting for
  947.                 screen output: 0 indicates screen switched on
  948.                                1 indicates screen switched off
  949.                                                                               
  950. Command reference, HPFS specific commands
  951. -----------------------------------------
  952.  
  953. Active filesystem : HPFS, specific commands are:
  954.  
  955.  alloc  [+]      = Show data-band allocation bitmaps, compact or [+] verbose
  956.  dirmap          = Show directory band allocation and usage map
  957.  bitmap [xx,s,D] = Show bitmap at LSN xx, size s, in alloc or [D]ir format
  958.  find path-spec  = Find and show file/directory specified by path-spec,
  959.                    relative to current dir, or root if starting with '\'
  960.  \path-spec      = find and show file/directory relative to root
  961.  path     [n]    = Show all path-components for current fnode, upto root
  962.  autobase [t][l] = find the start of an HPFS partition by searching sectors
  963.                    of types [t], default 'spad'; [l] is last valid sector
  964.  findroot [n]    = find the Root directory without using the superblock
  965.                    starting the search at LSN [n]
  966.  fixroot         = Update superblock with found LSN for root-directory
  967.  fixcp           = Update superblock with found LSN for codepage info
  968.  saveto [dir][l] = Save filedata connected to (current) fnode to a file
  969.  ca   [lsn][opt] = Check Allocation for (current) fnode lsn
  970.  
  971.  For an up-to-date list of commands, use the '??' command
  972.  
  973.  
  974.  
  975.  
  976.  autobase [t][l] = find the start of an HPFS partition by searching sectors
  977.  
  978.  Purpose:       Force a different partition start sector-nr for HPFS partition
  979.  
  980.  Parameters:    t       One or more sector-types to use in the search
  981.                         default is "spad", Super, Spare, Alloc and Dirblock
  982.                         f for fnode can also be used but is less reliable
  983.                 sl      Sector-number to use as end for partition (optional)
  984.  
  985.  Output:        Search progress and finel result when HPFS partition found
  986.  
  987.  Remarks:       Can be used if start of partition / partition-tables are bad
  988.                 Use the "fs hpfs" command first!
  989.                                                                               
  990.  
  991.  
  992.  alloc  [+]      = Show data-band allocation bitmaps, compact or [+] verbose
  993.  
  994.  Purpose:       Show usage and the distribution of data over the volume.
  995.  
  996.  Parameters:    none
  997.  
  998.  Output:        A single bitmap-graphic for the entire volume or for each
  999.                 allocation-band when verbose format is selected
  1000.  
  1001.  Remarks:       System-reserved and Directory-band are indicated with 'S'
  1002.                 and 'R' respectively. Other area's are filled in according
  1003.                 to the degree of usage (allocation)
  1004.  
  1005.  
  1006.  dirmap          = Show directory band allocation and usage map
  1007.  
  1008.  Purpose:       Show usage of the pre-allocated directory-band
  1009.  
  1010.  Parameters:    none
  1011.  
  1012.  Output:        A single bitmap-graphic showing the allocation of the
  1013.                 pre-allocated directory band.
  1014.  
  1015.  Remarks:       If 100% is allocated more directory information will be
  1016.                 allocated elsewhere on the volume.
  1017.  
  1018.  bitmap [xx s D] = Show bitmap at LSN xx, size s, in alloc or [D]ir format
  1019.  
  1020.  Purpose:       Show a bitmape located at specified LSN, alloc or DIR format
  1021.  
  1022.  Parameters:    xx      mandatory  LSN of a bitmap sector
  1023.  
  1024.                 s       optional   size to dump:  1..63   specifies sectors
  1025.                                                  64..xxx  specifies bytes
  1026.                                    Default is 4 sectors (default bitmap size)
  1027.  
  1028.                 D       optional   Directory-format flag
  1029.  
  1030.  Output:        One bitmap-graphic for the specified bitmap LSN.
  1031.  
  1032.  Remarks:       Specifying an LSN that is not a bitmap-LSN will result in
  1033.                 a garbage bitmap display.
  1034.                                                                               
  1035.  
  1036.  \path-spec      = find and show file/directory specified by path-spec
  1037.  
  1038.  Purpose:       Locate the fnode for a known file- or directory
  1039.  
  1040.  Parameters:    path-spec          full path specification with no intervening
  1041.                                    space after the '\' command character
  1042.  
  1043.                               or   absolute- or relative path specification
  1044.                                    with an intervening space. If the path
  1045.                                    does not start with a '\' it is relative
  1046.                                    to the current directory (see CD cmd).
  1047.  
  1048.  Output:        Searchlist starting at the ROOT directory upto the requested
  1049.                 file or directory. It is either followed by an error message
  1050.                 if the path-spec was not found or by the display of the
  1051.                 corresponding fnode information.
  1052.  
  1053.  Remarks:       The search algorithm depends on the ROOT fnode being known.
  1054.                 When the superblock is corrupt this fnode can be resolved
  1055.                 using the 'findroot' command.
  1056.  
  1057.  
  1058.  
  1059.  path     [n]    = Show all path-components for current fnode, upto root
  1060.  
  1061.  Purpose:       Show the directory-branch that contains current file/dir
  1062.  
  1063.  Parameters:    n           optional   Start LSN for the search
  1064.  
  1065.  Output:        One line for each found 'parent' directory, upto the root
  1066.  
  1067.  Remarks:
  1068.  
  1069.  
  1070.  ca   [lsn][opt] = Check Allocation for (current) fnode lsn
  1071.  
  1072.  Purpose:       Check allocation integrity for current fnode
  1073.  
  1074.  Parameters:    lsn         optional   LSN of the fnode
  1075.                 opt         optional   Options:  v   = Verbose, show progress
  1076.  
  1077.  Output:        Σ           Start of an allocation-sector (heavily fragmented)
  1078.                 »           Start of one file-extent (fragmented file)
  1079.                 ·           One sector, green small dot is allocation OK
  1080.                 ■           One sector, red big dot is allocation error
  1081.  
  1082.                 Also a summary is given with the number of (failed) sectors
  1083.  
  1084.  Remarks:       Fnode maybe for a regular file (sectors must be ALLOCATED)
  1085.                 or for a deleted file (sectors must be FREE)
  1086.  
  1087.                                                                               
  1088.  findroot [n]    = find the Root directory without using the superblock
  1089.  
  1090.  Purpose:       Find the fnode for the ROOT directory, even if parts of
  1091.                 the volume, including the superblock, are damaged.
  1092.  
  1093.  Parameters:    n           optional   Start LSN for the search
  1094.  
  1095.  Output:        Search-list starting at the first fnode encountered upto
  1096.                 the fnode for the ROOT directory when found.
  1097.  
  1098.  Remarks:       Specifying a startlsn might be needed if reading at the
  1099.                 start of the volume results in device errors, or if some
  1100.                 fnodes in the sequence are corrupted.
  1101.  
  1102.  
  1103.  fixroot         = Write the root-LSN found with the 'findroot' command back
  1104.  
  1105.  Purpose:       Fix bad Root-LSN pointer, caused by CHKDSK bugs or
  1106.                 other corruption
  1107.  
  1108.  Parameters:    none
  1109.  
  1110.  Output:        none
  1111.  
  1112.  Remarks:       It is better to lock the physical before writing to it
  1113.                 See 'lock' and 'unlock' commands
  1114.  
  1115.  
  1116.  fixcp           = Write the CodePage-LSN found with the '0#f c' command back
  1117.  
  1118.  Purpose:       Fix bad CodePage-LSN pointer, caused by CHKDSK bugs or
  1119.                 other corruption
  1120.  
  1121.  Parameters:    none
  1122.  
  1123.  Output:        none
  1124.  
  1125.  Remarks:       It is better to lock the physical before writing to it
  1126.                 See 'lock' and 'unlock' commands
  1127.  
  1128.  
  1129.  saveto [dir][l] = Save filedata connected to (current) fnode to a file
  1130.  
  1131.  Purpose:       Recover a file if the fnode can still be found, by making
  1132.                 a low-level sector-by-sector copy of its data to a new file.
  1133.                 (basic functionality to be used for undelete operations)
  1134.  
  1135.  Parameters:    dir         optional   Path to save the file copy (existing!)
  1136.  
  1137.                 l           optional   LSN of the fnode of the file to recover
  1138.                                        default is the current LSN (This)
  1139.  
  1140.  Output:        Progress is reported with output like the "ca" command,
  1141.                 error messages will be given as appropriate
  1142.  
  1143.  Remarks:       Only the file contents is recovered, date&time, attributes
  1144.                 and extended attributes are lost.
  1145.  
  1146.                 If no directory is specified it will default to the last
  1147.                 directory given, or "A:" when it is the first time
  1148.                                                                               
  1149. Diagram of an example HPFS structure
  1150.  
  1151.  Basic HPFS data-structure for Root-directory with AUTOEXEC.BAT, README file,
  1152.  an OS2 subdirectory and lots of other files. The README file has it's data
  1153.  allocated in 2 alloc-chunks.
  1154.  
  1155.  ╔═════════╗                  ╔══════════════════╗       ╔═══════╗
  1156.  ║SUPER    ║              ┌──>║ DIR block        ║   ┌──>║ FNODE ║
  1157.  ║         ║              │   ║                  ║   │   ║       ║
  1158.  ║         ║    ╔═══════╗ │   ║┌────────────────┐║   │   ║       ║  ╔══════════
  1159.  ║Root LSN ────>║ FNODE ║ │   ║│*Special**Start*│║   │   ║ ALLOC ──>║ DIR block
  1160.  ╚═════════╝    ║       ║ │   ║│entry FNODE  LSN│║   │   ╚═══════╝  ║
  1161.                 ║       ║ │   ║│BtreeDownPtr LSN│║   │              ║┌─────────
  1162.                 ║ ALLOC ──┘   ║└────────────────┘║   │              ║│8514.RC
  1163.                 ╚═══════╝     ║┌────────────────┐║   │              ║│entry FNO
  1164.                               ║│OS2 (subdir)    │║   │              ║│BtreeDown
  1165.                               ║│entry FNODE  LSN├────┘              ║└─────────
  1166.  ┌─────────────────────────────┤BtreeDownPtr LSN│║                  ║┌─────────
  1167.  │                            ║└────────────────┘║                  ║│ANSI.EXE
  1168.  │                            ║┌────────────────┐║
  1169.  │                            ║│Special-end     │║
  1170.  │  ╔══════════════════╗      ║│entry FNODE  LSN│║       ╔══════════════════╗
  1171.  └─>║ DIR block        ║      ║│BtreeDownPtr LSN├───────>║ DIR block        ║
  1172.     ║┌────────────────┐║      ║└────────────────┘║       ║┌────────────────┐║
  1173.     ║│*Special**Start*│║      ╚══════════════════╝       ║│*Special**Start*│║
  1174.     ║│entry FNODE  LSN│║                                 ║│entry FNODE  LSN│║
  1175.     ║│BtreeDownPtr LSN│║     ╔═══════╗                   ║│BtreeDownPtr LSN│║
  1176.     ║└────────────────┘║  ┌─>║ FNODE ║                   ║└────────────────┘║
  1177.     ║┌────────────────┐║  │  ║       ║                   ║┌────────────────┐║
  1178.     ║│AUTOEXEC.BAT    │║  │  ║       ║  ╔═══════════     ║│PP... filename  │║
  1179.     ║│entry FNODE  LSN├───┘  ║ ALLOC ──>║┌──────────     ║│entry FNODE  LSN│║
  1180.     ║│BtreeDownPtr LSN│║     ╚═══════╝  ║│ 1st data-     ║│BtreeDownPtr LSN│║
  1181.     ║└────────────────┘║                ║└──────────     ║└────────────────┘║
  1182.     ║┌────────────────┐║                                 ║┌────────────────┐║
  1183.     ║│OS1.. filename  │║                                 ║│README filename │║
  1184.     ║│entry FNODE  LSN│║      ┌───────────────────────────┤entry FNODE  LSN│║
  1185.     ║│BtreeDownPtr LSN│║      │                          ║│BtreeDownPtr LSN│║
  1186.     ║└────────────────┘║      │                          ║└────────────────┘║
  1187.     ║┌────────────────┐║      │                          ║┌────────────────┐║
  1188.     ║│**Special**End**│║      │                          ║│XXX... filename │║
  1189.     ║│entry FNODE  LSN│║      │                          ║│entry FNODE  LSN│║
  1190.     ║│BtreeDownPtr LSN│║      │                          ║│BtreeDownPtr LSN│║
  1191.     ║└────────────────┘║      │                          ║└────────────────┘║
  1192.     ╚══════════════════╝      │                          ║┌────────────────┐║
  1193.                               │                          ║│**Special**End**│║
  1194.                               │                          ║│entry FNODE  LSN│║
  1195.                               │                          ║│BtreeDownPtr LSN│║
  1196.                               │                          ║└────────────────┘║
  1197.                               │                          ╚══════════════════╝
  1198.                               │
  1199.                               │                    ╔════════════════════════╗
  1200.                               │               ┌───>║┌──────────────────────┐║
  1201.                               │               │    ║│ 1st data-sector      │║
  1202.                               │               │    ║└──────────────────────┘║
  1203.                               │               │    ║┌──────────────────────┐║
  1204.                               │  ╔═══════╗    │    ║│ 2nd data-sector      │║
  1205.                               └─>║ FNODE ║    │    ║└──────────────────────┘║
  1206.                                  ║       ║    │    ╚════════════════════════╝
  1207.                                  ║       ─────┘
  1208.                                  ║ ALLOC ║         ╔════════════════════════╗
  1209.                                  ║       ─────────>║┌──────────────────────┐║
  1210.                                  ╚═══════╝         ║│ 3rd data-sector      │║
  1211.                                                    ║└──────────────────────┘║
  1212.     (c) 1995                                       ║┌──────────────────────┐║
  1213.     J. v. Wijk                                     ║│ 4th data-
  1214.                                                                               
  1215.  
  1216. Examples of DFS usage
  1217. ---------------------
  1218.  
  1219.  1) Resolve original name of FILExxxx.CHK files (created by CHKDSK)
  1220.  
  1221.     When CHKDSK recovers files it will place in a FOUND.xxx directory in
  1222.     the root-directory. This directory contains one or more recovered files
  1223.     with names like FILE0001.CHK
  1224.  
  1225.     The original name of the file is still in the Fnode, it can be shown
  1226.     using the following dhpfs commands (assuming drive c:) :
  1227.  
  1228.     Command                            Explanation
  1229.  
  1230.     DFS disks                          Start DFS and scan physical disks
  1231.     part id                            Select partition 'id' (must be HPFS)
  1232.     \found.000\file0001.chk            Search and display Fnode for .CHK
  1233.  
  1234.     Now 15 characters of the original name are shown as "Fnode Name String"
  1235.  
  1236.  2) Show freespace area's (HPFS)
  1237.  
  1238.     slt $
  1239.  
  1240.  3) Undelete a file; Find the fnode using:
  1241.  
  1242.       "f z"               find the next deleted fnode
  1243.       "f z   shortname"   next deleted named shortname (case-sensitive)
  1244.       "f$@ z shortname"   next deleted named shortname (case-insensitive)
  1245.  
  1246.       Add a '*' to the find command to do a repeated search (see 'f' command)
  1247.  
  1248.     Then use the "saveto path" command to copy the data for the deleted
  1249.     file to a directory.
  1250.  
  1251.     Notes: - It's best to use a different drive to avoid overwriting
  1252.  
  1253.  4) Save and restore (parts of) a disk
  1254.  
  1255.     The "sim" command can be used to save a complete disk, including partition
  1256.     information to one (very large!) file on a different (network) drive.
  1257.     The save the entire unit (opened disk/partition or volume) use:
  1258.     "sim img-name 0 $"
  1259.  
  1260.     It can be restored using the "wrim" command, if and only if the destination
  1261.     disk has exactly the same geometry as the source disk (heads, sectors cyl).
  1262.  
  1263.     This could be used to clone one workstation to multiple machines.
  1264.  
  1265.  
  1266.  4) List all "undeletable" files
  1267.  
  1268.     Find the FNODES for possibly deleted files using
  1269.  
  1270.       "f* z" or for specific files:  "f*$@ z shortname"
  1271.  
  1272.     Now list them, including PATH and recovery reliability using:
  1273.  
  1274.       "list f+f"
  1275.                                                                               
  1276.  
  1277. Known limitations and bugs
  1278. --------------------------
  1279.  
  1280. - There is no real support for FAT, NTFS yet besides basic recognition.
  1281.  
  1282. - saveto only save the basic file-data, no extended attributes yet
  1283.  
  1284.  
  1285.  
  1286. Considered improvements
  1287. -----------------------
  1288.  
  1289.  Automatic detection of inconsistencies (like CHKDSK, FST, HVA and CHKPART)
  1290.  
  1291.    This will show HPFS problems like CHKDSK does, but in more detail and
  1292.    maybe some more types of inconsistencies.
  1293.    Note: Basic HPFS functionality implemented in version 1.62
  1294.          Some partitioning errors implemented in version 1.82
  1295.  
  1296.  
  1297.  Real coverage of other file-systems besides HPFS like FAT, LINUX, NTFS ...
  1298.    The code has been prepared for other file-systems in version 2.21
  1299.  
  1300.  Graphical User Interface
  1301.  
  1302.    This could make the program easier to use, however it also makes
  1303.    the program requirements less attractive becaus it uses PM/WPS
  1304.    or WINxx and makes porting more difficult.
  1305.    A command-line version will allways be available to allow operation
  1306.    from a minimal (diskette) system.
  1307.  
  1308.  
  1309.  Write capability,
  1310.  
  1311.    This will allow recovery operations without using other (third-party)
  1312.    utilities. This will require locking the entire disk so usage is
  1313.    often limited to diskette BOOT.
  1314.  
  1315.    Note: Some write enabled commands have been implemented starting with 1.90
  1316.          Improved volume/disk locking implemented in version 2.25
  1317.  
  1318.  
  1319.  Update of HPFS internal bad-sector list after a DFS 'scan' command
  1320.  
  1321.    This is a low-priority item, disks with many bad-sectors are doomed anyway
  1322.  
  1323.  
  1324.  Recovery for deleted files (undelete), basics implemented in 2.30
  1325.  
  1326.  Recovery for a 'quick format' on HPFS (unformat)
  1327.  
  1328.  Recovery for repartitioning (un-fdisk)
  1329.  
  1330.