home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 February / PCO_0299.ISO / filesbbs / os2 / dfsee279.arj / DFSEE279.ZIP / DFS.DOC < prev    next >
Encoding:
Text File  |  1998-11-29  |  91.9 KB  |  2,017 lines

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