home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 October / PCO_1098.ISO / filesbbs / os2 / dfsee273.arj / DFSEE273.ZIP / DFS.DOC < prev    next >
Encoding:
Text File  |  1998-08-04  |  91.1 KB  |  1,998 lines

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