[comp.sys.amiga.programmer] Bad block mapping under 1.3 FFS

jesup@cbmvax.commodore.com (Randell Jesup) (01/12/91)

In article <1880da8b.ARN1900@moria.UUCP> bojsen@lenler.UUCP writes:
>    A2090 HD controller
>    20MB Seagate type HD

>The harddisk's work partition uses 1.3 FFS.  My question is this:
>
>    How are bad blocks mapped out in 1.3 FFS, if at all?

	FFS does not map out bad blocks (no filesystem on the amiga does, at
least not amiga-style FS's).

>Is it not so, that read/write errors on hard disks almost always are due to
>physically bad blocks?  Well, as the harddisk is going to be reformatted I
>just wondered whether Format can map out bad blocks . . .  And the system
>above does not follow the Ridig Disk Block Standard . . .

	Errors are mapped out by the device driver (hddisk.device) from a
table stored at the beginning of the disk.  You enter the bad blocks at
"prep" time when setting up the drive.  To map out new bad blocks, you'll
have to start redoing the drive at the prep level.  Note that I think prep
takes bad blocks in the format written on the disk label: cyl, head, and
bytes from offset.  The calculation is sector = bytes_offset/609, plus 1
if bytes_offset%609 > 576 (past halfway into the gap).  Reverse it if
you know the sector to get bytes (put the value in the middle of the sector).

-- 
Randell Jesup, Keeper of AmigaDos, Commodore Engineering.
{uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.commodore.com  BIX: rjesup  
The compiler runs
Like a swift-flowing river
I wait in silence.  (From "The Zen of Programming")  ;-)