[comp.sys.amiga] FORMAT Question

beatyr@pur-ee.UUCP (Robert Beaty) (11/26/86)

<<<<<>>>>>

	I hate to ask what seems like a trivial question, but I
	am looking through 'The AmigaDOS Manual' and I cannot
	find the answer. Question: During a FORMAT does the
	computer check the disk for bad sectors and lock them
	out of the 'available sector' table? Data on either 1.1
	or 1.2 would be helpful.

			Thanks for the help,
			  Bob
----------
   ... ihnp4!pur-ee!beatyr      <- usenet
  ... beatyr@ed.ecn.purdue.edu  <- arpa-net
   ... beatyr@pur-ee.UUCP       <- UUCP
----------

cmcmanis@sun.uucp (Chuck McManis) (12/01/86)

In article <4973@pur-ee.UUCP>, beatyr@pur-ee.UUCP (Robert Beaty) writes:
> Question: During a FORMAT does the computer check the disk for bad 
> sectors and lock them	out of the 'available sector' table?
> Data on either 1.1 or 1.2 would be helpful.
> 			  Bob

No Bob, the FORMAT command does not lock out bad sectors. Personally,
I have wondered if the "verify" operation that the FORMAT command does
really works either since some of those horrid Tan floppies :-) will
Format & Verify and still come up with errors. Through some judicious
hacking I was able to write some code that would put "bad" sectors 
into a file but even that can't be made invisible because AmigaDOS'
dir command always lists out all of the files on the disk. My less than
perfect suggestion is to use 'defect free' floppies. Which means buying
DS ones even if you believe SS ones are Ok, and sticking to Sony's even
when Brown disks are cheaper. 

-- 
--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.

phils@tekigm.UUCP (Phil Staub) (12/02/86)

In article <9769@sun.uucp> cmcmanis@sun.uucp (Chuck McManis) writes:
>In article <4973@pur-ee.UUCP>, beatyr@pur-ee.UUCP (Robert Beaty) writes:
>> Question: During a FORMAT does the computer check the disk for bad 
>> sectors and lock them	out of the 'available sector' table?
>> Data on either 1.1 or 1.2 would be helpful.
>> 			  Bob
>
>No Bob, the FORMAT command does not lock out bad sectors. Personally,
>I have wondered if the "verify" operation that the FORMAT command does
>really works either since some of those horrid Tan floppies :-) will
>Format & Verify and still come up with errors. Through some judicious
>hacking I was able to write some code that would put "bad" sectors 
>into a file but even that can't be made invisible because AmigaDOS'
>dir command always lists out all of the files on the disk.
>-- 
>--Chuck McManis

If I'm reading the RKM correctly, there are actually two problems with the
idea of locking out bad sectors. The first part of the problem has to do
with the fact that the Amiga does only full track reads/writes, thus
eliminating inter-sector gaps and allowing much closer to the full capacity
of the disk to be used. For this reason, a bad sector would cause an entire
track read to fail, not just that sector.

The second problem (and one which I am not as certain I'm reading the RKM
properly on) is that it appears that sectors are not always written out to
the disk in the same order as they were read. For example if you read a
track and the sector ordering happens to be:

	0 1 2 3 4 5 6 7 8 9 10

then make some changes to some information in one of the sectors, or even
just write to a previously unused sector, there is nothing to guarantee that a
subsequent write would result in the sectors being ordered differently, such
as:

	4 5 6 7 8 9 10 0 1 2 3

What this means is that what used to be sector 5 is now sector 9, and any
bad block mapping would have to keep up with the changes in logical-to-
physical sector translation on subsequent writes. Even more importantly, if
physical sector 5 is bad, and in the first case logical sector 5 were locked
out, and sector 9 contained valid information, then the rewrite resulted in
the second ordering, we now have to find something to do with the (valid)
data in sector 9, since it will be mapped into physical sector 5, (which is
bad). If we just re-mapped it to physical sector 2 (since logical sector 5
was previously guaranteed to be un-used) we would have to do an additional
mapping process, which would vary with every write. Could be very sticky. 

As I mentioned, I'm not really very sure I read the RKM properly on the
re-ordering of sectors, so I would be willing to be proven wrong. However,
if I'm right, bad sector mapping could well be impossible.


-------------------------------------------------------------------------------
"I'm sure you think you understand what you thought I said, but I hope you
realize that what you heard is not what I meant."

Phil Staub                       P.O. Box 3500
Tektronix, Inc.                  Vancouver, Washington 98668
ISI Engineering                  M/S C1-904, (206) 253-5634
..tektronix!tekigm!phils
-------------------------------------------------------------------------------

phillip@cbmvax.cbm.UUCP (Phillip Lindsay) (12/03/86)

> Keywords: FORMAT bad sector lock-out
> 
> <<<<<>>>>>
> 
> 	I hate to ask what seems like a trivial question, but I
> 	am looking through 'The AmigaDOS Manual' and I cannot
> 	find the answer. Question: During a FORMAT does the
> 	computer check the disk for bad sectors and lock them
> 	out of the 'available sector' table? Data on either 1.1
> 	or 1.2 would be helpful.
> 
> 			Thanks for the help,
> 			  Bob
> ----------
>    ... ihnp4!pur-ee!beatyr      <- usenet
>   ... beatyr@ed.ecn.purdue.edu  <- arpa-net
>    ... beatyr@pur-ee.UUCP       <- UUCP
> ----------
Nope. AmigaDos doesn't map bad blocks...Usually in terms of a
harddisk the exec device does the work of mapping bad blocks.
If the FORMAT entry point in your disk device is smart enough to do the
bad block mapping then the format command *would* map bad blocks for you.
==============================================================================
  Phillip Lindsay - Commodore Business Machines - Amiga Technical Support
  UUCP: {ihnp4|seismo|caip}!cbmvax!phillip      - Phone: (215) 431-9180
  No warranty is implied or otherwise given in the form of suggestion or 
  example. Any opinions found here are of my making. 	/* eof */