Some senseless babbling from Peter Knapper to All
on 12-07-99 21:10 about HPFS Directories....
PK> Hi Folks,
PK> A simple question.......;-) Where is the FIRST root directory entry
PK> located on an HPFS volume? I know that HPFS uses a directory recording
PK> methodology similar to a B-Tree, and it writes files in BANDS across
PK> the partition, however the very FIRST directory entry MUST be located
PK> somewhere that can be calculated as a FIXED location for that
PK> particular partition. Alternatively there must be a data structure
PK> within an HPFS partition that contains details of the partition
PK> "layout". Now how can I find out where that location is?
ftp://hobbes.nmsu.edu/pub/incoming/hpfsut02.zip
or
ftp://hobbes.nmsu.edu/pub/os2/util/disk/hpfsut02.zip
Most of the information I used to write that program can be found at:
http://www.edm2.com/
Meta Index -> OS/2 -> High Performance File System
PK> My need is thus. I have a 2GB partition located in the middle of a
PK> drive (other paritions before and after it) that is _SOMETIMES_
PK> corrupting its Root directory entry or a pointer to the Root directory
PK> entry, if there is a power failure and the system is not shut down
PK> cleanly. If it IS shutdown cleanly, the next boot up is fine and all is
PK> well. If a startup invokes CHKDSK, it compains that it "cannot find the
PK> Directory \", and it then tries a recovery which locks the machine
PK> SOLID after 173 files have been found! I have to boot from Floppy and
PK> run CHKDSK from the commandline. In this case CHKDSK E: /F:2 detects
PK> the exact same problem, but it succeeds in fixing it and recovers ALL
PK> the files EVERY TIME! These files are perfect with no errors. I can
PK> then place them back where they belong, and everything works perfect,
PK> until the power fails again.......;-( Also interesting is that only
PK> FILES are lost, never Sub-directories (there are about 15,000 files on
PK> the volume).
PK> My thinking is that if the HD has a faulty track right at the begining
PK> of the partition I can shrink the partition and leave that Cylinder
PK> free. With FAT this could work, but with HPFS I am not so sure.
PK> Ultimately I need a new drive, but I was just wondering if I can work
PK> around this.
PK> Any useful bits of info appreciated.
As you'll find if you look over the program to which I referred to, the
location of the root directory FNode is pointed to by offset 0x0c in the
SuperBlock sector, which is logical sector number 16 (where the boot sector
is LSN 0). It will inevitably be located at the sector immediately
following the directory band, and the 20 spare directory blocks (towards
seek-center on the drive).
If that sector is flaky, you're likely to run into more problems than just
a missing root directory. As far as I know, there's no provision to
automatically relocate the SuperBlock, which makes sense given the fact
that its location is fixed, and not pointed to by any other structure.
Shrinking the partition as you say should work, if that's the source of the
problem. It's not, of course, as simple as modifying the partition table
entry. You'll need to use something like Partition Magic, or do a
backup/partition/restore.
Mike Ruskai
thannymeister@yahoo.com
... OS/2 users do EVERYTHING while formatting floppy disks.
___ Blue Wave/QWK v2.20
--- Platinum Xpress/Win/Wildcat5! v3.0pr2
138/2
* Origin: FIDO QWK MAIL & MORE! WWW.DOCSPLACE.ORG (1:3603/140)
|