home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
hd
/
b192_1
/
!Help
< prev
next >
Wrap
Text File
|
1994-03-13
|
13KB
|
334 lines
> !Help file for MapManager v0.50 13 Mar 1994
—————————————————————————————————————————————
(Please note: MapManager needs RISC OS 3 to run.)
Before giving this software to anybody else, please read the section called
'Distribution' below.
The MapManager Module
−————————————————————
This module was written to help examining or even repairing harddiscs which
maps do not correspond completely to the directory tree. Such HDs will
respond to a *CheckMap command with the error message
'Map inconsistent with directory tree'
or alternatively hang the machine, depending on the nature of the fault.
CheckMap only does a simple integrity check and can't tell which files are
affected. The command *MapCheck supplied by the MapManager module lists the
offending fragments so you can assess the severity of the error.
Alternatively, it is possible for *CheckMap to hang, when it can't find all
the fragments for a file.
What can MapManager do? Well, in most cases it can't relieve you from the
need to reformat the disc and restore its contents from a backup. However, it
gives you the chance to see which files are endangered and could contain
garbage. Later versions might include commands to modify the map or directory
tree to restore a harddisc without reformatting.
FileCore E-Format
—————————————————
The FileCore E format is a very advanced file storage system. Most other
filing systems are FileCore based and effectively pass all calls through to
FileCore. MapManager only works on FileCore based filing systems.
(This is only a short description of FileCore's E-Format. For more detailed
information see Acorn's Programmer's Reference Manuals for RISC OS 3.)
Under FileCore files are a stream of bytes, identified by their system
internal number SIN. Filename, SIN, length, access attributes etc. are stored
in the directory tree. The SIN acts as the filenumber, except in the special
case where a fragment is shared between files.
The directory tree consists of the root directory (file number 2) and its
subdirectories, which on this level are ordinary files (i.e.., they have a
file number).
The map consists of several zones, with each map zone block the size of a
sector. Depending on the BitSize and sector size each zone represents roughly
a few megabytes of disc space.
Each bit in the map represents a fixed number of bytes of disc space, the
BitSize. This BitSize - often called something else (Acorn calls it bpmb -
bytes per map bit) - can (or rather should) be set when formatting the disc.
Large values speed up disc access somewhat and reduce the size of the map
(because more disc space is mapped into each map bit). However, as there is a
minimum length of some 15 bits for each fragment the minimum space allocated
for a file may be rather large; a bitsize of 2K translates to a minimum
allocation unit of 26 Kbytes. If you want to store a number of big files this
is not important, but for highly structured discs (with lots of Impression
documents, say) losing dozens of kilobytes for each subdirectory is something
to avoid.
To partly overcome the problem of minimal size fragments sharing as allowed.
Directories can share fragments with their sub files and files in the same
directory can share a fragment. Thus several files can have the same file
number (aka fragment ID), but they have different offsets into the fragment.
The SIN, which contains both file ID and offset (if applicable), is unique
for each object.
Repairing the Map
—————————————————
As yet no commands to write the map to disc are implemented.
Actually I'm not sure whether such a command is needed at all (except when
MapCheckSums reports errors) as RISC OS is sturdy enough to cope with
slightly inconsistent maps - so don't panic!
Commands provided
—————————————————
(Note: <disc spec.> below must contain the drive number rather than the disc
name, i.e. scsi::4, adfs::0 etc..)
*MapCheck [<options>]
MapCheck compares a disc map against the directory tree of that disc.
Options:
A(ll) Also print files that check out OK {off}
V(erbose) Print information on each file {off}
C(onfirm) Prompt for confirmation of each write operation; only useful
in conjunction with the remove option {on}
reM(ove) Try to remove excess space allocated to a file {off}
The reMove options tries to remove excess fragments RISC OS seems to tack at
the end of certain files. It only uses OS routines (it's playing with the
file extent), but nevertheless MapManager asks you before it modifies
anything (this can be switched off with the ~C option).
All causes MapCheck to print all files (ordinarily only 'faulty' files would
get printed).
Verbose lists the allocated fragments for each printed file.
Some possibly useful 'AV' combinations:
<none> This is the fastest way to check the disc. Please note that this
might still take several minutes, and only lists the offending files.
V Probably the most useful of the set. It lists all faulty files and
their allocated fragments, thus you can spot immediately double
allocated files etc.
A Lists all files (with their system internal number only), with an
additional message if any should be faulty. Also when MapCheck
finally looks for lost fragments it lists unused parts of shared
fragments. These are NOT error; it just means that some disc space
could not be used due to FileCore's minimum allocation size.
AV For those who want to know everything.
For medium and large harddiscs the output generated by the A option might be
larger than 1Mbyte; keep this in mind if you spool it to a floppy.
*MapCheckSums [<disc spec.>]
MapCheckSums re-calculates the checksum bytes of the map. If any bytes are
incorrect it allows you to correct them. Currently this only works if the
disc is recognized by FileCore, i.e. if all checks turn out OK in the first
place, which makes this command rather useless for now.
*MapFindID [<disc spec.>] <ID number>
MapFindID scans the specified map for the given ID (hexadecimal). Free space
fragments are ignored.
*MapFree [<disc spec.>]
MapFree checks the free space chain. It lists two 'bytes free' counts: the
first is the real amount of disc space unallocated, the second figure is the
same as returned by *Free; don't be alarmed if this numbers differ. The *Free
value doesn't seem to be calculated in any way but instead is updated
whenever you save/delete a file, and adjusts automatically if it would become
negative or on a *CheckMap command.
*MapInfo [<disc spec.>]
MapInfo gives more detailed information about the loaded disc map. The
allocation unit is probably the most interesting bit.
*MapZone [[<disc spec.>] <zone number>]
MapZone lists all fragments in the given zone. Free space fragments are
displayed as 'free space', so you should never see ID 0 etc.
*FindID [<disc spec.>] <file ID>
FindID scans the directory tree for the given file number. It reports name
and size of the object(s) that match the file number.
Example MapManager Session
——————————————————————————
*MapManager | load the module
*MapInfo scsi::4| not strictly necessary, but do it the first time
| to ensure the correct map has been loaded
Disc name: LPS120S size: 117 Mbytes
ID:95EF density: harddisc
sector size: 512 bytes bit size: 256 bytes cluster size: 512 bytes
Number of zones: 118 zone size: 1040384 bytes zone 0 size: 917504 bytes
Map size: 60416 bytes disc address: &83A6C000 memory address: &018CC000
IDfield length: 15 bits allocation unit: 4096 bytes unused map bits: 0
| looks good so far, so continue
*spool ram:MapLog
*MapFree
Disc name: LPS120S density: harddisc size: 117 Mbytes
Zone 0 : (full)
Zone 1 : (full)
Zone 2 : ( 1A400, 54200)
Zone 3 : ( 12E00, 6C200)
Zone 4 : ( 6E400, 2F400)
Zone 5 : ( D600, 15C00)
Zone 6 : ( 61400, 9EC00)
Zone 7 : ( 62A00, 1A800) ( D7400, 6600)
Zone 8 : (full)
...
Zone 117 : (full)
Total free space: &01025A00, stored in disc record: &01025A00
| free space chain is OK (no error msgs)
| now test the directory tree - map integrity
*MapCheck | this may take a while (several minutes)
*** Fragment(s) too short or missing / too long or too many ***
$.Apps.Graphics.!Graphs.Examples.spiral
--- allocated in map: &00000800, needed: &00000400
| too bad; perhaps re-run with V option
Looking for bad fragments ...
Lost fragment: ( 2F4200, BE00); ID=&00741B
Lost fragment: ( 5DF9200, 6E00); ID=&0037EB
Lost fragment: ( 5E2AA00, 2E00); ID=&0037EB
Lost fragment: ( 5EB2600, 3200); ID=&0037EB
Lost fragment: ( 72C5A00, 1E600); ID=&006D38
Total number of bytes lost: &00037200 = 225792
| OK, I can live with that
Total number of over-allocated bytes: &0000000 = 0
| If this return non-zero it's time to panic...
| ...after you calmed down, do the following:
| a) Make a complete backup
| b) Use a spooled MapCheck output to determine
| which files are damaged & check them
| c) Format your HD; simply writing an empty
| directory structure (as offered by some
| formatting programs) is sufficient.
If it doesn't work...
—————————————————————
• did you load the correct map? (try *MapInfo)
• is it an E format disc (*Map should say 'new map, new directories' on top)
Bugs
————
• Should be able to recognise non-E-Format (indeed, non-FileCore) discs.
• MapFree checks the free fragment chain more thoroughly than MapCheck, so
use it!
• MapCheck only list fragment clashes, it doesn't list the files affected.
• Apart from the rather trivial file extent correction mentioned above,
MapManager still can't repair the disc map or the directory tree. I really
hope to implement it in a future release.
Glossary
————————
• File ID
• Fragment ID
• Filenumber
I use these interchangeably; normally fragment ID is used when talking about
different fragments, while file ID or filenumber refers to the object.
• Object
In RISC OS, an object is either a file or directory. Note that 'file ID'
should be really called 'object ID' because directories have an ID as well.
(Acorn has changed the terminology in the new PRMs. So far I had no time to
make this text conform to them - sorry.)
Acknowledgments
———————————————
Dominic Symes for the best ever text editor Zap - highly recommended.
Walter Meyer for providing his map progs and daring to test the alpha
versions.
Chris Poole for his fsfschk program, some ideas of his code were incorporated
into MapManager. (the modifying disc bits haven't made it yet - sorry.)
Acorn for building one of the best computer platforms, and supplying one of
the best operating systems with it. Parts of this help file and a few bytes
of code were take from Acorn's documents.
Distribution
————————————
The module MapManager and its source code are copyright Holger Klingspohr
1993 & 1994. I offer no guarantees as to the reliability or stability of
MapManager or the correctness of the technical details outlined in this
document.
You may copy the program freely provided that the whole application remains
unaltered. You may not sell the program without my written permission. You
must not distribute this software for commercial gain. However, Public Domain
libraries may distribute the program provided they charge at most 3 pounds
sterling per disc. If anyone one else would like to distribute MapManager
then please [e-]mail me first to get my permission.
MapManager is distributed complete with source code. Feel free to use chunks
of code in your own freeware programs, but please acknowledge me somewhere in
your documentation. To re-assemble the complete module you will obviously need
the relevant header files. Again, if you want to use parts of MapManager in
commercial code please get in touch with me.
Please send any bug fixes or other improvements to me so I can modify the
master copy. If this includes some code fragments - so much better, but
please do not distribute a modified ('hacked') version.
Holger Klingspohr
Ebelingstr. 1 / 6.3.2.e
D-21073 Hamburg
Germany
email: klingspohr@tu-harburg.d400.de
Change Log:
———————————
0.26 23 May 1993 first alpha release, didn't even work correctly on my setup
0.30 13 Jun 1993 second alpha release, first try to handle bitsizes greater
than than the sector size correctly; seems to work
0.32 22 Jun 1993 first beta release. MapZone & FindID tools added
0.33 26 Jun 1993 now reports clashing fragments & floppy density correctly;
also spellchecked this help file
0.34 28 Jun 1993 second beta release. cleaned up things generally
0.35 02 Jul 1993
0.40 11 Jul 1993 started to speed up MapCheck
0.48 12 Dec 1993 third beta release
0.49 13 Mar 1994 [release] speeded & tidied up a bit