[comp.sys.amiga.tech] Recovering data from hard disk

nix@stekt.oulu.fi (Tero Manninen) (09/17/90)

I seem to have a nasty problem with my 30M Seagate..
This began when my other hard disk stopped to work (the 20M drive
inside A590) and I tried to reformat it.  Accidentally I formatted a
few cylinders from my healthy scsi disk (not low level format).
The scsi disk had two partitions in it and both were after that
"Not a DOS disk" :-(
So I tried to set partition information back with Supra controller
(I had not reformatted the disk after I switched to A590 controller).
But still no luck..

Now when I am trying to recover the files from the second partition
I get DiskSalv errors (the block difference stays at 202 blocks):
 FILE ":LOOSE-BLOCKS/DIRBLK-20800/indent.doc.Z" Block Key Mismatch:
 21066 != 20864

With the first partition I get errors like this (diff 102 blocks):
 FILE ":LOOSE-BLOCKS/DIRBLK-10406/Calc" Block Key Mismatch:
 10332 != 10434

The recovered files are pure garbage.. I suspect that they are 202 and
102 blocks off the real data.
Is there any way to change this block offset ?
I already tried to change disk partitioning but it works by cylinders,
not blocks..

Oh, I was just to forget.. the DiskSalv is v1.42, very nice program.

++Tero

daveh@cbmvax.commodore.com (Dave Haynie) (09/18/90)

In article <NIX.90Sep16231320@stekt.oulu.fi> nix@stekt.oulu.fi (Tero Manninen) writes:

>Now when I am trying to recover the files from the second partition
>I get DiskSalv errors (the block difference stays at 202 blocks):
> FILE ":LOOSE-BLOCKS/DIRBLK-20800/indent.doc.Z" Block Key Mismatch:
> 21066 != 20864

>With the first partition I get errors like this (diff 102 blocks):
> FILE ":LOOSE-BLOCKS/DIRBLK-10406/Calc" Block Key Mismatch:
> 10332 != 10434

>The recovered files are pure garbage.. I suspect that they are 202 and
>102 blocks off the real data.

It sure sounds like, somehow, your partition information is confused.

>Is there any way to change this block offset ?
>I already tried to change disk partitioning but it works by cylinders,
>not blocks..

DiskSalv thinks in terms of blocks, but it generates its block information
based on the environment vector for the drive in question, which is based
on cylinders.  Specifically, the formula used is:

	LoBlock = LoCylinder * NumHeads * NumSectors

The BYTE offset of a sector (block) on a partition (BYTE offsets are required 
by the device driver interface) are given by:

	ByteOffset = BLOCKSIZE * (LoBlock + sector)

If the partitions you're getting from your automounting drive don't look good
to DiskSalv, you may have one or more of these partition numbers corrupted.
It's a good idea to figure out what the device is logically formatted to; on
SCSI devices, the physical Head, Cylinder, and Sector numbers aren't always
used; the total number of blocks is what counts, and the Head, Cylinder, and
Sector numbers your device has been formatted to determines how stuff was
written on the disk.  You can write up a dummy partition, if you like, using
a Mountlist, and give that to DiskSalv instead of the automounting partitions,
if that's easier.  Just create a MountList entry, Mount it, and give that 
name to DiskSalv as an input file.  It probably wouldn't be too difficult to
write a small utility that does this automatically.

These errors from DiskSalv sometimes show up with disks that have had different
partitions on them over their lifetime.  In that case, there would probably be 
a number of bogus files along with the good ones, but there will be good ones.
If everything is consistently offset, you probably have bad partition 
information for your main disk.

>Oh, I was just to forget.. the DiskSalv is v1.42, very nice program.

Thanks!  DiskSalv V2.00, available possibly in early 1991, will be much nicer
I think.  While it's far from complete, an early DS V2.00 did recover 
everything from a disk that confused V1.42.  One of the flaws in V1.42 is that
it doesn't fully handle the problems that crop up on a disk with a long
history, where there may have been multiple partitions or other quirks that
develop on a disk that's been in use for many years.  This stuff just keeps
getting trickier....

>++Tero


-- 
Dave Haynie Commodore-Amiga (Amiga 3000) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
      Get that coffee outta my face, put a Margarita in its place!

billsey@agora.uucp (Bill Seymour) (09/18/90)

In article <NIX.90Sep16231320@stekt.oulu.fi> nix@stekt.oulu.fi (Tero Manninen) writes:
:I seem to have a nasty problem with my 30M Seagate..
:This began when my other hard disk stopped to work (the 20M drive
:inside A590) and I tried to reformat it.  Accidentally I formatted a
:few cylinders from my healthy scsi disk (not low level format).
:The scsi disk had two partitions in it and both were after that
:"Not a DOS disk" :-(
:So I tried to set partition information back with Supra controller
:(I had not reformatted the disk after I switched to A590 controller).
:But still no luck..
:
:Now when I am trying to recover the files from the second partition
:I get DiskSalv errors (the block difference stays at 202 blocks):
: FILE ":LOOSE-BLOCKS/DIRBLK-20800/indent.doc.Z" Block Key Mismatch:
: 21066 != 20864
:
:With the first partition I get errors like this (diff 102 blocks):
: FILE ":LOOSE-BLOCKS/DIRBLK-10406/Calc" Block Key Mismatch:
: 10332 != 10434

	OK, what it looks like has happened here is you have the break
	between the first partition and the second partition offset by
	a cylinder or two. Take a look at the drive info (blocks/track
	and number of surfaces) to figure out exactly how many cylinders
	they are off from what they're supposed to be. Then use SupraFormat
	to move the ending cylinder on the first partition and the starting
	cylinder on the second partition to reflect this. you should be
	able to reboot and find pretty much everything under a 'normal'
	filesystem. The few cylinders that got formatted won't have data
	on them, and any files that were stored in that area won't be
	recoverable.

	It's also possible that the drive parameters are different between
	the two controller softwares. I know that my Maxtor XT-3280S
	which has 1224 cylinders, 25 sectors/track and 15 surfaces shows
	up on the 3000 as 1310 cylinders, 350 sectors/track and one
	surface. Very close to the same number of total blocks, but
	confusing at times...

:The recovered files are pure garbage.. I suspect that they are 202 and
:102 blocks off the real data.
:Is there any way to change this block offset ?
:I already tried to change disk partitioning but it works by cylinders,
:not blocks..

	Again, tweak the drive parameter info to make a change in the
	nuber of cylinders match the number of blocks you need. The
	drive parameters you come up with don't have to actually match
	the physical drive, since SCSI just works on logical block
	numbers...

:Oh, I was just to forget.. the DiskSalv is v1.42, very nice program.
:
:++Tero


-- 
     -Bill Seymour             ...tektronix!reed!percival!agora!billsey
=============================================================================
Bejed, Inc.       NES, Inc.        Northwest Amiga Group    At Home Sometimes
(503) 281-8153    (503) 246-9311   (503) 656-7393 BBS       (503) 640-0842

nix@stekt.oulu.fi (Tero Manninen) (09/21/90)

Dave Haynie writes:

> You can write up a dummy partition, if you like, using a Mountlist,
> and give that to DiskSalv instead of the automounting partitions,
> if that's easier.  Just create a MountList entry, Mount it, and give that 
> name to DiskSalv as an input file.  It probably wouldn't be too difficult
> to write a small utility that does this automatically.

I did just that and found the second partition being 100% ok.
The first partition should be now fine with DiskSalv since only a few
cylinders got formatted.
It was my luck that I found an old SupraFormat generated MountList..


Bill Seymour writes:

>	   It's also possible that the drive parameters are different between
>	   the two controller softwares. I know that my Maxtor XT-3280S
>	   which has 1224 cylinders, 25 sectors/track and 15 surfaces shows
>	   up on the 3000 as 1310 cylinders, 350 sectors/track and one
>	   surface. Very close to the same number of total blocks, but
>	   confusing at times...

Yes, the problem was that A590 thought my Seagate was a bit different
from what Supra knew..
Supra: Cylinders 1-604, Heads 4, Sectors/Cyl. 26
A590:  Cylinders 2-610, Heads 1, Sectors/Cyl. 103

I don't know exactly how many blocks my drive has (Seagate model
138(something)) but both come close to the same number.
(Supra seems to reserve only one cylinder for the partition information
 unlike A590).

++Tero