[comp.sys.next] Optical Disk

eht@f.word.cs.cmu.edu (Eric Thayer) (01/19/89)

This one really is causing problems!  How do work around an
optical disk with a non-correctable (see Release Notes) bad
block?

Also, how do you correct a trashed super block?  I've tried
fsck -b 16 /dev/od0a
(its a 1 partition disk)

						...eric

-- 

avie@wb1.cs.cmu.edu (Avadis Tevanian) (01/19/89)

In article <4051@pt.cs.cmu.edu> eht@f.word.cs.cmu.edu (Eric Thayer) writes:
>This one really is causing problems!  How do work around an
>optical disk with a non-correctable (see Release Notes) bad
>block?

Write down the PHYSICAL disk block address causing problems, then run the
disk program (e.g., /etc/disk /dev/rod0a).  Select the "abort" command, which
disable the abort-on-error feature.  Now, determine how many sectors have bad
ECC.  It is almost always 8 (for 8K) but is sometimes 1.  To do this, execute
the "read" command.  It will prompt for several values:

starting block:		supply the PHYSICAL block you recorded earlier.
# sectors per transfer:	answer 1.
number of transfers:	answer 8.
sector increment:	answer 1.

Now watch the error messages about bad ECC, you'll get either 1 or 8 of them,
corresponding to how many sectors are bad.  If you get no error messages,
you've probably provided the wrong starting block.  Start over!

To "fix" these sectors, issue the "write" command, answering the questions
as above (but for the number of transfers specify 1 or 8 depending on
how many sectors were bad).  Also, it will prompt you for "random data," say
no, which will write zeros.

What this does is to write the bad sectors, forcing good ECC.  Unfortunately,
you previous data there is lost.
--
Avadis Tevanian, Jr.    (Avie)
Chief Operating System Scientist
NeXT, Inc.
avie@cs.cmu.edu or avie@NeXT.com
-- 
Avadis Tevanian, Jr.    (Avie)
Chief Operating System Scientist
NeXT, Inc.
avie@cs.cmu.edu or avie@NeXT.com
-- 

c9c-aa@dorothy.Berkeley.EDU (Brad Post) (03/23/89)

I remember a while back, that someone wanted a quick way to 'hot' mount optical
disks.  Well I wrote a program to do this, but I just now remembered that some-
one else was interested.  It's quite self explanitory.  I can't remember where
the anonymous ftp site is, so could someone either tell me or put this there.

Thanks.

-----------------------------------<cut here>-----------------------------------


/*  Optical disk mounting program, by Brad Post, University of CA, Berkeley.
    Notes:
	Makes sure root owns this program, and chmod it 4755, this allows 
	anyone else to run it.
	In the system call where there are [ ], you should put the location
	of where you want the disk to be accessible, I made it
		/MyDisk/Homes/optical
	for convience.  
	Remember to make the dir where the disk is rwx to all.  Also if you
	haven't done so already, before running the program, do:
		newfs -v /dev/od0a omd-1-all
	Then run the program normally, use the -s command to get help.

 */



#include <stdio.h>

main(argc, argv)
int argc;
char **argv;
{
	void help();
	int i;
	char **last = &argv[argc-1];


	while (++argv <= last && (*argv)[0] == '-')
	   for(i = 1; (*argv)[i] != '\0'; i++)
             switch((*argv)[i])
    	     {
		case 'e': system("/etc/umount /dev/od0a");
			  system("/etc/disk -e /dev/rod0a");
	      		  break;
	/*  Remember to put where the disk is mount on where the [] are 
	    and remember to remove the [] :-) */
		case 'l': system("/etc/mount /dev/od0a [ ]");
	      		  break;
		 default: help();
			  break;
	      }
}

void help();
{
	printf("Usage:  optical -el \n");
	printf("  e = eject \n");
	printf("  l = load \n");
}


---------------------------------<cut here>-------------------------------------

Oh yeah, just complie with normal cc.

Send any questions, comments or bugs to the address below.
Hope this helps anyone who might need it.

Brad Post
ARPA:  c9c-aa@dorothy.berkeley.edu
UUCP:  ...ucbvax!dorothy!c9c-aa