home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / dfsee510.zip / dfshpfs.txt < prev    next >
Text File  |  2003-01-14  |  24KB  |  527 lines

  1.   Display File Systems; version 5.08 01-01-2003  (c) 1994-2003; Jan van Wijk
  2.  ----------------------------[ www.dfsee.com ]-------------------------------
  3.  
  4.  
  5. C O N T E N T S:
  6. ================
  7.  
  8.   Command reference    = overview of HPFS specific commands
  9.   Detailed description = description for every command
  10.   Diagram of an example HPFS structure
  11.  
  12.  
  13. C O M M A N D   R E F E R E N C E:
  14. ==================================
  15.  
  16. HPFS specific commands
  17.  
  18. Active filesystem : HPFS, specific commands are:
  19.  
  20.  \path-spec      = find and show file/directory relative to root (FINDPATH)
  21.  ALBIT a [lsn s] = Set/reset allocation bit in bitmap for lsn-range
  22.  BITMAP [xx,s,D] = Show bitmap at LSN xx, size s, in alloc or [D]ir format
  23.  CA   [lsn][opt] = Check Allocation integrity for (current) fnode lsn
  24.  DELFIND  [name] = Find deleted files, limit to FNODES containing [name]
  25.  DIRTY [clean|d] = Make HPFS dirty-bit Clean (avoids CHKDSK) or set it Dirty
  26.  DIRMAP          = Show directory band allocation and usage map
  27.  FILEFIND [name] = Find normal files,  limit to FNODES containing [name]
  28.  FINDBASE [t][l] = find the start of an HPFS partition by searching sectors
  29.  FINDCP          = find the Codepage info sectors (before FIXCP and FIXSPARE)
  30.  FINDROOT    [n] = find the Root directory starting the search at LSN [n]
  31.  FIXBOOT         = Create HPFS bootsector from template and partition-table
  32.  FIXBS   [clear] = Update bad-sector table with LSN's from DFSee badsec-list
  33.  FIXCP     [lsn] = Update spareblock with found LSN for codepage info
  34.  FIXCS           = Calculate checksums and write super- and spare-block
  35.  FIXROOT         = Update superblock with found LSN for root-directory
  36.  FIXSPARE  [lsn] = Create HPFS spareblock sector from superblock info
  37.  GETBS           = Read HPFS bad-sector table into DFSee badsec-list
  38.  HPFSMAP   [all] = Show data-band allocation bitmaps, HPFS specific format
  39.  PATH        [n] = Show all path-components for current fnode, upto root
  40.  
  41.  For an up-to-date list of commands, use the '?' command
  42.  
  43.  HPFS specific sector types  (see ??? command)
  44.  
  45.              'I' = File data            'E' = EA data
  46.              'A' = ACL data             'B' = Boot area
  47.              's' = HPFS superblock      'p' = HPFS spareblock
  48.              'H' = Hotfix table         'h' = Hotfix data
  49.              'x' = Bad sector-list      'X' = Bad sector
  50.              'S' = Spare dirblocks
  51.              'D' = Directory   Fnode    'y' = Deleted Dir Fnode
  52.              'f' = File        Fnode    'z' = Deleted FileFnode
  53.              'a' = Allocation  block    'Z' = Deleted All-block
  54.              'd' = Directory block      'P' = Dir-band (free)
  55.              'Q' = Dir-band bitmap      'c' = Codepage info
  56.              't' = Codepage data        'i' = HPFS386 User-id
  57.              'm' = Bitmap Tables        'M' = Bitmap data
  58.  
  59.              For an up-to-date list, use the '???" command
  60.  
  61.  
  62. D E T A I L E D   D E S C R I P T I O N:
  63. ========================================
  64.  
  65.  ALBIT a lsn s   = Set/reset allocation bit in bitmap for lsn-range
  66.  
  67.  Purpose:       Manually set or reset allocation bits in the bitmap
  68.  
  69.  Parameters:    a       mandatory  's', 'a' or '1' will set to "allocated",
  70.                                    others will set to "free" state.
  71.  
  72.                 lsn     optional   Start LSN for the range, default is 'this'
  73.  
  74.                 s       optional   size for the LSN-range, default is 1
  75.  
  76.  Output:        none
  77.  
  78.  Remarks:       This is a potentially dangerous operation.
  79.  
  80.  
  81.  
  82.  BITMAP [xx s D] = Show bitmap at LSN xx, size s, in alloc or [D]ir format
  83.  
  84.  Purpose:       Show a bitmap located at specified LSN, alloc or DIR format
  85.  
  86.  Parameters:    xx      mandatory  LSN of a bitmap sector
  87.  
  88.                 s       optional   size to dump:  1..63   specifies sectors
  89.                                                  64..xxx  specifies bytes
  90.                                    Default is 4 sectors (default bitmap size)
  91.  
  92.                 D       optional   Directory-format flag
  93.  
  94.  Output:        One bitmap-graphic for the specified bitmap LSN.
  95.  
  96.  Remarks:       Specifying an LSN that is not a bitmap-LSN will result in
  97.                 a garbage bitmap display.
  98.  
  99.  
  100.  
  101.  CHECK   [drive] = Check filesystem integrity for drive-letter (CHKDSK)
  102.  
  103.  Purpose:       Perform a filesystem check, and report the found errors
  104.  
  105.  Parameters:    none
  106.  
  107.  Output:        Two lines for each sector in error that is found, the first
  108.                 lists the sector-number, where it is referenced from and a
  109.                 short description. The second line is an error description
  110.                 For HPFS the reported arrors are:
  111.  
  112.                 0x00000001  Linked to some structure, but not in allocation-map
  113.                 0x00000002  Allocated in allocation-map, but no known link
  114.                 0x00000004  HPFS shortname does not match DIR name
  115.                 0x00000008  Fnode is a directory but DirFlag is not set
  116.                 0x00000010  Fnode datalength greater than Dir-entry size
  117.                 0x00000020  Fnode datalength smaller than Dir-entry size
  118.                 0x00000040  Fnode datalength greater than allocated size
  119.                 0x00000080  Fnode datalength smaller than allocated size
  120.                 0x00000100  Checksum value is incorrect
  121.                 0x00001000  LSN does not point to valid dirblock
  122.                 0x00002000  LSN does not point to valid Fnode
  123.                 0x00004000  LSN does not point to valid Allocation sector
  124.                 0x00008000  LSN is too large for this volume
  125.                 0x00010000  Unreadable or corrupted CP-INFO sector
  126.                 0x00020000  Unreadable or corrupted CP-DATA sector
  127.  
  128.  Remarks:       Some of the errors are generic, but most are filesystem
  129.                 specific. The generic ones are also listed with the 'SLT'
  130.                 command in dfscmds.txt.
  131.  
  132.  
  133.  
  134.  DIRTY [clean|d] = Make HPFS dirty-bit Clean (avoids CHKDSK) or set it Dirty
  135.  
  136.  Purpose:       Modify the HPFS volumes 'dirty' state
  137.  
  138.  Parameters:    state   mandatory  'clean' will set it clean (no CHKDSK)
  139.                                    'dirty' will force CHKDSK on reboot
  140.                                     (unless clean shutdown done afterwards)
  141.  
  142.  Output:        super/spareblock written confirmation
  143.  
  144.  Remarks:       A volume is normally marked 'dirty' by the OS on the first
  145.                 write access to it, and set 'clean' on successfull shutdown.
  146.                 This means a hard crash will cause a CHKDSK on reboot
  147.                 It is most usefull from boot-diskettes (DOS or OS/2)
  148.  
  149.  
  150.  CS           = Calculate HPFS style checksum on last-read sector
  151.  
  152.  Purpose:       Show / check checksum on HPFS sector (super/spare)
  153.  
  154.  Parameters:    none
  155.  
  156.  Output:        Checksum value
  157.  
  158.  Remarks:       Only meaningful for superblock (10) and spareblock (11)
  159.                 These checksums are also stored by HPFS in the spareblock.
  160.  
  161.  
  162.  
  163.  DELFIND  [name] = Find deleted files, limit to FNODES containing [name]
  164.  
  165.  Purpose:       Find deleted files, with name starting at current LSN
  166.  
  167.  Parameters:    name        optional   part of filename wanted, not a true
  168.                                        wildcard, but may start and end in
  169.                                        a '*' character
  170.  
  171.  Output:        Find-result list (as "find -type:z") on screen and in memory
  172.  
  173.  Remarks:       All deleted files, or the ones where the FNODE sector contains
  174.                 the specified ASCII string, will be found and added to the list.
  175.  
  176.                 The [name] selection aims at the FILENAME part only, to select
  177.                 on part of the full-path for the file, use the wildcard select
  178.                 parameters on the DELSHOW and RECOVER commands
  179.  
  180.                 The [name] is NOT case-sensitive, and there is a slight chance
  181.                 of 'false-hits' when other parts of the FNODE contains the string
  182.  
  183.                 List can be manipulated as usual, best viewed with "delshow"
  184.  
  185.  
  186.  
  187.  DIRMAP          = Show directory band allocation and usage map
  188.  
  189.  Purpose:       Show usage of the pre-allocated directory-band
  190.  
  191.  Parameters:    none
  192.  
  193.  Output:        A single bitmap-graphic showing the allocation of the
  194.                 pre-allocated directory band.
  195.  
  196.  Remarks:       If 100% is allocated more directory information will be
  197.                 allocated elsewhere on the volume.
  198.  
  199.  
  200.  
  201.  FILEFIND [name] = Find normal files,  limit to FNODES containing [name]
  202.  
  203.  Purpose:       Find not-deleted files, where the FNODE contains a name,
  204.                 the found files can be copied to another disk using the
  205.                 RECOVER or SAVEAS commands, just as with deleted files.
  206.  
  207.  Parameters:    name        optional   part of filename wanted, not a true
  208.                                        wildcard, but may start and end in
  209.                                        a '*' character
  210.  
  211.  Options:       -c          start from current sector, not start of volume
  212.  
  213.  Output:        Find-result list (as "find -type:f") on screen and in memory
  214.  
  215.  Remarks:       All deleted files, or the ones where the MFT record contains the
  216.                 specified ASCII string, will be found and added to the list.
  217.  
  218.                 The [name] selection aims at the FILENAME part only, to select
  219.                 on part of the full-path for the file, use the wildcard select
  220.                 parameters on the DELSHOW and RECOVER commands afterwards.
  221.  
  222.                 The [name] is NOT case-sensitive, and there is a slight chance
  223.                 of 'false-hits' when other parts of the FNODE contains the string
  224.  
  225.                 List can be manipulated as usual, best viewed with "delshow" or
  226.                 the equivalent "list +f"
  227.  
  228.                 The names used will be significant in the first 15 characters only,
  229.                 the rest of the name will be replaced by hyphens ('-'). This is
  230.                 because the FNODE only stores the first 15 characters of the name.
  231.  
  232.  
  233.  \path-spec      = find and show file/directory specified by path-spec
  234.  
  235.  Purpose:       Locate the fnode for a known file- or directory
  236.  
  237.  Parameters:    path-spec          full path specification with no intervening
  238.                                    space after the '\' command character
  239.  
  240.                               or   absolute- or relative path specification
  241.                                    with an intervening space. If the path
  242.                                    does not start with a '\' it is relative
  243.                                    to the current directory (see CD cmd).
  244.  
  245.  Output:        Searchlist starting at the ROOT directory upto the requested
  246.                 file or directory. It is either followed by an error message
  247.                 if the path-spec was not found or by the display of the
  248.                 corresponding fnode information.
  249.  
  250.  Remarks:       The search algorithm depends on the ROOT fnode being known.
  251.                 When the superblock is corrupt this fnode can be resolved
  252.                 using the 'findroot' command.
  253.  
  254.  
  255.  
  256.  PATH     [n]    = Show all path-components for current fnode, upto root
  257.  
  258.  Purpose:       Show the directory-branch that contains current file/dir
  259.  
  260.  Parameters:    n           optional   Start LSN for the search
  261.  
  262.  Output:        One line for each found 'parent' directory, upto the root
  263.  
  264.  Remarks:
  265.  
  266.  
  267.  
  268.  CA   [lsn][opt] = Check Allocation for (current) fnode lsn
  269.  
  270.  Purpose:       Check allocation integrity for current fnode
  271.  
  272.  Parameters:    lsn         optional   LSN of the fnode
  273.                 opt         optional   Options:  v   = Verbose, show progress
  274.  
  275.  Output:        Σ           Start of an allocation-sector (heavily fragmented)
  276.                 »           Start of one file-extent (fragmented file)
  277.                 ·           One sector, green small dot is allocation OK
  278.                 ■           One sector, red big dot is allocation error
  279.  
  280.                 Also a summary is given with the number of (failed) sectors
  281.  
  282.  Remarks:       Fnode may be for a regular file (sectors must be ALLOCATED)
  283.                 or for a deleted file (sectors must be FREE)
  284.  
  285.  
  286.  
  287.  FINDBASE [t][l] = find the start of an HPFS partition by searching sectors
  288.  
  289.  Purpose:       Force a different partition start sector-nr for HPFS partition
  290.  
  291.  Parameters:    t       One or more sector-types to use in the search
  292.                         default is "spad", Super, Spare, Alloc and Dirblock
  293.                         f for fnode can also be used but is less reliable
  294.                 l       Sector-number to use as end for partition (optional)
  295.  
  296.  Output:        Search progress and final result when HPFS partition found
  297.  
  298.  Remarks:       Can be used if start of partition / partition-tables are bad
  299.                 Use the "fs hpfs" command first to force HPFS mode.
  300.  
  301.                 The old 'AUTOBASE' syntax is still accepted as a synonym ...
  302.  
  303.  
  304.  
  305.  FINDCP          = find the Codepage info sectors (before FIXCP and FIXSPARE)
  306.  
  307.  Purpose:       Find the first sector with codepage info for the partition
  308.  
  309.  Parameters:    none
  310.  
  311.  Options:       -All        Do not stop after first Codepage-sector is found,
  312.                             default is to stop searching after the 1st and
  313.                             probably only one is found.
  314.  
  315.  Output:        Search progress and codepage info when found
  316.  
  317.  Remarks:       DFSee internal administration is updated with the found
  318.                 location to be used by FIXCP and FIXSPARE commands.
  319.  
  320.  
  321.  
  322.  FINDROOT [n]    = find the Root directory without using the superblock
  323.  
  324.  Purpose:       Find the fnode for the ROOT directory, even if parts of
  325.                 the volume, including the superblock, are damaged.
  326.  
  327.  Parameters:    n           optional   Start LSN for the search
  328.  
  329.  Output:        Search-list starting at the first fnode encountered upto
  330.                 the fnode for the ROOT directory when found.
  331.  
  332.  Remarks:       Specifying a start lsn might be needed if reading at the
  333.                 start of the volume results in device errors, or if some
  334.                 fnodes in the sequence are corrupted.
  335.  
  336.  
  337.  FIXROOT         = Write the root-LSN found with the 'findroot' command back
  338.  
  339.  Purpose:       Fix bad Root-LSN pointer, after CHKDSK bugs or other damage
  340.  
  341.  Parameters:    none
  342.  
  343.  Output:        none
  344.  
  345.  Remarks:       It is better to lock the physical disk before writing to it
  346.  
  347.  
  348.  FIXBOOT         = Create HPFS bootsector from template and partition-table
  349.  
  350.  Purpose:       Fix corrupted bootsector for a HPFS partition
  351.  
  352.  Parameters:    none
  353.  
  354.  Output:        Progress and confirmation info
  355.  
  356.  Remarks:       This will create a valid bootsector based on WARP version 4
  357.                 bootsector code and size-info from the partition table and/or
  358.                 the HPFS superblock at relative sector 0x10.
  359.                 Only the bootsector is written, to make the partition boot
  360.                 properly, it might be needed to run 'sysinstx' afterwards
  361.  
  362.                 The partition-table info (type and size) must still be valid,
  363.                 or a valid superblock must be present, or both.
  364.  
  365.  
  366.  FIXSPARE  [lsn] = Create HPFS spareblock sector from superblock info
  367.  
  368.  Purpose:       Fix corrupted spareblock sector for a HPFS partition
  369.  
  370.  Parameters:    lsn         optional    Force this Codepage-lsn
  371.  
  372.  Output:        Progress and confirmation info
  373.  
  374.  Remarks:       This will create a valid spareblock sector based on the
  375.                 superblock and location of the codepages (use FINDCP first!)
  376.                 Only the spare- and superblock are written, including the
  377.                 checksum information
  378.  
  379.                 The partition-table info (type and size) must still be valid!
  380.  
  381.  
  382.  FIXCP     [lsn] = Write the CodePage-LSN found with the 'FINDCP' command back
  383.  
  384.  Purpose:       Fix bad CodePage-LSN pointer
  385.  
  386.  Parameters:    lsn         optional    Force this Codepage-lsn
  387.  
  388.  Output:        none
  389.  
  390.  Remarks:       This will only update the codepage reference in the spareblock
  391.                 Use the FIXSPARE command to recreate the entire spareblock.
  392.  
  393.  
  394.  FIXBS  [clear]  = Update bad-sector table with LSN's from DFS badsec-list
  395.  
  396.  Purpose:       Replace the internal HPFS bad-sector list with the DFS
  397.                 bad-sector list, or clear the list completely.
  398.  
  399.  Parameters:    clear   optional   Make internal and DFS bad-sector list empty
  400.  
  401.  Output:        none
  402.  
  403.  Remarks:       The list can be the result of the "scan", "getbs", "mem" or
  404.                 "import" cmd, allowing modification off-line with an editor.
  405.                 The OS/2 chkdsk command will give erroneous results on
  406.                 "reserved for system use" until the next reboot.
  407.                 It is better to lock the physical disk before writing to it
  408.                 See 'lock' and 'unlock' commands
  409.  
  410.  GETBS           = Read HPFS bad-sector table into DFS badsec-list
  411.  
  412.  Purpose:       Replace the DFS bad-sector list with the internal HPFS one
  413.  
  414.  Parameters:    none
  415.  
  416.  Output:        none
  417.  
  418.  Remarks:       none
  419.  
  420.  
  421.  
  422.  FIXCS           = Calculate checksums and write super- and spare-block
  423.  
  424.  Purpose:       (re)calculate the checksum for superblock and spareblock
  425.                 and write them both back to the disk
  426.  
  427.  Parameters:    none
  428.  
  429.  Output:        none
  430.  
  431.  Remarks:       none
  432.  
  433.  
  434.  
  435.  HPFSMAP   [all] = Show data-band allocation bitmaps, HPFS specific format
  436.  
  437.  Purpose:       Show usage and the distribution of data over the volume.
  438.  
  439.  Parameters:    any parameter will cause verbose format to be used
  440.  
  441.  Output:        A single bitmap-graphic for the entire volume or for each
  442.                 allocation-band when verbose format is selected
  443.  
  444.  Remarks:       System-reserved and Directory-band are indicated with 'S'
  445.                 and 'R' respectively. Other area's are filled in according
  446.                 to the degree of usage (allocation)
  447.  
  448.                 This is the renamed "ALLOC" command from older DFSee versions
  449.                 Without parameters it will show a single allocation-map for
  450.                 the whole volume with a fixed scale (Megabytes per character)
  451.                 so it can become quite large. With the 'all' parameter it will
  452.                 show a map for each of the 8 Mb allocation 'bands' which shows
  453.                 even more detail ...
  454.  
  455.                 The new generic "ALLOC" command also shows a map for the whole
  456.                 volume, but scales that to fit on about one screen/page.
  457.  
  458.  
  459.  
  460. D I A G R A M   O F   E X A M P L E   H P F S   S T R U C T U R E:
  461. ==================================================================
  462.  
  463.  Basic HPFS data-structure for Root-directory with AUTOEXEC.BAT, README file,
  464.  an OS2 subdirectory and lots of other files. The README file has it's data
  465.  allocated in 2 alloc-chunks.
  466.  
  467.  ╔═════════╗                  ╔══════════════════╗       ╔═══════╗
  468.  ║SUPER    ║              ┌──>║ DIR block        ║   ┌──>║ FNODE ║
  469.  ║         ║              │   ║                  ║   │   ║       ║
  470.  ║         ║    ╔═══════╗ │   ║┌────────────────┐║   │   ║       ║  ╔══════════
  471.  ║Root LSN ────>║ FNODE ║ │   ║│*Special**Start*│║   │   ║ ALLOC ──>║ DIR block
  472.  ╚═════════╝    ║       ║ │   ║│entry FNODE  LSN│║   │   ╚═══════╝  ║
  473.                 ║       ║ │   ║│BtreeDownPtr LSN│║   │              ║┌─────────
  474.                 ║ ALLOC ──┘   ║└────────────────┘║   │              ║│8514.RC
  475.                 ╚═══════╝     ║┌────────────────┐║   │              ║│entry FNO
  476.                               ║│OS2 (subdir)    │║   │              ║│BtreeDown
  477.                               ║│entry FNODE  LSN├────┘              ║└─────────
  478.  ┌─────────────────────────────┤BtreeDownPtr LSN│║                  ║┌─────────
  479.  │                            ║└────────────────┘║                  ║│ANSI.EXE
  480.  │                            ║┌────────────────┐║
  481.  │                            ║│Special-end     │║
  482.  │  ╔══════════════════╗      ║│entry FNODE  LSN│║       ╔══════════════════╗
  483.  └─>║ DIR block        ║      ║│BtreeDownPtr LSN├───────>║ DIR block        ║
  484.     ║┌────────────────┐║      ║└────────────────┘║       ║┌────────────────┐║
  485.     ║│*Special**Start*│║      ╚══════════════════╝       ║│*Special**Start*│║
  486.     ║│entry FNODE  LSN│║                                 ║│entry FNODE  LSN│║
  487.     ║│BtreeDownPtr LSN│║     ╔═══════╗                   ║│BtreeDownPtr LSN│║
  488.     ║└────────────────┘║  ┌─>║ FNODE ║                   ║└────────────────┘║
  489.     ║┌────────────────┐║  │  ║       ║                   ║┌────────────────┐║
  490.     ║│AUTOEXEC.BAT    │║  │  ║       ║  ╔═══════════     ║│PP... filename  │║
  491.     ║│entry FNODE  LSN├───┘  ║ ALLOC ──>║┌──────────     ║│entry FNODE  LSN│║
  492.     ║│BtreeDownPtr LSN│║     ╚═══════╝  ║│ 1st data-     ║│BtreeDownPtr LSN│║
  493.     ║└────────────────┘║                ║└──────────     ║└────────────────┘║
  494.     ║┌────────────────┐║                                 ║┌────────────────┐║
  495.     ║│OS1.. filename  │║                                 ║│README filename │║
  496.     ║│entry FNODE  LSN│║      ┌───────────────────────────┤entry FNODE  LSN│║
  497.     ║│BtreeDownPtr LSN│║      │                          ║│BtreeDownPtr LSN│║
  498.     ║└────────────────┘║      │                          ║└────────────────┘║
  499.     ║┌────────────────┐║      │                          ║┌────────────────┐║
  500.     ║│**Special**End**│║      │                          ║│XXX... filename │║
  501.     ║│entry FNODE  LSN│║      │                          ║│entry FNODE  LSN│║
  502.     ║│BtreeDownPtr LSN│║      │                          ║│BtreeDownPtr LSN│║
  503.     ║└────────────────┘║      │                          ║└────────────────┘║
  504.     ╚══════════════════╝      │                          ║┌────────────────┐║
  505.                               │                          ║│**Special**End**│║
  506.                               │                          ║│entry FNODE  LSN│║
  507.                               │                          ║│BtreeDownPtr LSN│║
  508.                               │                          ║└────────────────┘║
  509.                               │                          ╚══════════════════╝
  510.                               │
  511.                               │                    ╔════════════════════════╗
  512.                               │               ┌───>║┌──────────────────────┐║
  513.                               │               │    ║│ 1st data-sector      │║
  514.                               │               │    ║└──────────────────────┘║
  515.                               │               │    ║┌──────────────────────┐║
  516.                               │  ╔═══════╗    │    ║│ 2nd data-sector      │║
  517.                               └─>║ FNODE ║    │    ║└──────────────────────┘║
  518.                                  ║       ║    │    ╚════════════════════════╝
  519.                                  ║       ─────┘
  520.                                  ║ ALLOC ║         ╔════════════════════════╗
  521.                                  ║       ─────────>║┌──────────────────────┐║
  522.                                  ╚═══════╝         ║│ 3rd data-sector      │║
  523.                                                    ║└──────────────────────┘║
  524.     (c) 1995                                       ║┌──────────────────────┐║
  525.     J. v. Wijk                                     ║│ 4th data-
  526.  
  527.