home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 6 File
/
06-File.zip
/
dfsee510.zip
/
dfshpfs.txt
< prev
next >
Wrap
Text File
|
2003-01-14
|
24KB
|
527 lines
Display File Systems; version 5.08 01-01-2003 (c) 1994-2003; Jan van Wijk
----------------------------[ www.dfsee.com ]-------------------------------
C O N T E N T S:
================
Command reference = overview of HPFS specific commands
Detailed description = description for every command
Diagram of an example HPFS structure
C O M M A N D R E F E R E N C E:
==================================
HPFS specific commands
Active filesystem : HPFS, specific commands are:
\path-spec = find and show file/directory relative to root (FINDPATH)
ALBIT a [lsn s] = Set/reset allocation bit in bitmap for lsn-range
BITMAP [xx,s,D] = Show bitmap at LSN xx, size s, in alloc or [D]ir format
CA [lsn][opt] = Check Allocation integrity for (current) fnode lsn
DELFIND [name] = Find deleted files, limit to FNODES containing [name]
DIRTY [clean|d] = Make HPFS dirty-bit Clean (avoids CHKDSK) or set it Dirty
DIRMAP = Show directory band allocation and usage map
FILEFIND [name] = Find normal files, limit to FNODES containing [name]
FINDBASE [t][l] = find the start of an HPFS partition by searching sectors
FINDCP = find the Codepage info sectors (before FIXCP and FIXSPARE)
FINDROOT [n] = find the Root directory starting the search at LSN [n]
FIXBOOT = Create HPFS bootsector from template and partition-table
FIXBS [clear] = Update bad-sector table with LSN's from DFSee badsec-list
FIXCP [lsn] = Update spareblock with found LSN for codepage info
FIXCS = Calculate checksums and write super- and spare-block
FIXROOT = Update superblock with found LSN for root-directory
FIXSPARE [lsn] = Create HPFS spareblock sector from superblock info
GETBS = Read HPFS bad-sector table into DFSee badsec-list
HPFSMAP [all] = Show data-band allocation bitmaps, HPFS specific format
PATH [n] = Show all path-components for current fnode, upto root
For an up-to-date list of commands, use the '?' command
HPFS specific sector types (see ??? command)
'I' = File data 'E' = EA data
'A' = ACL data 'B' = Boot area
's' = HPFS superblock 'p' = HPFS spareblock
'H' = Hotfix table 'h' = Hotfix data
'x' = Bad sector-list 'X' = Bad sector
'S' = Spare dirblocks
'D' = Directory Fnode 'y' = Deleted Dir Fnode
'f' = File Fnode 'z' = Deleted FileFnode
'a' = Allocation block 'Z' = Deleted All-block
'd' = Directory block 'P' = Dir-band (free)
'Q' = Dir-band bitmap 'c' = Codepage info
't' = Codepage data 'i' = HPFS386 User-id
'm' = Bitmap Tables 'M' = Bitmap data
For an up-to-date list, use the '???" command
D E T A I L E D D E S C R I P T I O N:
========================================
ALBIT a lsn s = Set/reset allocation bit in bitmap for lsn-range
Purpose: Manually set or reset allocation bits in the bitmap
Parameters: a mandatory 's', 'a' or '1' will set to "allocated",
others will set to "free" state.
lsn optional Start LSN for the range, default is 'this'
s optional size for the LSN-range, default is 1
Output: none
Remarks: This is a potentially dangerous operation.
BITMAP [xx s D] = Show bitmap at LSN xx, size s, in alloc or [D]ir format
Purpose: Show a bitmap located at specified LSN, alloc or DIR format
Parameters: xx mandatory LSN of a bitmap sector
s optional size to dump: 1..63 specifies sectors
64..xxx specifies bytes
Default is 4 sectors (default bitmap size)
D optional Directory-format flag
Output: One bitmap-graphic for the specified bitmap LSN.
Remarks: Specifying an LSN that is not a bitmap-LSN will result in
a garbage bitmap display.
CHECK [drive] = Check filesystem integrity for drive-letter (CHKDSK)
Purpose: Perform a filesystem check, and report the found errors
Parameters: none
Output: Two lines for each sector in error that is found, the first
lists the sector-number, where it is referenced from and a
short description. The second line is an error description
For HPFS the reported arrors are:
0x00000001 Linked to some structure, but not in allocation-map
0x00000002 Allocated in allocation-map, but no known link
0x00000004 HPFS shortname does not match DIR name
0x00000008 Fnode is a directory but DirFlag is not set
0x00000010 Fnode datalength greater than Dir-entry size
0x00000020 Fnode datalength smaller than Dir-entry size
0x00000040 Fnode datalength greater than allocated size
0x00000080 Fnode datalength smaller than allocated size
0x00000100 Checksum value is incorrect
0x00001000 LSN does not point to valid dirblock
0x00002000 LSN does not point to valid Fnode
0x00004000 LSN does not point to valid Allocation sector
0x00008000 LSN is too large for this volume
0x00010000 Unreadable or corrupted CP-INFO sector
0x00020000 Unreadable or corrupted CP-DATA sector
Remarks: Some of the errors are generic, but most are filesystem
specific. The generic ones are also listed with the 'SLT'
command in dfscmds.txt.
DIRTY [clean|d] = Make HPFS dirty-bit Clean (avoids CHKDSK) or set it Dirty
Purpose: Modify the HPFS volumes 'dirty' state
Parameters: state mandatory 'clean' will set it clean (no CHKDSK)
'dirty' will force CHKDSK on reboot
(unless clean shutdown done afterwards)
Output: super/spareblock written confirmation
Remarks: A volume is normally marked 'dirty' by the OS on the first
write access to it, and set 'clean' on successfull shutdown.
This means a hard crash will cause a CHKDSK on reboot
It is most usefull from boot-diskettes (DOS or OS/2)
CS = Calculate HPFS style checksum on last-read sector
Purpose: Show / check checksum on HPFS sector (super/spare)
Parameters: none
Output: Checksum value
Remarks: Only meaningful for superblock (10) and spareblock (11)
These checksums are also stored by HPFS in the spareblock.
DELFIND [name] = Find deleted files, limit to FNODES containing [name]
Purpose: Find deleted files, with name starting at current LSN
Parameters: name optional part of filename wanted, not a true
wildcard, but may start and end in
a '*' character
Output: Find-result list (as "find -type:z") on screen and in memory
Remarks: All deleted files, or the ones where the FNODE sector contains
the specified ASCII string, will be found and added to the list.
The [name] selection aims at the FILENAME part only, to select
on part of the full-path for the file, use the wildcard select
parameters on the DELSHOW and RECOVER commands
The [name] is NOT case-sensitive, and there is a slight chance
of 'false-hits' when other parts of the FNODE contains the string
List can be manipulated as usual, best viewed with "delshow"
DIRMAP = Show directory band allocation and usage map
Purpose: Show usage of the pre-allocated directory-band
Parameters: none
Output: A single bitmap-graphic showing the allocation of the
pre-allocated directory band.
Remarks: If 100% is allocated more directory information will be
allocated elsewhere on the volume.
FILEFIND [name] = Find normal files, limit to FNODES containing [name]
Purpose: Find not-deleted files, where the FNODE contains a name,
the found files can be copied to another disk using the
RECOVER or SAVEAS commands, just as with deleted files.
Parameters: name optional part of filename wanted, not a true
wildcard, but may start and end in
a '*' character
Options: -c start from current sector, not start of volume
Output: Find-result list (as "find -type:f") on screen and in memory
Remarks: All deleted files, or the ones where the MFT record contains the
specified ASCII string, will be found and added to the list.
The [name] selection aims at the FILENAME part only, to select
on part of the full-path for the file, use the wildcard select
parameters on the DELSHOW and RECOVER commands afterwards.
The [name] is NOT case-sensitive, and there is a slight chance
of 'false-hits' when other parts of the FNODE contains the string
List can be manipulated as usual, best viewed with "delshow" or
the equivalent "list +f"
The names used will be significant in the first 15 characters only,
the rest of the name will be replaced by hyphens ('-'). This is
because the FNODE only stores the first 15 characters of the name.
\path-spec = find and show file/directory specified by path-spec
Purpose: Locate the fnode for a known file- or directory
Parameters: path-spec full path specification with no intervening
space after the '\' command character
or absolute- or relative path specification
with an intervening space. If the path
does not start with a '\' it is relative
to the current directory (see CD cmd).
Output: Searchlist starting at the ROOT directory upto the requested
file or directory. It is either followed by an error message
if the path-spec was not found or by the display of the
corresponding fnode information.
Remarks: The search algorithm depends on the ROOT fnode being known.
When the superblock is corrupt this fnode can be resolved
using the 'findroot' command.
PATH [n] = Show all path-components for current fnode, upto root
Purpose: Show the directory-branch that contains current file/dir
Parameters: n optional Start LSN for the search
Output: One line for each found 'parent' directory, upto the root
Remarks:
CA [lsn][opt] = Check Allocation for (current) fnode lsn
Purpose: Check allocation integrity for current fnode
Parameters: lsn optional LSN of the fnode
opt optional Options: v = Verbose, show progress
Output: Σ Start of an allocation-sector (heavily fragmented)
» Start of one file-extent (fragmented file)
· One sector, green small dot is allocation OK
■ One sector, red big dot is allocation error
Also a summary is given with the number of (failed) sectors
Remarks: Fnode may be for a regular file (sectors must be ALLOCATED)
or for a deleted file (sectors must be FREE)
FINDBASE [t][l] = find the start of an HPFS partition by searching sectors
Purpose: Force a different partition start sector-nr for HPFS partition
Parameters: t One or more sector-types to use in the search
default is "spad", Super, Spare, Alloc and Dirblock
f for fnode can also be used but is less reliable
l Sector-number to use as end for partition (optional)
Output: Search progress and final result when HPFS partition found
Remarks: Can be used if start of partition / partition-tables are bad
Use the "fs hpfs" command first to force HPFS mode.
The old 'AUTOBASE' syntax is still accepted as a synonym ...
FINDCP = find the Codepage info sectors (before FIXCP and FIXSPARE)
Purpose: Find the first sector with codepage info for the partition
Parameters: none
Options: -All Do not stop after first Codepage-sector is found,
default is to stop searching after the 1st and
probably only one is found.
Output: Search progress and codepage info when found
Remarks: DFSee internal administration is updated with the found
location to be used by FIXCP and FIXSPARE commands.
FINDROOT [n] = find the Root directory without using the superblock
Purpose: Find the fnode for the ROOT directory, even if parts of
the volume, including the superblock, are damaged.
Parameters: n optional Start LSN for the search
Output: Search-list starting at the first fnode encountered upto
the fnode for the ROOT directory when found.
Remarks: Specifying a start lsn might be needed if reading at the
start of the volume results in device errors, or if some
fnodes in the sequence are corrupted.
FIXROOT = Write the root-LSN found with the 'findroot' command back
Purpose: Fix bad Root-LSN pointer, after CHKDSK bugs or other damage
Parameters: none
Output: none
Remarks: It is better to lock the physical disk before writing to it
FIXBOOT = Create HPFS bootsector from template and partition-table
Purpose: Fix corrupted bootsector for a HPFS partition
Parameters: none
Output: Progress and confirmation info
Remarks: This will create a valid bootsector based on WARP version 4
bootsector code and size-info from the partition table and/or
the HPFS superblock at relative sector 0x10.
Only the bootsector is written, to make the partition boot
properly, it might be needed to run 'sysinstx' afterwards
The partition-table info (type and size) must still be valid,
or a valid superblock must be present, or both.
FIXSPARE [lsn] = Create HPFS spareblock sector from superblock info
Purpose: Fix corrupted spareblock sector for a HPFS partition
Parameters: lsn optional Force this Codepage-lsn
Output: Progress and confirmation info
Remarks: This will create a valid spareblock sector based on the
superblock and location of the codepages (use FINDCP first!)
Only the spare- and superblock are written, including the
checksum information
The partition-table info (type and size) must still be valid!
FIXCP [lsn] = Write the CodePage-LSN found with the 'FINDCP' command back
Purpose: Fix bad CodePage-LSN pointer
Parameters: lsn optional Force this Codepage-lsn
Output: none
Remarks: This will only update the codepage reference in the spareblock
Use the FIXSPARE command to recreate the entire spareblock.
FIXBS [clear] = Update bad-sector table with LSN's from DFS badsec-list
Purpose: Replace the internal HPFS bad-sector list with the DFS
bad-sector list, or clear the list completely.
Parameters: clear optional Make internal and DFS bad-sector list empty
Output: none
Remarks: The list can be the result of the "scan", "getbs", "mem" or
"import" cmd, allowing modification off-line with an editor.
The OS/2 chkdsk command will give erroneous results on
"reserved for system use" until the next reboot.
It is better to lock the physical disk before writing to it
See 'lock' and 'unlock' commands
GETBS = Read HPFS bad-sector table into DFS badsec-list
Purpose: Replace the DFS bad-sector list with the internal HPFS one
Parameters: none
Output: none
Remarks: none
FIXCS = Calculate checksums and write super- and spare-block
Purpose: (re)calculate the checksum for superblock and spareblock
and write them both back to the disk
Parameters: none
Output: none
Remarks: none
HPFSMAP [all] = Show data-band allocation bitmaps, HPFS specific format
Purpose: Show usage and the distribution of data over the volume.
Parameters: any parameter will cause verbose format to be used
Output: A single bitmap-graphic for the entire volume or for each
allocation-band when verbose format is selected
Remarks: System-reserved and Directory-band are indicated with 'S'
and 'R' respectively. Other area's are filled in according
to the degree of usage (allocation)
This is the renamed "ALLOC" command from older DFSee versions
Without parameters it will show a single allocation-map for
the whole volume with a fixed scale (Megabytes per character)
so it can become quite large. With the 'all' parameter it will
show a map for each of the 8 Mb allocation 'bands' which shows
even more detail ...
The new generic "ALLOC" command also shows a map for the whole
volume, but scales that to fit on about one screen/page.
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:
==================================================================
Basic HPFS data-structure for Root-directory with AUTOEXEC.BAT, README file,
an OS2 subdirectory and lots of other files. The README file has it's data
allocated in 2 alloc-chunks.
╔═════════╗ ╔══════════════════╗ ╔═══════╗
║SUPER ║ ┌──>║ DIR block ║ ┌──>║ FNODE ║
║ ║ │ ║ ║ │ ║ ║
║ ║ ╔═══════╗ │ ║┌────────────────┐║ │ ║ ║ ╔══════════
║Root LSN ────>║ FNODE ║ │ ║│*Special**Start*│║ │ ║ ALLOC ──>║ DIR block
╚═════════╝ ║ ║ │ ║│entry FNODE LSN│║ │ ╚═══════╝ ║
║ ║ │ ║│BtreeDownPtr LSN│║ │ ║┌─────────
║ ALLOC ──┘ ║└────────────────┘║ │ ║│8514.RC
╚═══════╝ ║┌────────────────┐║ │ ║│entry FNO
║│OS2 (subdir) │║ │ ║│BtreeDown
║│entry FNODE LSN├────┘ ║└─────────
┌─────────────────────────────┤BtreeDownPtr LSN│║ ║┌─────────
│ ║└────────────────┘║ ║│ANSI.EXE
│ ║┌────────────────┐║
│ ║│Special-end │║
│ ╔══════════════════╗ ║│entry FNODE LSN│║ ╔══════════════════╗
└─>║ DIR block ║ ║│BtreeDownPtr LSN├───────>║ DIR block ║
║┌────────────────┐║ ║└────────────────┘║ ║┌────────────────┐║
║│*Special**Start*│║ ╚══════════════════╝ ║│*Special**Start*│║
║│entry FNODE LSN│║ ║│entry FNODE LSN│║
║│BtreeDownPtr LSN│║ ╔═══════╗ ║│BtreeDownPtr LSN│║
║└────────────────┘║ ┌─>║ FNODE ║ ║└────────────────┘║
║┌────────────────┐║ │ ║ ║ ║┌────────────────┐║
║│AUTOEXEC.BAT │║ │ ║ ║ ╔═══════════ ║│PP... filename │║
║│entry FNODE LSN├───┘ ║ ALLOC ──>║┌────────── ║│entry FNODE LSN│║
║│BtreeDownPtr LSN│║ ╚═══════╝ ║│ 1st data- ║│BtreeDownPtr LSN│║
║└────────────────┘║ ║└────────── ║└────────────────┘║
║┌────────────────┐║ ║┌────────────────┐║
║│OS1.. filename │║ ║│README filename │║
║│entry FNODE LSN│║ ┌───────────────────────────┤entry FNODE LSN│║
║│BtreeDownPtr LSN│║ │ ║│BtreeDownPtr LSN│║
║└────────────────┘║ │ ║└────────────────┘║
║┌────────────────┐║ │ ║┌────────────────┐║
║│**Special**End**│║ │ ║│XXX... filename │║
║│entry FNODE LSN│║ │ ║│entry FNODE LSN│║
║│BtreeDownPtr LSN│║ │ ║│BtreeDownPtr LSN│║
║└────────────────┘║ │ ║└────────────────┘║
╚══════════════════╝ │ ║┌────────────────┐║
│ ║│**Special**End**│║
│ ║│entry FNODE LSN│║
│ ║│BtreeDownPtr LSN│║
│ ║└────────────────┘║
│ ╚══════════════════╝
│
│ ╔════════════════════════╗
│ ┌───>║┌──────────────────────┐║
│ │ ║│ 1st data-sector │║
│ │ ║└──────────────────────┘║
│ │ ║┌──────────────────────┐║
│ ╔═══════╗ │ ║│ 2nd data-sector │║
└─>║ FNODE ║ │ ║└──────────────────────┘║
║ ║ │ ╚════════════════════════╝
║ ─────┘
║ ALLOC ║ ╔════════════════════════╗
║ ─────────>║┌──────────────────────┐║
╚═══════╝ ║│ 3rd data-sector │║
║└──────────────────────┘║
(c) 1995 ║┌──────────────────────┐║
J. v. Wijk ║│ 4th data-