home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
620.lha
/
rdb
/
rdb.doc.pp
/
rdb.doc
Wrap
Text File
|
1992-03-05
|
6KB
|
139 lines
rdb
Copyright © 1992, by Larry Phillips
LEGAL: Ugh, but it has to be said.
This program is copyright. It is not public domain. It is, however,
freely distributable. This means that you may use it and pass it
around by any means you see fit, as long as there is no extra charge
for it, over and above the cost of the media on which it is stored,
and in the case of it being on a BBS or information network, that
there is no extra charge over and above connect-time charges for
downloading it. No commercial use of this program is allowed without
prior arrangements with the author. This document must accompany the
executable program.
Use this program at your own risk. While I have attempted to test
the operation fully, you must recognize that bugs can lurk, and that
it is a dangerous program if used improperly, and I will not be
responsible for any damages, however caused.
This is not a shareware product, but I will not throw out any
contributions you care to make, be they cash, letters, postcards, or
macadamia nuts (yes, Dave Haynie is not the only one addicted to
them).
--------------------------------------------------------------------
PURPOSE: Why I wrote this program.
Hard drives on the Amiga are usually automounted by means of data
stored in the first two cylinders on the drive. These sectors contain
data known as the 'RigidDiskBlocks' (RDBs), or 'hardblocks'. They are
vital to automounting, and contain a number of required parameters
that AmigaDos uses to access the partitions on the drive. If they are
damaged, your drive will either mount improperly, or not at all. RDBs
are generally placed on the drive by the hard disk preparation
software supplied with your host adapter (commonly called a controller
in Amiga circles).
The purpose of rdb is to allow you to save and restore these sectors.
There are a number of reasons you might want to have the RDB
information handy. A disk error could cause the RDBs to be corrupted,
or you might want to set up a replacement drive with the same
parameters as the one being replaced. In either case, it will be
faster to use rdb than the hard drive preparation software, and you
will not have to remember how you had the drive set up.
If your RDBs become corrupted, using rdb with the RESTORE option will
leave your data in the AmigaDos partitions intact. Note that if the
corruption extended into any of the AmigaDos partitions, rdb will
leave it alone too, and the data in the corrupted partitions will not
be valid (rdb is NOT magic, so it will not recover the data itself).
I suppose it's obvious, but I'll say it anyway; You must have previously
used rdb with the SAVE option, in order to use the RESTORE option.
Operation is fairly simple, though you should pay close attention to
the commands you use, noting that this program does play with the very
heart of the hard drive automounting data. It will not knowingly let
you restore an invalid RDB, but error checking is minimal, and only
done on the first block of the RDB (the RDSK data structure).
----------------------------------------------------------------------
USAGE: How to do it.
To use rdb from the command line (WorkBench operation is not
supported):
rdb devicename unit <SHOW/SAVE/RESTORE> [filename]
devicename: The name of the device driver for your hard drive
examples: scsi.device, hardframe.device, etc.
unit: the unit number for the drive you want to work with
examples: 1, 2, 13, etc. (13 would be target 3, LUN 1)
SHOW/SAVE/RESTORE: You must use one of these options. See below.
filename: optional. Name of a file to save to or restore from.
OPTIONS: Shown in upper case, but may be entered in lower case.
SHOW: displays the RDSK data structure, which is the first block in
the RDBs. The SHOW option does not check the RDSK data
structure for validity, and will show the first block
regardless of contents. This is in case of corrupted data.
The contents of the forst block might point you toward the
cause of the corruption.
SAVE: Reads the entire RDB area from the drive, and saves it to a
file. Note that this is overkill in most cases, since the RDBs
seldom use the entire area reserved for RDBs. Will not
knowingly save an invalid RDB, though only the RDSK data
structure is checked. See below for filename conventions.
RESTORE: Restores the RDBs from a file. Will not knowingly restore an
invalid RDB, though only the RDSK data structure is checked.
See below for filename conventions.
FILENAMES: If you do not supply a filename for the save or restore
operations, one will be provided for you. The filename will
be named in the format: 'devicename-unit.rdb'. An example
would be 'scsi.device-3.rdb', indicating that unit 3 of
scsi.device was the drive specified in the command line.
---------------------------------------------------------------------
EXAMPLE USAGE:
rdb scsi.device 3 show
Displays the first block of the RDBs for the hard drive on
scsi.device, SCSI target address 3
rdb hardframe.device 2 save
rdb hardframe.device 2 save rdb2
Reads and saves a copy of the RDBs for the drive on
hardframe.device, SCSI target address 2. The first example
would generate a file called 'hardframe.device-2.rdb', and the
second would create a file called 'rdb2'.
rdb foodisk.device 6 restore
rdb foodisk.device 6 restore foo6.rdb
Reads the RDBs from a file and writes them to the RDB area for
the drive on foodisk.device, unit 6. The first example will
read its data from a file called 'foodisk.device-6.rdb', and
the second will read its data from a file falled 'foo6.rdb'.