home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1998 February / PCOnline_02_1998.iso / filesbbs / os2 / dfs253s.arj / DFS253S.ZIP / DFS.DOC < prev    next >
Encoding:
Text File  |  1997-12-07  |  81.8 KB  |  1,827 lines

  1.  
  2.    Display File Systems; version 2.52 07-12-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, FAT  specific commands                              22
  13.  Command reference, NTFS specific commands                              23
  14.  Command reference, HPFS specific commands                              24
  15.  Diagram of an example HPFS structure                                   30
  16.  Examples of DFS usage                                                  31
  17.  Known limitations                                                      33
  18.  Considered improvements                                                34
  19.  
  20.  
  21.  
  22.  
  23. Introduction, purpose of the program
  24. ------------------------------------
  25.  
  26.  The DFS program is a disk and filesystem browser with an emphasis on the
  27.  HPFS filesystem and disk partitioning.
  28.  It will support different file-systems besides HPFS sometime in the future.
  29.  
  30.  The program has been built while studying the HPFS filesystem.
  31.  It's main purpose is getting to understand the file-system as it resides
  32.  on the disk itself, in the data-structures laid down in disk-sectors.
  33.  Over time, additional logic was implemented to allow analysis of all
  34.  sorts of disk problems on HPFS volumes.
  35.  The tool has been used a few times over the past years to analyse some
  36.  real-life disk problems in a large systems-integration project.
  37.  Also it has proven very usefull in teaching others the internals of HPFS
  38.  Most of my knowledge of the file-system is based on the excellent lectures
  39.  "HPFS Internals" at the 1994, 95 and 96 ColoradOS/2 conferences by
  40.  Doug Azzarito and on peeking arround on a lot of HPFS volumes using DFS.
  41.  
  42.  Further improvements will probably be in more advanced recovery commands
  43.  and other filesystems like FAT and NTFS.
  44.  Also a port to NT itself is finished and under test right now.
  45.  
  46.  
  47. Availability
  48. ------------
  49.  
  50.  1) IBM internal: REQUEST DFS FROM NLX0093 at EAMSVM1
  51.  
  52.  2) Compuserve:   GO OS2BVEN, open Filemanagers library section;  DFS.ZIP
  53.  
  54.  3) HOBBES (WWW): ftp://hobbes.nmsu.edu/pub/os2/util/diskutil/DFSxxxS.ZIP
  55.     or shadow:    ftp://ftp.cdrom.com/pub/os2/util/diskutil/DFSxxxS.ZIP
  56.  
  57.  
  58.  On special (e-mail) request a 16-bit OS/2, tracing/debug versions and
  59.  the (beta) Win NT version are also available.
  60.  
  61.                                                                               
  62. Status of the program
  63. ---------------------
  64.  
  65.  This version of the program is free for anyone to use, it was written
  66.  in my own time using my own equipment. However, I would very much
  67.  appreciate any feedback by e-mail or a simple postcard to:
  68.  
  69.                       ┌───────────────────┐
  70.                       │  Jan van Wijk     │
  71.                       │  Blekerstraat 83  │
  72.                       │  1315 AC  Almere  │
  73.                       │  Netherlands      │
  74.                       └───────────────────┘
  75.  
  76.  If you supply an e-mail address you will be put on the DFS mailing-list.
  77.  Further development depends on my own needs and feedback I receive from
  78.  other users, al work has to be done on spare time...
  79.  Improved versions of the program might be in the form of SHAREWARE.
  80.  
  81.  Suggestions and other comments regarding DFS and filesystems are welcome.
  82.  
  83.  You can reach me at my userid at CompuServe: 100603,2437 or jvwijk
  84.  
  85.                      or through the Internet: janvw@ibm.net
  86.                                           or: jan.van.wijk@cmg.nl
  87.                                           or: jvwijk@compuserve.com
  88. Change History
  89. --------------
  90. 1.00  27-11-94     DHPFS initial version, hex dump super+spare blocks
  91. 1.39  20-07-95     32-bit port; Sector Lookup table; bug-fixes
  92. 1.52  13-09-95     new '/' cmd shortcut; First released version!     <== BBS
  93. 1.56  26-09-95     RUN cmd runs REXX dhpfs macro's
  94. 1.62  13-10-95     Added Free-space and inconsistency reporting
  95. 1.64  16-10-95     Cleanup for delivery on ColoradOS/2 CDROM
  96. 1.70  20-12-96     Update ColoradOS/2, DASD limits; REQUESTABLE (OS2FISYS forum)
  97. 1.84  14-01-97     DFS first distributed version to include partitioning info
  98. 1.87  19-01-97     Fixed MBR/EBR walk; multiple cmds using #, BM-labels in part
  99. 1.91  21-01-97     New fixroot, fixcp and saveto commands for recovery actions
  100. 1.96  27-01-97     Dynamic loading of REXX support
  101. 2.00  03-02-97     Removable media (NEWDASD); (part) D: cmd; invisible primary
  102. 2.01  06-02-97     CopyOutput command for REXX
  103. 2.06  16-03-97     Updated ACL support on HPFS386; Scan badsectors
  104. 2.08  25-03-97     Added cluster/bytes-per-sector knowledge for partitions
  105. 2.12  06-04-97     Added logical volume support using "DASD" type access
  106. 2.20  19-05-97     Win NT beta version; Search speedup; prio command; cleanup
  107. 2.22  28-05-97     Final preparation for other file-system support; cleanup
  108. 2.24  10-06-97     Added Img and Sim commands; date/time on dirblocks;
  109. 2.25  15-06-97     Added Wrim command; Improved lock implementation (nested)
  110. 2.27  19-06-97     Base cmd; Fixed bug in HPFS "saveto" cmd
  111. 2.28  21-06-97     Added autobase command for HPFS (find HPFS partition start)
  112. 2.29  29-06-97     Fixed Bootmgr clustersize; added Deleted Fnode/Alloc support
  113. 2.30  06-07-97     Improved 'find' syntax and functionality; Undelete support
  114. 2.31  13-07-97     Fixed case-insensitive find, '+' option; fix dirmap % error
  115. 2.32  20-07-97     Reporting & ALBLK fixes to saveto; new "ca" cmd CheckAlloc
  116. 2.33  27-07-97     Fnode & Alloc display update; minor fixes
  117. 2.35  18-08-97     Path info in Fnode display and "list" output; MEM cmd
  118. 2.37  24-08-97     Path display on find Fnode; Wildcard select on list +f
  119. 2.40  06-09-97     import/export of LSN lists; getbs/fixbs badsector mgmt
  120. 2.41  12-10-97     Multiple file UNDELETE with delfind/delshow/delsave cmds
  121. 2.42  18-10-97     Support for EA's in "saveto" and delsave cmds
  122. 2.43  28-10-97     Support for undelete of directories including EA's
  123. 2.47  11-11-97     Updated SLT error display; new check cmd (chkdsk); +/- cmd
  124. 2.49  16-11-97     No limit on nr of bad-sectors; sort cmd; sep cmd
  125. 2.50  24-11-97     HPFS checksum management; cs, edit and write cmd
  126. 2.51  30-11-97     More... help; fix checksum super; fix freespace reporting
  127. 2.52  07-12-97     check spare/super; BPB display; Specific FAT & NTFS commands
  128.                                                                               
  129. Terminology used
  130. ----------------
  131.  
  132.  Sector         512 bytes of data (although other sizes exist!)
  133.                 This is the smallest amount of data manipulated by the
  134.                 disk subsystems and is also the basic allocation-unit
  135.                 for the HPFS file-system
  136.  
  137.  CHS            Cylinder Head Sector (addressing)
  138.                 This is the classical way of addressing physical sectors
  139.                 on a disk. It is used in the PC's BIOS, in partition tables
  140.                 and in low-level disk-IO API's (IOCTL, INT-13).
  141.                 In most implementations the addressing ranges are limitted
  142.                 causing all sorts of problems with large disks/partitions.
  143.                 Example: maximum cylinder=1024 limit for BIOS/INT-13
  144.  
  145.  PSN            Physical Sector Number
  146.                 This is the zero-based, unsigned-LONG, number for a
  147.                 sector on a physical disk. Addressing on a disk using
  148.                 PSN's id often refered to as Relative Block Addressing
  149.                 (RBA) or Logical Block Addressing (LBA)
  150.  
  151.  LSN            Logical Sector Number
  152.                 This is the zero-based, unsigned-LONG, number for a
  153.                 sector on a logical partition. The partition can be seen
  154.                 as a linear sequence of sectors.
  155.  
  156.  LSN-list       An internal list of LSN's maintained by DFS for search-results,
  157.                 Directory-contents, Bad-sectors and generic LSN 'memory'.
  158.  
  159.  SLT            Sector/Cluster Lookup Table
  160.                 An array of information about sectors or groups of sectors,
  161.                 containing the type of the sector(s) and the LSN of a
  162.                 directly related sector (usualy an Fnode).
  163.                 It is currently implemented for HPFS only.
  164.  
  165.  Cluster        A (small) group of adjecent sectors that are handled by the
  166.                 operating system as one allocation-unit.
  167.                 It is used on FAT filesystems to allow large partitions at
  168.                 the cost of more wasted "slack" space, and on NTFS to balance
  169.                 performance, slack-space etc.
  170.                 HPFS does not use sector-clustering (or a cluster-size of 1!)
  171.  
  172.                 DFS will try to account for clustering where needed, for
  173.                 example in size calculations and where sector/cluster pointers
  174.                 are used in the file-system internal structures.
  175.  
  176.                                                                               
  177.  
  178.  Partition      An area on a physical disk that holds a single logical
  179.                 file-system like FAT, HPFS, Boot-manager, NTFS etc.
  180.                 There is an index to find partitions in the form of a
  181.                 set of partition-tables in the MBR/EBR chain.
  182.  
  183.  MBR            Master Boot Record
  184.                 The first sector on the physical disk, located at PSN 0 =
  185.                 Cylinder 0, Head 0, Sector 1
  186.                 It contains the initial boot code called from the BIOS and
  187.                 the main partition table that holds the primary partitions
  188.                 and the start of the chain of extended boot records (EBR).
  189.  
  190.  EBR            Extended Boot Record
  191.                 It contains no boot code but only a partition table that
  192.                 holds the location of a single logical partitions.
  193.                 It usualy is located on the cylinder just before the actual
  194.                 logical partition itself, at Head 0, Sector 1.
  195.                 Each EBR will also point to the next EBR if more logical
  196.                 partitions exist on the same disk.
  197.  
  198.  Volume         A logical volume as seen by the active operating system,
  199.                 with a logical drive-letter associated to it.
  200.                 It can be either a hard-disk partition with a filesystem
  201.                 recognized and mounted by the operating system, or some
  202.                 other storage-medium like floppy disk or CD-Rom.
  203.                 Note: Network drives or other "virtual" file-systems can also
  204.                       be refered to as volumes. However, DFS will not be able
  205.                       to access them because such devices usualy cannot be
  206.                       accessed using "open volume" (DASD) methods.
  207.  
  208.  Shortname      The leading part of a filename, as contained in an HPFS fnode
  209.                 and usefull for undelete. The maximum length is 15 characters
  210.  
  211.                                                                               
  212. Summary of commands
  213. -------------------
  214.  
  215.  DFS takes commands from the keyboard and displays the results to the screen,
  216.  scrolling text upward. It can also be copied to a file for later analysis.
  217.  
  218.  The commands are single words or (hexadecimal) numbers.
  219.  Most commands have one or more parameters of wich some are optional.
  220.  
  221.  DFS keeps track of the current- and some other usefull SN's so they
  222.  can be referenced faster, without having to type them in. They are:
  223.  
  224.      Name          Cmd       Description
  225.      ----          ---       -----------
  226.      up            'u'       up in hierarchy
  227.      down          Enter     down in hierarchy
  228.      this          't'       this (current)
  229.      xtra          'x'       Extra, alternative
  230.  
  231.  You can display and analyse either a physical disk, a partition or a volume.
  232.  A physical disk can be opened using the 'disk' command.
  233.  
  234.  A logical-partition or volume needs to be opened first with the 'part' or
  235.  'vol' commands respectively. The following prompt will show some status info.
  236.  After opening an HPFS partition, using 'Enter' a few times will take you
  237.  to the superblock, root-directory, possible sub-directories upto some file.
  238.  
  239.  Multiple commands can be chained if separated with a special character,
  240.  the default is '#' but this can be changed with the 'sep' command.
  241.  
  242.  An overview of the available commands is given below, it can also be
  243.  referenced from within the program using the '?' command.
  244.  
  245.       xx          = Analyse & display sector, SN xx using logical sector-number
  246.  .NNN        [id] = Display numbered FS-entity marked .NNN from a sector list
  247.  <Enter>, u, x    = Show next with <Enter>, up with 'u' or extra LSN with 'x'
  248.  ?            [*] = Show list of generic commands with short description
  249.  ??           [*] = Show active filesystem name, commands and help info
  250.  ???              = Show all recognized sector-types for current filesystem
  251.  base   [sn [sl]] = Set base limits start and end values, defining partition
  252.  cd        [path] = Change current directory an current drive
  253.  check   [dr/nr]  = Report all detected file-system errors using SLT info
  254.  chs c  h  s      = Analyse & display sector, using CHS (cylinder head sector)
  255.  disk    [disknr] = Select a physical disk and show the master boot record
  256.  export  [id][fn] = Export  LSN's in sector list [id], to   file [fn]
  257.  f[op] [t] [str]] = Find [options] sectors of [t]ypes containing [str]
  258.       options are : * = repeat; - = backward; $ = Ign-case; @[pos] = position
  259.  fs    fsys-name  = Force analysis mode for filesystem 'fsys-name'
  260.  help         [*] = Show list of generic commands with short description
  261.  h,H  xx   [size] = Hex-dump sector or half-sector, SN xx, s sectors or bytes
  262.  id          [xx] = Identify current or specified sector, using the SLT
  263.  im   img         = Open a file with a FS-image (.img) for display & analysis
  264.  import  [id][fn] = Import  LSN's to sector list [id], from file [fn]
  265.  list [id+op] [w] = Display LSN's in sector list [id], using options/wildcard
  266.  lock             = Lock physical disk or logical partition to avoid conflicts
  267.  log       [file] = Log (append) to 'file' (.log); (No file => stop logging)
  268.  mem  [c|lsn] [#] = Store LSN in MEMory list at loc #, or limit mem list-size
  269.  part [dr/nr][No] = Show partitions,  or select one using nr or drive-letter
  270.  prio  [lvl]      = Set relative priority of the DFS main thread
  271.  psn  xx          = Analyse & display sector, SN xx using physical sector-nr
  272.  scan [wr [NoId]] = Scan bad-sectors; use read/Write verify; No automatic id
  273.  screen  [on|off] = Switch output to the screen on or off
  274.  sim  img [f [s]] = Save to FS-image, starting from LSN [f], size [s] sectors
  275.  slt  [type i ln] = Display SLT for sectors of 'type' at index i, ln lines
  276.  sort [-][unique] = Sort LSN list; [-] = descending [unique] removes duplicates
  277.  t a|h     [size] = This SN, display in Ascii/Hexadecimal, s sectors or bytes
  278.  unlock           = Unlock physical disk or logical partition
  279.  vol  [drive][No] = Show all volumes, or select one using drive-letter
  280.  walk    [disknr] = Select a physical disk and walk the MBR/EBR chain
  281.  wrim img [f [s]] = Write FS-image to disk-sectors start at LSN [f], size [s]
  282.  run macro        = Run a DFS macro in a REXX file
  283.  copyoutput [stem]= Copy output from last-command to REXX stem-var
  284.  q                = Quit FS display; 2.52 07-12-97  (c) 1994-1997; Jan van Wijk
  285.  
  286.  EXTERNALS      Any command not recognized as a valid DFS internal command
  287.                 will be passed to the default command-processor (COMSPEC).
  288.                 Usefull commands: CHKDSK, CD, DIR, ...
  289.                 Note: FDISK, SETBOOT etc will not work if a physical disk
  290.                 is currently opened by DFS itself.
  291.                                                                               
  292. Command reference, general DFS commands
  293. ---------------------------------------
  294.  
  295.  disk [nr]    = Select specified physical disk for physical addressing
  296.  
  297.  Purpose:       Select a physical disk
  298.  
  299.  Parameters:    nr      optional   Physical disk number, default is 1
  300.  
  301.  Output:        Disk Geometry and default display of sector 0 (usualy MBR)
  302.  
  303.                 The returncode (rc) will be zero for a valid disk number
  304.                 or equal to the number of disks otherwise.
  305.                 This can be usefull from REXX scripts.
  306.  
  307.  
  308.  walk [nr]    = Walk the MBR/EBR chain of partition-tables for specified disk
  309.  
  310.  Purpose:       Show all partitioning information for the specified disk
  311.  
  312.  Parameters:    nr      optional   Physical disk number, default is 1
  313.  
  314.  Output:        Disk Geometry, MBR and all linked EBR's in partition format
  315.  
  316.  
  317.  lock [ign]   = Lock physical disk, to allow writing to it
  318.  
  319.  Purpose:       Lock a physical disk
  320.  
  321.  Parameters:    ign     optional   Ignore lock failure, do not prompt
  322.                                    interactively for write permission
  323.  
  324.  Output:        none
  325.  
  326.  
  327.  unlock       = Unlock physical disk, after writing to it
  328.  
  329.  Purpose:       Unlock a physical disk
  330.  
  331.  Parameters:    none
  332.  
  333.  Output:        none
  334.  
  335.                                                                               
  336.  part [i][ns] = Select specified partition, or show the list of partitions
  337.  
  338.  Purpose:       Select a disk partition for analysis
  339.  
  340.  Parameters:    i       optional   Number specifying the partition as shown
  341.                                    by the 'disks' or 'part' commands
  342.                         or   d:    Drive-letter for a partition (part C:)
  343.                         or   +     To get a verbose list
  344.                         or   !     To force a new scan of physical disks
  345.                                    If no parameter is specified the list of
  346.                                    partitions will be displayed.
  347.  
  348.                 ns      optional   Do not start SLT thread automaticaly (HPFS)
  349.                                    When specified, the SLT will be build later
  350.                                    when the 'SLT' cmd is issued to display it.
  351.  
  352.  Output:        Either the list of partitions or the default display for the
  353.                 first sector of the partition (usualy a boot-sector).
  354.  
  355.  Remarks:       The command "d:" where d is any existing drive-letter will
  356.                 be interpreted as a "part d:" command. This means that the
  357.                 C: partition can be opened just by typing "C:"
  358.  
  359.                 The returncode (rc) will be zero for a valid partition id or
  360.                 the number of partitions otherwise (usefull in REXX scripts).
  361.  
  362.                 An example of the list ouput in table form (default) is:
  363.  
  364.  Opened phys. disk : 1          Cyl: 327 H: 64 S:32            Size:   327.0 Mb
  365.  Number of physical disks found: 1
  366.  ┌──┬──┬──┬─────────────────┬────────┬────────┬───────────┬────────┬─────────┐
  367.  │id│PD│Dr│Type, description│Format  │Creator │Label Info │BM-Name │ Size Mb │
  368.  ├──┼──┼──┼─────────────────┼────────┼────────┼───────────┼────────┼─────────┤
  369.  │01│ 1│--│Prim 0a Boot Mgr │FAT     │        │«OS/2    » │        │     1.0 │
  370.  │02│ 1│C:│Prim 07 Inst. FS │HPFS    │OS2 20.0│OS2        │OS/2    │   170.0 │
  371.  │03│ 1│D:│Log  07 Inst. FS │HPFS    │OS2 20.0│OS2        │STARTUP │     5.0 │
  372.  │04│ 1│E:│Log  07 Inst. FS │HPFS    │OS2 20.0│OS2        │        │   145.0 │
  373.  │05│ 1│--│Hide fe PS/2 syst│FAT16   │IBM  5.y│6M OPEN 525│        │     6.0 │
  374.  └──┴──┴──┴─────────────────┴────────┴────────┴───────────┴────────┴─────────┘
  375.  
  376.  Number of physical disks   = The number of disks reported by the system
  377.  Opened phys disk ...       = opened disk with Cylinder, Head, Sector and Size
  378.  Part nn WARNING: ...       = Any informal, strange or alarming conditions
  379.  
  380.  Where:   id                = The selection-id used by DFS for this partition
  381.           PD                = Physical drive number; 1..max
  382.           Dr                = Drive letter, a capital plus a semicolon (C:),
  383.                               or a lowercase drive-letter for hidden partitions
  384.           Type, description = Type-info and hex value of the type, type-info:
  385.                               Prim = Primary (active, accessible)
  386.                               Hide = Hidden  (primary or special)
  387.                               Log  = Logical volume in an extended partition
  388.           Format            = The filesystem format string found in the
  389.                               bootrecord for this partition or --none--
  390.           Creator           = The OEM identification string from the bootrec
  391.                               of "fdisk" if no valid bootrecord is found
  392.           Label Info        = The volumelabel as found in the bootrecord, or
  393.                               the «BM-label» of the current Bootmgr selection
  394.                               Note: The FAT volume-label will not be shown here
  395.           BM-Name           = The name for this partition as registered in
  396.                               the OS/2 boot-manager information area's
  397.           Size Mb           = The gross size of the partition in megabytes
  398.                                                                               
  399.                 An example of a list fragment for verbose form is:
  400.  
  401. DFS partition  Id : 1
  402.  Physical disk nr : 1     (Fixed), Partition-table 0 (MBR), entry: 0
  403.  System Indicator : 0a
  404.  Type description : Boot Mgr
  405.  FileSyst. format : BMGR
  406.  Partition   type : Primary
  407.  Part. visibility : Visible
  408.  Creator OEM-name :  fdisk
  409.  Boot Mgr default : «Merlin  »
  410.  Boot capability  : Bootable directly by BIOS and MBR-code
  411.  Partition  start : Cyl:   0   Hd:   1 Sec:  1
  412.  Partition    end : Cyl:   0   Hd: 254 Sec: 63
  413.  Bootsect. offset : 0000003F =      63 Dec
  414.  Partition   size : 00003E82 =    8001 Kb
  415.  Cluster     size : 00000001 =     512 Bytes, in 1 sector(s)  of 512 bytes
  416.  Bootsector   PSN : 0000003F
  417.  Free space drive : --  Drive not ready,     or unknown file-system: -
  418.  .
  419.  .
  420.  .
  421. DFS partition  Id : 7
  422.  Physical disk nr : 1     (Fixed), Partition-table 4 (EBR), entry: 0
  423.  System Indicator : 07
  424.  Type description : Inst. FS
  425.  FileSyst. format : HPFS
  426.  Partition   type : Logical
  427.  Part. visibility : Visible
  428.  Creator OEM-name : OS2 20.0
  429.  Partition Label  : OS2_BOOT_3
  430.  Boot capability  : Bootable by OS/2 boot-manager as: Merlin
  431.  Partition  start : Cyl:  83   Hd:   1 Sec:  1
  432.  Partition    end : Cyl: 131   Hd: 254 Sec: 63
  433.  Bootsect. offset : 0000003F =      63 Dec
  434.  Partition   size : 000C02B2 =     384 Mb
  435.  Cluster     size : 00000001 =     512 Bytes, in 1 sector(s)  of 512 bytes
  436.  Bootsector   PSN : 001458D2
  437.  Free space drive : G:        92.3 Mb of    384.3 Mb on file-system: HPFS
  438.  
  439. DFS partition  Id : 8
  440.  Physical disk nr : 1     (Fixed), Partition-table 5 (EBR), entry: 0
  441.  System Indicator : 07
  442.  Type description : Inst. FS
  443.  FileSyst. format : HPFS
  444.  Partition   type : Logical
  445.  Part. visibility : Visible
  446.  Creator OEM-name : OS2 20.0
  447.  Partition Label  : OS2_DATA_1
  448.  Boot capability  : Not bootable by BIOS and MBR-code or OS/2 boot-manager
  449.  Partition  start : Cyl: 132   Hd:   1 Sec:  1
  450.  Partition    end : Cyl: 262   Hd: 254 Sec: 63
  451.  Bootsect. offset : 0000003F =      63 Dec
  452.  Partition   size : 00201C84 =    1028 Mb
  453.  Cluster     size : 00000001 =     512 Bytes, in 1 sector(s)  of 512 bytes
  454.  Bootsector   PSN : 00205BC3
  455.  Free space drive : H:       193.3 Mb of   1027.6 Mb on file-system: HPFS
  456.                                                                               
  457.  
  458.  vol [letter] = Select specified logical volume, or show the list of volumes
  459.  
  460.  Purpose:       Work with logical volumes including floppies and CD-rom
  461.  
  462.  Parameters:    Drive-letter for the volume
  463.  
  464.  Output:        Either the list of volumes or the default display for the
  465.                 first sector of the volume (usualy a boot-sector).
  466.  
  467.  Remarks:       Network or other "virtual" file-systems are not supported.
  468.  
  469.  
  470.  check   [dr/nr]  = Report all detected file-system errors using SLT info
  471.  
  472.  Purpose:       Check file-system integrity using SLT info (chkdsk function)
  473.  
  474.  Parameters:    drive-letter or partition-nr to check, default opened partition
  475.  
  476.  Output:        Verbose list of all SLT entries that have an error flagged
  477.                 This will include path+filename when available and textual
  478.                 explanation of the error(s)
  479.  
  480.  Remarks:       The reported arrors are the same as listed with the SLT command
  481.                 'check' is an alias for "SLT * 0 * +fffd"
  482.                 The SLT will be rebuild on each invocation of the "check" cmd.
  483.  
  484.  
  485.  im   img         = Open a file with a FS-image (.img) for analysis
  486.  
  487.  Purpose:       Work with a saved binary image
  488.  
  489.  Parameters:    img     Filename for the image, default extention is '.img'
  490.  
  491.  Output:        The default display for the first sector of the image
  492.  
  493.  Remarks:       File-system type is derived from first (boot) sector
  494.  
  495.  
  496.  sim  img [f [s]] = Save FS-image (.img) start from LSN [f], size [s] sectors
  497.  
  498.  Purpose:       Save specified sectors as a binary image for use with 'IM'
  499.  
  500.  Parameters:    img     Filename for the image, default extention is '.img'
  501.                 f       Start LSN for save, default is 0
  502.                 s       Size of the saved image in sectors, default is 256
  503.                         '$' can be used to save all sectors of the disk/volume
  504.  
  505.  Output:        none
  506.  
  507.  Remarks:       When '.' is specified for s, sector 'f' upto 'this' is saved
  508.                 When '.' is specified for f, the start-sector is 'this'
  509.                 When '.' is specified for both, only the 'this' sector is saved
  510.                                                                               
  511.  
  512.  wrim img [f [s]] = Write FS-image to disk-sectors start at LSN [f], size [s]
  513.  
  514.  Purpose:       Write sectors back from an image to opened partition or volume
  515.  
  516.  Parameters:    img     Filename for the image, default extention is '.img'
  517.                 f       Start LSN for write, default is 0
  518.                 s       Size of the written sector area, default size of image
  519.  
  520.  Output:        none
  521.  
  522.  Remarks:       '.' can be specified for the f and s parameters, see 'sim' cmd
  523.  
  524.  
  525.  fs  fs-name [No] = Force analysis using specified file-system knowledge
  526.  
  527.  Purpose:       Use specific FS knowledge if the default is not correct
  528.  
  529.  Parameters:    fs-name File-system name, like FAT or HPFS
  530.                 No      Do not try to build SLT automatically
  531.  
  532.  Output:        none
  533.  
  534.  Remarks:       Only HPFS is realy supported at the moment, and depending on
  535.                 disk or image contents DFS might behave strangely or even trap
  536.  
  537.  
  538.  export  [id][fn] = Export  LSN's in sector list [id], to   file [fn]
  539.  
  540.  Purpose:       Save an LSN-list in a file for modification or later use
  541.  
  542.  Parameters:    id      optional   Id for the list, f, b, d or m
  543.                                    see "list" cmd; default is last list used
  544.                 fn      Destination filename, default is dfslistX.lsn
  545.  
  546.  Output:        none
  547.  
  548.  Remarks:       The file has one LSN per line, editable with a text-editor.
  549.  
  550.  
  551.  import  [id][fn] = Import  LSN's to sector list [id], from file [fn]
  552.  
  553.  Purpose:       Read an LSN-list from a file, exported and/or modified
  554.  
  555.  Parameters:    id      optional   Id for the list, f, b, d or m
  556.                         see "list" cmd; default is the "find-result" list
  557.                 fn      Source filename, default is dfslistX.lsn
  558.  
  559.  Output:        none
  560.  
  561.  Remarks:       The file needs one LSN per line, editable with a text-editor.
  562.                 It can be the result of an export, derived from a log-file
  563.                 or created completely by hand.
  564.                 The verbose format resulting from a "list f+" or "list f+f"
  565.                 and the "delshow" is also valid. (use "log" cmd to capture)
  566.                 This is often more convenient than bare LSN lists because
  567.                 the verbose format contains info like path/filename.
  568.                                                                               
  569.  
  570.  base [sn [sl]]   = Set base limits start and end values, defining partition
  571.  
  572.  Purpose:       Force a different partition start sector-nr
  573.  
  574.  Parameters:    sn      Sector-number to use as start for partition ==> LSN 0
  575.                 sl      Sector-number to use as end for partition (optional)
  576.  
  577.  Output:        none
  578.  
  579.  Remarks:       Can be used if start of partition / partition-tables are bad
  580.                 Try to find the PSN for the first sector of the partition
  581.                 and use the "base" cmd followed by an "FS xxxx" command
  582.  
  583.  
  584.  PSN  xx      = Analyse & display sector using PSN xx
  585.  
  586.  
  587.  Purpose:       Display sector using Physical Sector Number addressing
  588.  
  589.  Parameters:    xx = 1 to 8 hexadecimals
  590.  
  591.  Output:        Sector display, format selected based on sector-contents
  592.  
  593.  Remarks:       The SN is specified in hexadecimal format, however the first
  594.                 digit needs to be decimal to avoid misinterpretation.
  595.                 Prefixing the SN with '0' will avoid any conflicts.
  596.  
  597.                 Output that scrolls of the screen can be repeated using
  598.                 the 't' command. (display 'this' sector)
  599.  CHS c  h  s  = Analyse & display sector using CHS specication
  600.  
  601.  
  602.  Purpose:       Display sector using Cylinder, Head and Sector addressing
  603.  
  604.  Parameters:    c       mandatory  The zero-based decimal Cylinder number
  605.                                    Range 1 to disk-specific maximum and
  606.                                    usualy below 1024.
  607.  
  608.                 h       mandatory  The zero-based decimal Head number
  609.                                    Range 0 to disk-specific maximum but
  610.                                    never more than 255
  611.  
  612.                 s       mandatory  The one-based decimal Sector number
  613.                                    Range 1 to disk-specific maximum but
  614.                                    never more than 63
  615.  
  616.  Output:        Sector display, format selected based on sector-contents
  617.  
  618.  Remarks:       Output that scrolls of the screen can be repeated using
  619.                 the 't' command. (display 'this' sector)
  620.                                                                               
  621.  
  622.       xx      = Analyse & display sector, SN xx; xx = 1 to 8 hexadecimals
  623.  
  624.  
  625.  Purpose:       Display a sector in the most usefull format
  626.  
  627.  Parameters:    none
  628.  
  629.  Output:        Sector display, format selected based on sector-contents
  630.  
  631.  Remarks:       The SN is specified in hexadecimal format, however the first
  632.                 digit needs to be decimal to avoid misinterpretation.
  633.                 Prefixing the SN with '0' will avoid any conflicts.
  634.  
  635.                 Logical addressing (LSN) is actualy used, however when a
  636.                 physical disk is selected the offset for logical addressing
  637.                 is set to 0. The result is that LSN's equal PSN's.
  638.  
  639.                 Output that scrolls of the screen can be repeated using
  640.                 the 't' command. (display 'this' sector)
  641.  
  642.  
  643.  
  644.  H,h [xx [s]] = Hex-dump sector or half-sector, LSN xx, s sectors/bytes
  645.  
  646.  Purpose:       Display current or specified sector in hex-dump format
  647.  
  648.  Parameters:    xx      optional   LSN of sector to dump
  649.  
  650.                 s       optional   size to dump:  1..63   specifies sectors
  651.                                                  64..xxx  specifies bytes
  652.                                    Default is 512 bytes for the 'H' command
  653.                                           and 256 bytes for the 'h' command
  654.  
  655.  Output:        Hex-dump of the sector
  656.                 On every line 16 bytes of data will be displayed, each line
  657.                 containing:
  658.                   - the relative offset in the record (4 hex digits)
  659.                   - 16 bytes in hexadecimal; separator after 8 bytes
  660.                   - the same 16 bytes represented as ASCII
  661.  
  662.  Remarks:       The ASCII representation is filtered, non-printable
  663.                 characters are represented with a PERIOD character
  664.  
  665.  
  666.  
  667.  t a|h [s]    = This LSN, display in Ascii or Hex;  s sectors/bytes
  668.  
  669.  Purpose:       Display current sector in ASCII, EA, HEX or default format
  670.  
  671.  Parameters:    a|h     optional   Specifies display format as:
  672.                                       a = ASCII
  673.                                       h = HEX
  674.                                    none = default (based on sector-contents)
  675.  
  676.                 s       optional   size to dump:  1..63   specifies sectors
  677.                                                  64..xxx  specifies bytes
  678.  
  679.  Output:        Sector display in requested format
  680.  
  681.  Remarks:
  682.  
  683.                                                                               
  684.  f[op] [t] [str]] = Find [options] sectors of [t]ypes containing [str]
  685.  
  686.  Purpose:       Perform a sector search starting from the current LSN
  687.                 until a sector of the specified type and optionaly
  688.                 containing a specified ASCII/HEX string is found.
  689.  
  690.  Parameters:    op      optional   Search options, default is '+'
  691.                                    *      = automatic repeat (find all ...)
  692.                                    +      = verbose output even when repeating
  693.                                    -      = search towards lower sector numbers
  694.                                    !      = force LSN/PSN display, no file-paths
  695.                                    $      = Use case-insensitive string compare
  696.                                    @[pos] = compare at one sector position [pos]
  697.                                             (with type dependant defaults)
  698.  
  699.                                    Note: Use no spaces betwee 'f' and options!
  700.  
  701.                 t       optional   Types of sector wanted, default is any KNOWN
  702.                                    specify multiple types in a single string
  703.  
  704.                     DFS generic sector types
  705.                     '*' = any sector
  706.                     'r' = Master   Boot Rec    'e' = Extended Boot Rec
  707.                     'b' = Fsys boot sector     'R' = Fsys reserved sec
  708.                     '!' = any known type       'u' = Unidentified data
  709.                     '$' = Free space           '.' = <Past-partition!>
  710.  
  711.                     HPFS specific sector types
  712.                     'I' = File data            'E' = EA data
  713.                     'A' = ACL data             'B' = Boot area
  714.                     's' = HPFS superblock      'p' = HPFS spareblock
  715.                     'H' = Hotfix table         'h' = Hotfix data
  716.                     'x' = Bad sector-list      'X' = Bad sector
  717.                     'S' = Spare dirblocks
  718.                     'D' = Directory   Fnode    'y' = Deleted Dir Fnode
  719.                     'f' = File        Fnode    'z' = Deleted FileFnode
  720.                     'a' = Allocation  block    'Z' = Deleted All-block
  721.                     'd' = Directory block      'P' = Dir-band (free)
  722.                     'Q' = Dir-band bitmap      'c' = Codepage info
  723.                     't' = Codepage data        'i' = HPFS386 User-id
  724.                     'm' = Bitmap Tables        'M' = Bitmap data
  725.  
  726.                     For an up-to-date list, use the '???" command
  727.  
  728.                 str     optional   A string of bytes that have to be present
  729.                                    in the wanted sector.
  730.                                    When the '$' string option is not given, it
  731.                                    can be specified as a mix of ASCII and HEX.
  732.                                    The starting mode is ASCII, switching to
  733.                                    HEX and back is done with the ' character.
  734.                                    Leading whitespace is skipped, in HEX mode
  735.                                    spaces can be used to improve readability.
  736.  
  737.                         Example 1: last'0d0a'first
  738.  
  739.                                    This will search for the word "last"
  740.                                    followed by a carriage-return line-feed
  741.                                    combination and the word first
  742.  
  743.                         Example 2: 'e9bd13 0d4023 49 42 4d 3a38 2e'
  744.  
  745.                                    This will search for a byte sequence,
  746.                                    in this case the start of COMMAND.COM
  747.                                                                               
  748.  
  749.  Output:        Sector display, format selected based on sector-contents,
  750.                 or a single line with position and type info when repeating
  751.  
  752.  
  753.  Remarks:       This command is also very usefull to find a specific fragment
  754.                 of disassembled code anywhere on the disk, to resolve the
  755.                 name of an EXE, DLL or device driver causing traps or hangs.
  756.  
  757.                 Backward search can be usefull on HPFS to find the preceding
  758.                 fnode when looking at some random file-data.
  759.                 Note: the 'id' command will do this more reliably but depends
  760.                       on the sector-lookup-table to be filled.
  761.  
  762.  
  763.  edit pos  str    = Update the current sector at 'pos' to the value of 'str'
  764.  
  765.  Purpose:       Make (small) modifications to sector contents
  766.  
  767.  Parameters     pos     mandatory  Hexadecimal offset, start of edit-area
  768.  
  769.  
  770.                 str     mandatory  A string to be placed at the specified
  771.                                    position in the current sector.
  772.                                    The syntax for this string is exactly the
  773.                                    same as for the find ('f") command.
  774.                                    So ASCII and binary specifications are
  775.                                    possible.
  776.  
  777.  Output:        Hex-dump BEFORE and AFTER for the changed sector area
  778.  
  779.  Remarks:       The edit command itself does NOT write the new contents
  780.                 back to disk. Use the 'write' command to do that.
  781.                 The 'show' command can be used to view the sector before
  782.                 writing back or making more changes. It is simular to the
  783.                 'H' and 'h' command, but it does not read from the disk,
  784.                 it just displays the current sector buffer contents.
  785.  
  786.  
  787.  show  [s]    = Hex-dump current sector (or half-sector), s sectors/bytes
  788.  
  789.  Purpose:       Display current (last read, edited) sector in hex-dump format
  790.  
  791.  Parameters:    s       optional   size to dump:  1..63   specifies sectors
  792.                                                  64..xxx  specifies bytes
  793.                                    Default is 512 bytes for the 'SHOW' command
  794.                                           and 256 bytes for the 'show' command
  795.  
  796.  Output:        Hex-dump of the sector, see the 'h' and 'H' commands
  797.  
  798.  Remarks:       The main difference with 'h' and 'H' are that the current
  799.                 contents of the sector-buffer (possibly changed by an 'edit')
  800.                 are shown. 'h' and 'H' will first read a sector from disk.
  801.  
  802.                                                                               
  803.  write   xx   = Write back the sector-buffer using current or specified LSN
  804.  
  805.  Purpose:       Update a sector on the disk, possible after editing it
  806.  
  807.  Parameters:    xx      mandatory  sector-number specification (LSN)
  808.                                    '.' is the current sector ('This')
  809.  
  810.  Output:        none
  811.  
  812.  Remarks:       Only one sector (512 bytes) will be written.
  813.                 Writing back changed data to the disk can cause BIG TROUBLE
  814.                 when you don't know EXACTLY what you are doing.
  815.                 Use it with extreme care (and maintain backups if possible :-)
  816.  
  817.  
  818.  
  819.  list [id+op] [w] = Display LSN's in sector list [id], using options/wildcard
  820.  
  821.  Purpose:       Display one of the sector-number lists maintained by DFS
  822.  
  823.  Parameters     id      optional   Identifier for LSN list, valid values are:
  824.  
  825.                                    d = Dir,   result or dir-block display
  826.                                    b = Bad,   result of 'scan' command
  827.                                    f = Find,  result of 'f' command
  828.                                    m = Mem,   result of 'mem' commands
  829.  
  830.                 op      optional   + = Use verbose output, one line per LSN
  831.                                    f = Incluse PATH info on Fnode LSN's on
  832.                                        verbose output (requires + too)
  833.  
  834.                 w       optional   Wildcard select-string, only valid with "+f"
  835.                                    multiple wildcards '*' and '?' can be used.
  836.                         Very useful on a (large) list of deleted fnodes!
  837.  
  838.  Output:        List of sector numbers in compact or verbose format
  839.  
  840.  Remarks:       There should be NO space between [id] and the options!
  841.                 The default list-identifier will be set to a specific list
  842.                 each-time one of the lists is modified or listed.
  843.                 List also available for REXX in the dfs_sn. stem variable
  844.  
  845.  
  846.  mem  [c|lsn] [#] = Store LSN in MEMory list at loc #, or limit mem list-size
  847.  
  848.  Purpose:       Add an LSN to the LSN memory list for later use with .NNN
  849.  
  850.  Parameters:    c       optional   Clear command, limit list-size to # entries
  851.  
  852.                 lsn     optional   LSN to add to the list, special values are:
  853.                                    x, u, d, t for Xtra, Up, Down and This
  854.  
  855.                 #       optional   memory location to store lsn, or limit
  856.  
  857.  Output:        none
  858.  
  859.  Remarks:       The LSN memory can be listed using "list" [+f]
  860.                                                                               
  861.  
  862.  sort [+|-][u]    = Sort the LSN list using specified options
  863.  
  864.  Purpose:       Sort the list ascending/descending, remove duplicates
  865.  
  866.  Parameters:    +|-     optional   Sort ascending (+) or descending (-)
  867.                                    default is ascending
  868.  
  869.                 u       optional   Make list unique by removing all duplicates
  870.  
  871.  Output:        none
  872.  
  873.  
  874.  
  875.  .NNN        [id] = Display numbered FS-entity marked .NNN from a sector list
  876.  
  877.  Purpose:       Display one of the entries from the list last shown
  878.                 It can be applied on Directory- as well as Allocation-lists
  879.                 The number (NNN) to use is displayed to the left of the list
  880.  
  881.  Parameters:    NNN                The zero-based decimal entry number to show
  882.  
  883.                 id      optional   Identifier for LSN list (see list command)
  884.  
  885.  Output:        Sector display, format selected based on sector-contents
  886.  
  887.  
  888.  Enter        = down in hierachy (Enter = down)
  889.  
  890.  Purpose:       Display the next, most likely wanted, sector
  891.  
  892.  Parameters:    none
  893.  
  894.  Output:        Sector display, format selected based on sector-contents
  895.  
  896.  
  897.  u            = up in hierachy
  898.  
  899.  Purpose:       Display the sector that is higher in the hierarchy (parent)
  900.  
  901.  Parameters:    none
  902.  
  903.  Output:        Sector display, format selected based on sector-contents
  904.  
  905.  
  906.  x            = Extra LSN
  907.  
  908.  Purpose:       Display the sector marked as eXtra
  909.  
  910.  Parameters:    none
  911.  
  912.  Output:        Sector display, format selected based on sector-contents
  913.  
  914.  
  915.                                                                               
  916.  SLT [t i s m]   = Show SLT for 'type', at index i, size s, error-mask m
  917.  
  918.  Purpose:       Display (selection of) the Sector Lookup Table
  919.  
  920.  Parameters:    t       optional   Sector-types to include in the displayed
  921.                                    list. Default is all types ('*')
  922.                                    Types are same as specified for 'f' cmd
  923.  
  924.                 i       optional   Start index in the SLT to display,
  925.                                    '+' and '-' show next/previous screenfull
  926.                                    'a' will show entire SLT
  927.  
  928.                 s       optional   Number of entries to display, default will
  929.                                    result in one screenfull; '*' = rest of SLT
  930.  
  931.                 m       optional   Error filtering mask, * = all errors
  932.                                    4-digit Hexadecimal value, each set bit
  933.                                    will include a specific error value.
  934.                                    When prefixed with a '+' sign, the ouput
  935.                                    will be verbose (error-text & path+filename)
  936.  
  937.  Output:        One line for each entry in the SLT, containing:
  938.                         LSN        Start LSN for a range of sectors
  939.                         size       Number of sectors in the range
  940.                         ref        Other sector refering to this range (fnode)
  941.                         type       Type of the sectors in the range
  942.                         error      4-digit Hexadecimal error value:
  943.  
  944.                   0x00000001  Linked to some structure, but not in bitmap
  945.                   0x00000002  Allocated in bitmap, but no known link
  946.                   0x00000004  HPFS shortname does not match DIR name
  947.                   0x00000008  Fnode is a directory but DirFlag is not set
  948.                   0x00000010  Fnode datalength greater than Dir-entry size
  949.                   0x00000020  Fnode datalength smaller than Dir-entry size
  950.                   0x00000040  Fnode datalength greater than allocated size
  951.                   0x00000080  Fnode datalength smaller than allocated size
  952.                   0x00000100  Checksum value is incorrect
  953.                   0x00001000  LSN does not point to valid dirblock
  954.                   0x00002000  LSN does not point to valid Fnode
  955.                   0x00004000  LSN does not point to valid Allocation sector
  956.                   0x00008000  LSN is too large for this volume
  957.  
  958.  Remarks:       Sector ranges might overlap, the smallest matching range will
  959.                 hold the best identification for a specific sector.
  960.                 The start-index will default to the position of the sector
  961.                 last searched using the 'i' cmd.
  962.                 If needed the SLT will be built in a background thread.
  963.  
  964.  
  965.  id [xx]      = Identify, using sector lookup table
  966.  
  967.  Purpose:       Display the type for a specific sector and one major reference
  968.  
  969.  Parameters:    xx      optional   LSN of sector to identify, default is
  970.                                    the current sector
  971.  
  972.  Output:        One line specifying corresponding SLT entry, followed by
  973.                 a line specifying the type of the sector itself and a
  974.                 sector display of the 'ref' sector, in a format based
  975.                 on sector-contents
  976.  
  977.  Remarks:       This function is extremely usefull to relate file-data sectors
  978.                 from fragmented files to the Fnode for the file.
  979.                 It will tell you exactly to wich file a certain sector belongs.
  980.                                                                               
  981.  log       [file] = Log (append) to 'file' (.log); (No file => stop logging)
  982.  
  983.  Purpose:       Close current LOG, open new and capture DFS output in it
  984.  
  985.  Parameters:    File specification
  986.                 If no parameter is specified, logging is stopped.
  987.  
  988.  Output:        Concatenated output of DFS commands given after the
  989.                 'log' command, upto next 'log' or 'q' command.
  990.                 ANSI control characters for colors and cursor-positioning
  991.                 are not written to the logfile.
  992.  
  993.  Remarks:       There is no check on available space on the destination
  994.                 drive, file may end up empty if disk(ette) is full.
  995.                 The same logfile specification can be used more than once,
  996.                 output will be concatenated.
  997.                 On each 'log' command the current logfile will be closed.
  998.  
  999.  
  1000.  trace [lvl]  = Set trace level for DFS internal functions
  1001.  
  1002.  Purpose:       Investigate unexpected behaviour and debug DFS
  1003.  
  1004.  Parameters:    lvl     optional   Trace level; 0 = no trace
  1005.  
  1006.  Output:        The resulting trace-level, after this the output will be
  1007.                 normal output mixed with extra trace information showing
  1008.                 API return-codes and DFS internal variables
  1009.  
  1010.  Remarks:       Only available in the special DFSTRACE.EXE version
  1011.  
  1012.  
  1013.  prio  [lvl]  = Set relative priority of the DFS main thread
  1014.  
  1015.  Purpose:       Increase (search) speed with +, or decrease system impact
  1016.  
  1017.  Parameters:    lvl     optional   Prority level; + and ++ = high(est),
  1018.                                                   - and -- = low(est)
  1019.  
  1020.  Output:        The resulting prio-level
  1021.  
  1022.  Remarks:       When running on low(est) priority in the background, DFS
  1023.                 will almost come to a halt.
  1024.  
  1025.  q                = Quit FS display; 2.52 07-12-97  (c) 1994-1997; Jan van Wijk
  1026.  
  1027.  Purpose:       Exit DFS program
  1028.  
  1029.  Remarks:       Opened physical disk and logfile will be closed on exit
  1030.                 Asynchronious running threads will be aborted.
  1031.  
  1032.  
  1033.  cd [path]    = Change current Directory
  1034.  
  1035.  Purpose:       Change both the current directory and the current drive
  1036.  
  1037.  Parameters:    path    optional   Absolute or relative path specification
  1038.  
  1039.  Output:        The resulting current drive and directory
  1040.  
  1041.  Remarks:       '.' and '..' can be used in the relative path specification
  1042.                                                                               
  1043.  run mf [arg] = Run a REXX macro from DFS
  1044.  
  1045.  Purpose:       Execute a REXX script using the 'DFS' environment
  1046.  
  1047.  Parameters:    mf      mandatory  Macro file specification
  1048.  
  1049.                 arg     optional   Arguments to the REXX macro
  1050.  
  1051.  Output:        Any output from the REXX macro including (OS/2) commands
  1052.                 executed from the macro.
  1053.  
  1054.  Remarks:       DFS commands can be issued from within the macro, this
  1055.                 is the default environment (Address DFS).
  1056.                 Commands for CMD.EXE must be addressed using 'Address Cmd'
  1057.  
  1058.                 The following REXX variables will be available after
  1059.                 each executed DFS command from a macro:
  1060.  
  1061.                 rc            The returncode from the DFS command
  1062.  
  1063.                 dfs_disknr    Physical disk number currently open
  1064.                 dfs_partid    Partition-id for selection with "part"
  1065.                 dfs_drive     The opened drive letter, including a colon.
  1066.                 dfs_afsys     The attached filesystem, like "HPFS" or "FAT"
  1067.                 dfs_sect      The last retrieved sector(s), binary buffer
  1068.                 dfs_type      Type of last retrieved sector, this is a string
  1069.                               starting with the type-character (see 'F' cmd)
  1070.                               followed by a textual description.
  1071.  
  1072.                 dfs_this      SN of the last retrieved sector
  1073.                 dfs_down      SN of most likely sector to retrieve now
  1074.                 dfs_up        SN of sector up in hierarchy
  1075.                 dfs_next      SN of next in sequence
  1076.                 dfs_prev      SN of previous in sequence
  1077.                 dfs_down      SN of up in hierarchy
  1078.  
  1079.                 dfs_number    The number of disks or partitions resolved,
  1080.                               from the commands "disk 0" and "part 0" or
  1081.                               "part" respectively.
  1082.  
  1083.                 dfs_sn.0      Number of sector-numbers in the SN stem variable
  1084.                 dfs_sn.n      nth sector-number in the SN stem variable, coming
  1085.                               from DFS output for directories and allocation.
  1086.                               They correspond to the '.NNN' command
  1087.  
  1088.                               Note: SN's are in an 8-digit Hexadecimal format
  1089.  
  1090.  
  1091.                 REXX is dynamically loaded, when the run-command is exectuted
  1092.                 It requires REXX.DLL and REXXAPI.DLL in the libpath.
  1093.  
  1094.  
  1095.  copyoutput [stem-name]      Copy output from last-command to REXX stem-var
  1096.  
  1097.  Purpose:       Allow output to be captured and processed from REXX
  1098.  
  1099.  Parameters:    stem    optional   name of stem variable, ending in a '.'
  1100.                         default:   "dfs_output."
  1101.  
  1102.  Output:        none
  1103.  
  1104.  Remarks:       The <stem>.0 will hold the number of lines
  1105.                 <stem>.1 through <stem>.n the actual cmd-output
  1106.                                                                               
  1107.  
  1108.  scan [wr [NoId]] = Scan bad-sectors; use read/Write verify; No automatic id
  1109.  
  1110.  Purpose:       Identify bad sectors on a physical disk or logical volume
  1111.  
  1112.  Parameters:    write   optional   'w' to use full read/write/verify sequence
  1113.  
  1114.                 NoId    optional   'n' to disable automatic SLT lookup
  1115.  
  1116.  Output:        Progress indication based on sector-numbers, and one line for
  1117.                 each bad-sector found, plus an SLT display of a related sector
  1118.                 like the fnode, if automatic SLT display is enabled.
  1119.  
  1120.  Remarks:       For REXX, the dfs_sn.0 stem variable will hold the number of
  1121.                 bad-sectors found and dfs_sn.1 through dfs_sn.n the actual
  1122.                 bad sector numbers (can be shown with the 'list' command)
  1123.  
  1124.                 Without the write option, only a single 'read' will be done
  1125.                 for each sector, this can be executed on a running system
  1126.                 with open files on the disk/volume to be checked.
  1127.  
  1128.                 With the write option a "read/write-inverse/read/write-normal"
  1129.                 sequence is done for each sector with contents checking.
  1130.                 The contents of each sector will stay the same, so the function
  1131.                 can be safely executed on formatted disks with live data.
  1132.                 This sequence takes at least 4 times more time to complete
  1133.                 and also, for safety, the disk will be locked. This means that
  1134.                 the write option can only be used when the complete physical
  1135.                 disk is not being used.
  1136.  
  1137.  Remarks:       Also available for REXX in the dfs_sn. stem variable
  1138.  
  1139.  
  1140.  screen [arg] = Switch output to the screen on or off
  1141.  
  1142.  Purpose:       Allow output to logfile only
  1143.  
  1144.  Parameters:    arg     optional   'on' or 'off' to switch mode
  1145.  
  1146.  Output:        none
  1147.  
  1148.  Remarks:       The returncode (rc from REXX) will indicate the setting for
  1149.                 screen output: 0 indicates screen switched on
  1150.                                1 indicates screen switched off
  1151.  
  1152.  
  1153.  sep separ    = Specify a different separator character for multiple commands
  1154.  
  1155.  Purpose:       Allow use of the current separator-character in commands,
  1156.                 while still allowing multiple commands to be specified in
  1157.                 a single commandline.
  1158.  
  1159.  Parameters:    separ   mandatory  One character being the new separator
  1160.  
  1161.  Output:        none
  1162.  
  1163.  Remarks:       If part of a multi-command itself, the 'sep; command needs
  1164.                 to be terminated with the current (old) separator.
  1165.                 The rest of the multi-command uses the new value.
  1166.  
  1167.  Example:       dfs sep ~#log inifiles~part d~fos2.###~q
  1168.  
  1169.                                                                               
  1170. Command reference, FAT specific commands
  1171. ----------------------------------------
  1172.  
  1173. Active filesystem : FAT, specific commands are:
  1174.  
  1175.  cl              = Translate and display 'this' LSN as a cluster nr
  1176.  cl clust  [cmd] = Translate specified cluster-nr to LSN, display using 'cmd'
  1177.  fatread   [fat] = Read fat from disk into memory, fat = 1 or 2; default is 1
  1178.  fatwrite  [fat] = Write-back fat memory to disk,  fat = 1 or 2; default is 1
  1179.  fatshow         = Display contents of the FAT from memory
  1180.  
  1181.  For an up-to-date list of commands, use the '??' command
  1182.  
  1183.  
  1184.  cl              = Translate and display 'this' LSN as a cluster nr
  1185.  
  1186.  Purpose:       Find out what cluster-nr corresponds to current LSN
  1187.  
  1188.  Parameters:    none
  1189.  
  1190.  Output:        The cluster number, or an error message when invalid
  1191.  
  1192.  Remarks:       none
  1193.  
  1194.  
  1195.  cl clust  [cmd] = Translate specified cluster-nr to LSN, display using 'cmd'
  1196.  
  1197.  Purpose:       Display data using a cluster-nr instead of an LSN
  1198.  
  1199.  Parameters:    clust   mandatory  The cluster-nr of interest
  1200.  
  1201.                 cmd     optional   DFS generic command to execute with clust
  1202.                                    as its first and only parameter (like 'H')
  1203.  
  1204.  Output:        The output for the cmd, when no explicit cmd is specified this
  1205.                 will be the DFS default for the corresponding LSN, usualy a
  1206.                 display of that sector(s) in an appropriate format.
  1207.  
  1208.  Remarks:       none
  1209.  
  1210.  
  1211.  fatread   [fat] = Read fat from disk into memory, fat = 1 or 2; default is 1
  1212.  
  1213.  Purpose:       Update the in-memory FAT from the disk-FAT
  1214.  
  1215.  Parameters:    fat     optional   Number of the disk-FAT, either 1 or 2
  1216.  
  1217.  Output:        none
  1218.  
  1219.  Remarks:       FAT12, FAT16 and FAT32 formats are supported, the in-memory
  1220.                 FAT allways has the same layout (32-bit based)
  1221.  
  1222.  
  1223.  fatwrite  [fat] = Write-back fat memory to disk,  fat = 1 or 2; default is 1
  1224.  
  1225.  Purpose:       Update the on-disk FAT with the possibly changed in-memory FAT
  1226.  
  1227.  Parameters:    fat     optional   Number of the disk-FAT, either 1 or 2
  1228.  
  1229.  Output:        Message indicating success or failure
  1230.  
  1231.  Remarks:       This is a potentialy dangerous operation, also usualy both
  1232.                 FATs on the disk need to be in-sync. So 2 writes are needed.
  1233.  
  1234.  
  1235.  fatshow         = Display contents of the FAT from memory
  1236.  
  1237.  Purpose:       List all FAT-entries separately for analysis
  1238.  
  1239.  Parameters:    none
  1240.  
  1241.  Output:        A list of FAT-entries with 8 values in each line, <free>
  1242.                 <bad> and <eof> values are shown as such.
  1243.  
  1244.  Remarks:       none.
  1245.  
  1246.                                                                               
  1247. Command reference, NTFS specific commands
  1248. -----------------------------------------
  1249.  
  1250. Active filesystem : NTFS, specific commands are:
  1251.  
  1252.  none  (yet :-)
  1253.  
  1254.  
  1255.  
  1256.                                                                               
  1257. Command reference, HPFS specific commands
  1258. -----------------------------------------
  1259.  
  1260. Active filesystem : HPFS, specific commands are:
  1261.  
  1262.  \path-spec      = find and show file/directory relative to root
  1263.  alloc  [+]      = Show data-band allocation bitmaps, compact or [+] verbose
  1264.  albit a [lsn s] = Set/reset allocation bit in bitmap for lsn-range
  1265.  autobase [t][l] = find the start of an HPFS partition by searching sectors
  1266.                    of types [t], default 'spad'; [l] is last valid sector
  1267.  bitmap [xx,s,D] = Show bitmap at LSN xx, size s, in alloc or [D]ir format
  1268.  ca   [lsn][opt] = Check Allocation integrity for (current) fnode lsn
  1269.  check   [drive] = Check filesystem integrity for drive-letter (CHKDSK)
  1270.  cs              = Calculate HPFS checksum for current sector
  1271.  delfind [short] = Find deleted files, with name starting with [short]
  1272.  delsave d [w;p] = Undelete files from the delfind list, to dir [d], and
  1273.                    with optional wildcard [w] and minimum percentage [p]
  1274.  delshow   [w;p] = Show delfind list, optional wildcard, minimum percentage
  1275.  dirmap          = Show directory band allocation and usage map
  1276.  find path-spec  = Find and show file/directory specified by path-spec,
  1277.                    relative to current dir, or root if starting with '\'
  1278.  findroot    [n] = find the Root directory without using the superblock
  1279.                    starting the search at LSN [n]
  1280.  fixbs   [clear] = Update bad-sector table with LSN's from DFS badsec-list
  1281.  fixcp           = Update superblock with found LSN for codepage info
  1282.  fixcs           = Calculate checksums and write super- and spare-block
  1283.  fixroot         = Update superblock with found LSN for root-directory
  1284.  getbs           = Read HPFS bad-sector table into DFS badsec-list
  1285.  path        [n] = Show all path-components for current fnode, upto root
  1286.  saveto [dir][l] = Save filedata connected to (current) fnode to a file
  1287.  
  1288.  For an up-to-date list of commands, use the '??' command
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  autobase [t][l] = find the start of an HPFS partition by searching sectors
  1294.  
  1295.  Purpose:       Force a different partition start sector-nr for HPFS partition
  1296.  
  1297.  Parameters:    t       One or more sector-types to use in the search
  1298.                         default is "spad", Super, Spare, Alloc and Dirblock
  1299.                         f for fnode can also be used but is less reliable
  1300.                 sl      Sector-number to use as end for partition (optional)
  1301.  
  1302.  Output:        Search progress and finel result when HPFS partition found
  1303.  
  1304.  Remarks:       Can be used if start of partition / partition-tables are bad
  1305.                 Use the "fs hpfs" command first!
  1306.                                                                               
  1307.  
  1308.  alloc  [+]      = Show data-band allocation bitmaps, compact or [+] verbose
  1309.  
  1310.  Purpose:       Show usage and the distribution of data over the volume.
  1311.  
  1312.  Parameters:    none
  1313.  
  1314.  Output:        A single bitmap-graphic for the entire volume or for each
  1315.                 allocation-band when verbose format is selected
  1316.  
  1317.  Remarks:       System-reserved and Directory-band are indicated with 'S'
  1318.                 and 'R' respectively. Other area's are filled in according
  1319.                 to the degree of usage (allocation)
  1320.  
  1321.  
  1322.  dirmap          = Show directory band allocation and usage map
  1323.  
  1324.  Purpose:       Show usage of the pre-allocated directory-band
  1325.  
  1326.  Parameters:    none
  1327.  
  1328.  Output:        A single bitmap-graphic showing the allocation of the
  1329.                 pre-allocated directory band.
  1330.  
  1331.  Remarks:       If 100% is allocated more directory information will be
  1332.                 allocated elsewhere on the volume.
  1333.  
  1334.  bitmap [xx s D] = Show bitmap at LSN xx, size s, in alloc or [D]ir format
  1335.  
  1336.  Purpose:       Show a bitmape located at specified LSN, alloc or DIR format
  1337.  
  1338.  Parameters:    xx      mandatory  LSN of a bitmap sector
  1339.  
  1340.                 s       optional   size to dump:  1..63   specifies sectors
  1341.                                                  64..xxx  specifies bytes
  1342.                                    Default is 4 sectors (default bitmap size)
  1343.  
  1344.                 D       optional   Directory-format flag
  1345.  
  1346.  Output:        One bitmap-graphic for the specified bitmap LSN.
  1347.  
  1348.  Remarks:       Specifying an LSN that is not a bitmap-LSN will result in
  1349.                 a garbage bitmap display.
  1350.  
  1351.  
  1352.  albit a lsn s   = Set/reset allocation bit in bitmap for lsn-range
  1353.  
  1354.  Purpose:       Manualy set or reset allocation bits in the bitmap
  1355.  
  1356.  Parameters:    a       mandatory  's', 'a' or '1' will set to "allocated",
  1357.                                    others will set to "free" state.
  1358.  
  1359.                 lsn     optional   Start LSN for the range, default is 'this'
  1360.  
  1361.                 s       optional   size for the LSN-range, default is 1
  1362.  
  1363.  Output:        none
  1364.  
  1365.  Remarks:       This is a potentialy dangerous operation.
  1366.                                                                               
  1367.  
  1368.  \path-spec      = find and show file/directory specified by path-spec
  1369.  
  1370.  Purpose:       Locate the fnode for a known file- or directory
  1371.  
  1372.  Parameters:    path-spec          full path specification with no intervening
  1373.                                    space after the '\' command character
  1374.  
  1375.                               or   absolute- or relative path specification
  1376.                                    with an intervening space. If the path
  1377.                                    does not start with a '\' it is relative
  1378.                                    to the current directory (see CD cmd).
  1379.  
  1380.  Output:        Searchlist starting at the ROOT directory upto the requested
  1381.                 file or directory. It is either followed by an error message
  1382.                 if the path-spec was not found or by the display of the
  1383.                 corresponding fnode information.
  1384.  
  1385.  Remarks:       The search algorithm depends on the ROOT fnode being known.
  1386.                 When the superblock is corrupt this fnode can be resolved
  1387.                 using the 'findroot' command.
  1388.  
  1389.  
  1390.  
  1391.  path     [n]    = Show all path-components for current fnode, upto root
  1392.  
  1393.  Purpose:       Show the directory-branch that contains current file/dir
  1394.  
  1395.  Parameters:    n           optional   Start LSN for the search
  1396.  
  1397.  Output:        One line for each found 'parent' directory, upto the root
  1398.  
  1399.  Remarks:
  1400.  
  1401.  
  1402.  ca   [lsn][opt] = Check Allocation for (current) fnode lsn
  1403.  
  1404.  Purpose:       Check allocation integrity for current fnode
  1405.  
  1406.  Parameters:    lsn         optional   LSN of the fnode
  1407.                 opt         optional   Options:  v   = Verbose, show progress
  1408.  
  1409.  Output:        Σ           Start of an allocation-sector (heavily fragmented)
  1410.                 »           Start of one file-extent (fragmented file)
  1411.                 ·           One sector, green small dot is allocation OK
  1412.                 ■           One sector, red big dot is allocation error
  1413.  
  1414.                 Also a summary is given with the number of (failed) sectors
  1415.  
  1416.  Remarks:       Fnode maybe for a regular file (sectors must be ALLOCATED)
  1417.                 or for a deleted file (sectors must be FREE)
  1418.  
  1419.                                                                               
  1420.  findroot [n]    = find the Root directory without using the superblock
  1421.  
  1422.  Purpose:       Find the fnode for the ROOT directory, even if parts of
  1423.                 the volume, including the superblock, are damaged.
  1424.  
  1425.  Parameters:    n           optional   Start LSN for the search
  1426.  
  1427.  Output:        Search-list starting at the first fnode encountered upto
  1428.                 the fnode for the ROOT directory when found.
  1429.  
  1430.  Remarks:       Specifying a startlsn might be needed if reading at the
  1431.                 start of the volume results in device errors, or if some
  1432.                 fnodes in the sequence are corrupted.
  1433.  
  1434.  
  1435.  fixroot         = Write the root-LSN found with the 'findroot' command back
  1436.  
  1437.  Purpose:       Fix bad Root-LSN pointer, after CHKDSK bugs or other corruption
  1438.  
  1439.  Parameters:    none
  1440.  
  1441.  Output:        none
  1442.  
  1443.  Remarks:       It is better to lock the physical disk before writing to it
  1444.  
  1445.  
  1446.  fixcp           = Write the CodePage-LSN found with the '0#f c' command back
  1447.  
  1448.  Purpose:       Fix bad CodePage-LSN pointer
  1449.  
  1450.  Parameters:    none
  1451.  
  1452.  Output:        none
  1453.  
  1454.  Remarks:       It is better to lock the physical disk before writing to it
  1455.  
  1456.  
  1457.  fixbs  [clear]  = Update bad-sector table with LSN's from DFS badsec-list
  1458.  
  1459.  Purpose:       Replace the internal HPFS bad-sector list with the DFS
  1460.                 bad-sector list, or clear the liste completely.
  1461.  
  1462.  Parameters:    clear   optional   Make internal and DFS bad-sector list empty
  1463.  
  1464.  Output:        none
  1465.  
  1466.  Remarks:       The list can be the result of the "scan", "getbs", "mem" or
  1467.                 "import" cmd, allowing modification off-line with an editor.
  1468.                 The OS/2 chkdsk command will give erronous results on
  1469.                 "reserved for system use" until the next reboot.
  1470.                 It is better to lock the physical disk before writing to it
  1471.                 See 'lock' and 'unlock' commands
  1472.  
  1473.  getbs           = Read HPFS bad-sector table into DFS badsec-list
  1474.  
  1475.  Purpose:       Replace the DFS bad-sector list with the internal HPFS one
  1476.  
  1477.  Parameters:    none
  1478.  
  1479.  Output:        none
  1480.  
  1481.  Remarks:       none
  1482.                                                                               
  1483.  
  1484.  cs           = Calculate HPFS style checksum on last-read sector
  1485.  
  1486.  Purpose:       Show / check checksum on HPFS sector (super/spare)
  1487.  
  1488.  Parameters:    none
  1489.  
  1490.  Output:        Checksum value
  1491.  
  1492.  Remarks:       Only meaningfull for superblock (10) and spareblock (11)
  1493.                 These checksums are also stored by HPFS in the spareblock.
  1494.  
  1495.  fixcs           = Calcualte checksums and write super- and spare-block
  1496.  
  1497.  Purpose:       (re)calculate the checksum for superblock and spareblock
  1498.                 and write them both back to the disk
  1499.  
  1500.  Parameters:    none
  1501.  
  1502.  Output:        none
  1503.  
  1504.  Remarks:       none
  1505.  
  1506.                                                                               
  1507.  saveto [dir][l] = Save filedata connected to (current) fnode to a file
  1508.  
  1509.  Purpose:       Recover a file if the fnode can still be found, by making
  1510.                 a low-level sector-by-sector copy of its data to a new file.
  1511.                 (basic functionality to be used for undelete operations)
  1512.  
  1513.  Parameters:    dir         optional   Path to save the file copy
  1514.  
  1515.                 l           optional   LSN of the fnode of the file to recover
  1516.                                        default is the current LSN (This)
  1517.  
  1518.  Output:        Progress is reported with output like the "ca" command,
  1519.                 error messages will be given as appropriate
  1520.  
  1521.  Remarks:       Only the file contents is recovered, date&time and attributes
  1522.                 are lost. (EA's will be recovered as of version 2.42)
  1523.                 If no directory is specified it will default to the last
  1524.                 directory given, or "A:" when it is the first time
  1525.                 If the directory does not exist it will be created
  1526.  
  1527.                 Make sure that this is on a DIFFERENT drive, otherwise it
  1528.                 might overwrite the data you are recovering or still need
  1529.                 to recover later.
  1530.  
  1531.  
  1532.  delfind [short] = Find deleted files, with name starting with [short]
  1533.  
  1534.  Purpose:       Find deleted files, with name starting at current LSN
  1535.  
  1536.  Parameters:    short       optional   shortname, first part of filename
  1537.  
  1538.  Output:        Find-result list (as "f* z") on screen and in memory
  1539.  
  1540.  Remarks:       List can be manipulated as usual, best viewed with "delshow"
  1541.  
  1542.  
  1543.  delshow   [w;p] = Show delfind list, optional wildcard, minimum percentage
  1544.  
  1545.  Purpose:       Display a list of deleted Fnodes
  1546.  
  1547.  Parameters:    w           optional   wildcard selection for display
  1548.  
  1549.                 p           optional   Minimum allocation-OK percentage
  1550.  
  1551.  Output:        LSN list in fnode format (as "list f+f *;1" command)
  1552.  
  1553.  Remarks:       Default wildcard is '*', default percentage is 1
  1554.                 Wildcards are real (UNIX style) wildcards using '*' and '?'
  1555.                 Wildcards can appear at multiple places in the path string.
  1556.  
  1557.                                                                               
  1558.  
  1559.  delsave d [w;p] = Undelete files from the delfind list, to dir [d], and
  1560.                    with optional wildcard [w] and minimum percentage [p]
  1561.  
  1562.  Purpose:       Undelete multiple files using (a selection from) a list
  1563.  
  1564.  Parameters:    d           optional   Path to save the file copy
  1565.  
  1566.                 w           optional   wildcard selection for display
  1567.  
  1568.                 p           optional   Minimum allocation-OK percentage
  1569.  
  1570.  Output:        Progress is reported with output like the "ca" command,
  1571.                 error messages will be given as appropriate
  1572.                 All files are recovered one by one using the "saveto"
  1573.                 command automatically on each selected LSN from the list.
  1574.  
  1575.  Remarks:       See "saveto" command
  1576.                 LSN list is the find-result list as shown with "delshow",
  1577.                 it can be edited using export or "log" + "delshow".
  1578.  
  1579.                 If a path for the deleted file can be resolved, it will
  1580.                 also be included in the saved copy. If the directories
  1581.                 do not exist they will be created.
  1582.                 This means a whole directory-tree can be undeleted in
  1583.                 one operation, while retaining the structure.
  1584.                                                                               
  1585. Diagram of an example HPFS structure
  1586.  
  1587.  Basic HPFS data-structure for Root-directory with AUTOEXEC.BAT, README file,
  1588.  an OS2 subdirectory and lots of other files. The README file has it's data
  1589.  allocated in 2 alloc-chunks.
  1590.  
  1591.  ╔═════════╗                  ╔══════════════════╗       ╔═══════╗
  1592.  ║SUPER    ║              ┌──>║ DIR block        ║   ┌──>║ FNODE ║
  1593.  ║         ║              │   ║                  ║   │   ║       ║
  1594.  ║         ║    ╔═══════╗ │   ║┌────────────────┐║   │   ║       ║  ╔══════════
  1595.  ║Root LSN ────>║ FNODE ║ │   ║│*Special**Start*│║   │   ║ ALLOC ──>║ DIR block
  1596.  ╚═════════╝    ║       ║ │   ║│entry FNODE  LSN│║   │   ╚═══════╝  ║
  1597.                 ║       ║ │   ║│BtreeDownPtr LSN│║   │              ║┌─────────
  1598.                 ║ ALLOC ──┘   ║└────────────────┘║   │              ║│8514.RC
  1599.                 ╚═══════╝     ║┌────────────────┐║   │              ║│entry FNO
  1600.                               ║│OS2 (subdir)    │║   │              ║│BtreeDown
  1601.                               ║│entry FNODE  LSN├────┘              ║└─────────
  1602.  ┌─────────────────────────────┤BtreeDownPtr LSN│║                  ║┌─────────
  1603.  │                            ║└────────────────┘║                  ║│ANSI.EXE
  1604.  │                            ║┌────────────────┐║
  1605.  │                            ║│Special-end     │║
  1606.  │  ╔══════════════════╗      ║│entry FNODE  LSN│║       ╔══════════════════╗
  1607.  └─>║ DIR block        ║      ║│BtreeDownPtr LSN├───────>║ DIR block        ║
  1608.     ║┌────────────────┐║      ║└────────────────┘║       ║┌────────────────┐║
  1609.     ║│*Special**Start*│║      ╚══════════════════╝       ║│*Special**Start*│║
  1610.     ║│entry FNODE  LSN│║                                 ║│entry FNODE  LSN│║
  1611.     ║│BtreeDownPtr LSN│║     ╔═══════╗                   ║│BtreeDownPtr LSN│║
  1612.     ║└────────────────┘║  ┌─>║ FNODE ║                   ║└────────────────┘║
  1613.     ║┌────────────────┐║  │  ║       ║                   ║┌────────────────┐║
  1614.     ║│AUTOEXEC.BAT    │║  │  ║       ║  ╔═══════════     ║│PP... filename  │║
  1615.     ║│entry FNODE  LSN├───┘  ║ ALLOC ──>║┌──────────     ║│entry FNODE  LSN│║
  1616.     ║│BtreeDownPtr LSN│║     ╚═══════╝  ║│ 1st data-     ║│BtreeDownPtr LSN│║
  1617.     ║└────────────────┘║                ║└──────────     ║└────────────────┘║
  1618.     ║┌────────────────┐║                                 ║┌────────────────┐║
  1619.     ║│OS1.. filename  │║                                 ║│README filename │║
  1620.     ║│entry FNODE  LSN│║      ┌───────────────────────────┤entry FNODE  LSN│║
  1621.     ║│BtreeDownPtr LSN│║      │                          ║│BtreeDownPtr LSN│║
  1622.     ║└────────────────┘║      │                          ║└────────────────┘║
  1623.     ║┌────────────────┐║      │                          ║┌────────────────┐║
  1624.     ║│**Special**End**│║      │                          ║│XXX... filename │║
  1625.     ║│entry FNODE  LSN│║      │                          ║│entry FNODE  LSN│║
  1626.     ║│BtreeDownPtr LSN│║      │                          ║│BtreeDownPtr LSN│║
  1627.     ║└────────────────┘║      │                          ║└────────────────┘║
  1628.     ╚══════════════════╝      │                          ║┌────────────────┐║
  1629.                               │                          ║│**Special**End**│║
  1630.                               │                          ║│entry FNODE  LSN│║
  1631.                               │                          ║│BtreeDownPtr LSN│║
  1632.                               │                          ║└────────────────┘║
  1633.                               │                          ╚══════════════════╝
  1634.                               │
  1635.                               │                    ╔════════════════════════╗
  1636.                               │               ┌───>║┌──────────────────────┐║
  1637.                               │               │    ║│ 1st data-sector      │║
  1638.                               │               │    ║└──────────────────────┘║
  1639.                               │               │    ║┌──────────────────────┐║
  1640.                               │  ╔═══════╗    │    ║│ 2nd data-sector      │║
  1641.                               └─>║ FNODE ║    │    ║└──────────────────────┘║
  1642.                                  ║       ║    │    ╚════════════════════════╝
  1643.                                  ║       ─────┘
  1644.                                  ║ ALLOC ║         ╔════════════════════════╗
  1645.                                  ║       ─────────>║┌──────────────────────┐║
  1646.                                  ╚═══════╝         ║│ 3rd data-sector      │║
  1647.                                                    ║└──────────────────────┘║
  1648.     (c) 1995                                       ║┌──────────────────────┐║
  1649.     J. v. Wijk                                     ║│ 4th data-
  1650.                                                                               
  1651. Examples of DFS usage
  1652. ---------------------
  1653.  
  1654.  1) Resolve original name of FILExxxx.CHK files (created by CHKDSK)
  1655.  
  1656.     When CHKDSK recovers files it will place in a FOUND.xxx directory in
  1657.     the root-directory. This directory contains one or more recovered files
  1658.     with names like FILE0001.CHK
  1659.     The original name of the file is still in the Fnode, it can be shown
  1660.     using the following dhpfs commands (assuming drive c:) :
  1661.  
  1662.     Command                            Explanation
  1663.  
  1664.     DFS disks                          Start DFS and scan physical disks
  1665.     part id                            Select partition 'id' (must be HPFS)
  1666.     \found.000\file0001.chk            Search and display Fnode for .CHK
  1667.  
  1668.     Now 15 characters of the original name are shown as "Fnode Name String"
  1669.  
  1670.  2) Show freespace area's (HPFS)
  1671.       "slt $"
  1672.  
  1673.  3) Undelete a file; Find the fnode using:
  1674.       "f z"               find the next deleted fnode
  1675.       "f z   shortname"   next deleted named shortname (case-sensitive)
  1676.       "f$@ z shortname"   next deleted named shortname (case-insensitive)
  1677.  
  1678.       Add a '*' to the find command to do a repeated search (see 'f' command)
  1679.  
  1680.     Then use the "saveto path" command to copy the data for the deleted
  1681.     file to a directory.
  1682.  
  1683.     Notes: - It's best to use a different drive to avoid overwriting
  1684.  
  1685.  4) Save and restore (parts of) a disk
  1686.  
  1687.     The "sim" command can be used to save a complete disk, including partition
  1688.     information to one (very large!) file on a different (network) drive.
  1689.     The save the entire unit (opened disk/partition or volume) use:
  1690.     "sim img-name 0 $"
  1691.  
  1692.     It can be restored using the "wrim" command, if and only if the destination
  1693.     disk has exactly the same geometry as the source disk (heads, sectors cyl).
  1694.     This could be used to clone one workstation to multiple machines.
  1695.  
  1696.  5) List all "undeletable" files
  1697.  
  1698.     Find the FNODES for possibly deleted files using
  1699.       "f* z" or for specific files:  "f*$@ z shortname"
  1700.  
  1701.     Now list them, including PATH and recovery reliability using:
  1702.       "list f+f"
  1703.  
  1704.     Or list just a subset using any combination of wildcards:
  1705.       "list f+f *\testdir\data?.txt
  1706.  
  1707.     Use the .NNN command to select a file to undelete, and then use the
  1708.     "saveto [destination-path]" command to actualy undelete it.
  1709.  
  1710.     ==> new in 2.41: use the "delfind", "delshow" and "delsave" to do the
  1711.         same for multiple files, and with less typing!
  1712.                                                                               
  1713.  
  1714.  6) Update the bad-sector list with the results of a DFS-scan
  1715.  
  1716.     Find all sectors that are unreadable:
  1717.       "scan"
  1718.  
  1719.     Optionaly: list, export/modify/import the resulting bad-sector list
  1720.       "list  +f"                   (list, including PATH if sector is Fnode)
  1721.       "export b badguys"           (Place in an ASCII file badguys.lsn)
  1722.       Now edit it off-line, save as 'modified.lsn'
  1723.       "import b modified"
  1724.  
  1725.     Now replace the internal bad-sector list with the new modified one:
  1726.       "fixbs"
  1727.  
  1728.  7) Save a list of currently deleted files on an HPFS volume:
  1729.  
  1730.     Find deleted files (could take quite a while!):
  1731.       "f* z"
  1732.  
  1733.     Save the deleted-Fnode LSN's in a file:
  1734.       "export deleted"
  1735.  
  1736.       - Note that the list-id is not specified, only a filename is given.
  1737.         The id will default to "f" for find-result because that was the
  1738.         last LSN-list used.
  1739.         The explicit command would have been: "export f deleted.lsn"
  1740.  
  1741.     Optionaly, also save PATH info and recovery chances using a logfile:
  1742.       "log deleted"
  1743.       "list f+f"
  1744.       "log"
  1745.  
  1746.       - This will result in a (possibly large!) deleted.log with one line
  1747.         per deleted file with size, recovery percentage and PATH+filename
  1748.  
  1749.  8) Show the list of free diskspace area's for HPFS volumes
  1750.     "slt $ a"
  1751.  
  1752.  9) Show all detected anomalies in the SLT (like allocation errors)
  1753.     "slt * * * +"
  1754.  
  1755.  
  1756.                                                                               
  1757. 10) Display the FAT for a diskette in drive A:
  1758.     "dfs vol a"
  1759.     "fatshow"
  1760.  
  1761.  
  1762.  
  1763. 11) Display the FAT Root-directory for partition C:
  1764.     "dfs part C"
  1765.     "x"
  1766.  
  1767.     Note: this is limited to a Hex-dump display of the start of the directory
  1768.  
  1769.  
  1770.                                                                               
  1771. Known limitations and bugs
  1772. --------------------------
  1773.  
  1774. - There is only minimal support for FAT and only recognition for NTFS
  1775.  
  1776. - Writing to a volume opened with "vol" (and locked) does not seem to work
  1777.  
  1778. - Allocation integrity checks do not check the allocation for EA's
  1779.  
  1780.  
  1781. Considered improvements
  1782. -----------------------
  1783.  
  1784.  Rewrite of this documentaion in a description, command-reference and
  1785.  technical info on filesystems (possibly in HTML)
  1786.  
  1787.  More automatic detection of inconsistencies (like CHKDSK, FST, HVA, CHKPART)
  1788.  
  1789.    This will show HPFS problems like CHKDSK does, but in more detail and
  1790.    maybe some more types of inconsistencies.
  1791.    Note: Basic HPFS functionality implemented in version 1.62
  1792.          Some partitioning errors implemented in version 1.82
  1793.          SLT error reporting improved (HPFS)  in version 2.46  (check cmd)
  1794.          CHECK command and improved reporting in version 2.50
  1795.  
  1796.  Real coverage of other file-systems besides HPFS like FAT, LINUX, NTFS ...
  1797.    The code has been prepared for other file-systems in version  2.21
  1798.    NTFS open FS and some FAT functionality has been added in ver 2.52
  1799.  
  1800.  
  1801.  Graphical User Interface, very low priority item
  1802.  
  1803.    This could make the program easier to use, however it also makes
  1804.    the program requirements less attractive becaus it uses PM/WPS
  1805.    or WINxx and makes porting more difficult.
  1806.    A command-line version will allways be available to allow operation
  1807.    from a minimal (diskette) system.
  1808.  
  1809.  
  1810.  Generic edit and write capability,
  1811.  
  1812.    This will allow recovery operations without using other (third-party)
  1813.    utilities. The user interface needs to support screen-editing for this.
  1814.  
  1815.    Note: Some write enabled commands have been implemented starting with 1.90
  1816.          Improved volume/disk locking implemented in version 2.25
  1817.          Basic edit and write capability added in version 2.50
  1818.  
  1819.  
  1820.  Recovery for missing/damaged HPFS bootsector resulting in FDISK
  1821.  display of "unformatted".
  1822.  
  1823.  Recovery for a 'quick format' on HPFS (unformat)
  1824.  
  1825.  Recovery for repartitioning (un-fdisk)
  1826.  
  1827.