[comp.sys.amiga] Help! my hard disk won't validate

hoge%afsc02.decnet@hqafsc-vax.arpa (AFSC02::HOGE) (08/09/88)

Help Me!!!

I had a prcedure running last night that was writing to a file on my FFS hard
disk partition when I had a guru (thank's multitasking!). We'll now I've got a
bad file on the drive and it won't validate. Won't let me delete it (the file)
or anything and "list" shows it as being empty. What do I need to do to
straighten it out. HEEELLLLPPPPP!

Thanks,
Scott Hoge
TRW Inc.
hoge@hqafsc-vax.arpa
------

pnelson@antares.UUCP (phil nelson) (08/10/88)

In article <3661@louie.udel.EDU> hoge%afsc02.decnet@hqafsc-vax.arpa (AFSC02::HOGE) writes:
>Help Me!!!
>
>I had a prcedure running last night that was writing to a file on my FFS hard
>disk partition when I had a guru (thank's multitasking!). We'll now I've got a
>bad file on the drive and it won't validate. Won't let me delete it (the file)
>or anything and "list" shows it as being empty. What do I need to do to
>straighten it out. HEEELLLLPPPPP!
>

Ok, my 2nd posting (I think) -note: mail re:netiquette issues welcome

Probably you will get better answers than mine, but here goes-

 I trashed my JH0: the other night, while running Compress -d on a file I
captured. Amiga gurued, when I rebooted, JH0: wouldn't validate. After I
wished that I had done my backups more often, it occured to my to try a
backup on the bad disk. I used Quarterback, (with a new backup set, NOT my
old backup disks) it backed up all 20meg, except for the garbled file,
which it skipped after complaining some. I then reformatted the disk and
restored. Thanks, Central Coast Software!

 Last night, I had more problems, (I ran out of disk space using Compress -d,
and she gurued after I deleted some files and then ran zoo on some more). This
time, the disk was validated but I had an empty file and suspected that some
of my disk space was in never-land. Since I had (this time) a backup, I tried
diskdoctor on JH0:. It did a better job than I expected, but not good enough
(I am going to restore from the backup tonight). I did notice that it
recovered some of the files that I had deleted. After --ALL-- else fails, you
might try DiskDoctor.

>Thanks,
>Scott Hoge
>TRW Inc.
>hoge@hqafsc-vax.arpa
>------

Philip Nelson

P.S. I have no association with the manufacturers of Quarterback, except as a
satisfied customer.

{ames|pyramid}oliveb!tymix!antares!pnelson  | Contains one or more of the
OnTyme: QSATS.P/Nelson  POTS: (408)922-7508 | following: Pleas for help, Free
Disclaimer: Not officially representing     | advice, Opinion, Misc. rambling.
McDonnell Douglas Corporation policy.       |    * Use at your own risk *

page@swan.ulowell.edu (Bob Page) (08/10/88)

hoge%afsc02.decnet@hqafsc-vax.arpa (AFSC02::HOGE) wrote:
>We'll now I've got a bad file on the drive and it won't validate.

Don't use DiskDoctor, I don't think it yet knows about the fast file
system.  In any case, it's not too smart and takes too much memory
(like 2MB to deal with a 20MB hard disk).

The best way to do fix your drive is to back up the disk and restore
it.  Failing that, here is the canonical method for using Sectorama to
delete a file.  This works with both old and fast file systems.

0. Get Sectorama, on fish disk 102, or via ftp on swan.ulowell.edu in
amiga/dos/fs/sectorama.1of1 (you'll need to uudecode it).  You need to
have the topaz11 font (delivered with WB1.2) in your fonts: directory.

1. Type 'sec dh0:' (or whatever the device name is of your partition).
You should see the Root block of the partition.

2. Type right-amiga h to hash a file.  In the string requester (which
you have to click on) type the name of the directory closest to the
root that holds the file, file and hit return.  (for example, if your
file was in dh0:work/book/chapter1/sec4, type 'work' without the
quotes.)  The case is important!  The highlighted part of the screen
should move to a place on the screen.  If the numbers are '00000000'
you did something wrong, try it again.

3. Type 'j' to jump to that disk block.  If the name of the directory
(look at the top of the screen) is not right, type 'h' to follow the
hash chain until you get the right name.  If you hit the end of the
chain and didn't find the directory, you messed up somehow.  Type 'r'
(go to Root block) and start over at #2.

4. Follow the directions in #2-3, continuing down the directory path,
one level at a time until you are in the directory ABOVE where the bad
file is.  Write down this block number.  It's in hex; you may need to
convert it to decimal later.

5. Now use #2 to find the start of the file (also called the file header).
If you have to type 'h' to follow a hash chain, write down each block
number you visit.  Here are three possibilities you have:

         example 1            example 2                example 3

  chapter1                    chapter1           chapter1
     |                           |                  |
     |                           |                  |
     V                           V                  V
    foo --> bar --> sec1.1     sec1.1              foo --> sec1.1 --> bar
    (end of hash chain)       (no hash chain)      (middle of hash chain)


6. You should now be at the file header block.  Look in the 'Next Hash
Block' field.  If there's a non-zero number there, there are blocks in
the hash chain after your block (example 3); write this number down.
If the number is zero and you didn't follow a hash chain to get to the
file header block, we're looking at example 2.  Otherwise we're using
example 1.

7. Now go back to the LAST block you wrote down (not the 'hash' value
you wrote down in step 6) (click the mouse pointer in the top left of
the screen, where it tells you what the block number is, then type the
number of the block in decimal).
	7.1 If you're now looking at a directory block (example 2 or 3):
hash the filename (right-amiga h) once again, but don't 'j' there.
	7.2 If you're looking at a file header block (example 1 or 3):
find (by inspection) the 'next hash chain block' somewhere in the
'playing field' on the left (not the info on the right).  It's near
the bottom of the screen.  Click there but don't 'j' there.

Edit the highlighted field and write in the hex block number
you wrote down in step 6, even if it was all zeros.

8. Now type 'k' to update the block's checksum, then 'U' to Update the
block on disk (it must be upper case).  You can write to the disk even
though DOS can't because Sectorama is talking to the device driver,
not to the DOS file system.  I always type 'U' twice, just to make sure.

9. Exit sectorama (use the menu option), then type:
	DiskChange dh0:
(this assumes you have DiskChange around someplace, it comes with
WB1.2) to start the re-validation.  Commodore utilities assume all
disk devices will support the trackdisk.device non-standard commands
(but not the extended commands) although this has never been
documented anyplace.  Let's hope your driver supports them.  After a
while your disk should complete validation.  If it doesn't, you either
did something wrong or there are more problems that you didn't fix.

DISCLAIMER: This isn't a primer on the file system (you'll have to
wait for my book :-)), and doesn't tell you what you're doing, just
how to do it.  All this does is help you locate a file and unlink it
from its parent directory, effectively deleting it.  I typed this from
memory; I don't have an Amiga handy, so use this information at your
own risk.  I'd be interested in any comments you have.

..Bob
-- 
Bob Page, U of Lowell CS Dept.  page@swan.ulowell.edu  ulowell!page
"What a wonder is USENET; such wholesale production of conjecture from
such a trifling investment in fact."	-- Carl S. Gutekunst