[comp.unix.wizards] Help me before I die again.

edguer@mandrill (Apostle of Zeus) (03/24/88)

===
The background information
---
Hardware: VAX 11/750, CS21, CDC9762	OS: BSD 4.3
This evening my computer crashed with the error:
	up2c: freeing free inode
The syslog shows that this occurred after a repeated set of errors:
	up2c: hard error sn38696 cn=241 tn=4 sn=9
Upon rebooting, I ran a file system check.  It failed (of course) with:
	can not read: blk 38696
Which of course lead me to post this message since according to
	SMM15-11 "This should never happen.  See a guru."
====
The Problem:
---
I decided to mark the sector as bad using bad144(8).  
	bad144 rm03 up2
returned a two page list - 126 entries.  The entries were not in
order, and of course there is only room for 126 entries in the bad
sector list.  Two strikes.
From speaking with Keith Bostick, it would appear that something
overwrote the bad sector table.  So I decided to simply create a new
one.
According to the bad144(8)
	"The -f option may be used to mark the new bad sectors as 'bad'"
So I tried
	bad144 -f rm03 up2 1752457552 38696
It didn't work.  Instead I received the error message:
	ioctl: no such device
Hrumph.  I tried to create the bad sector table without the -f.
	bad144 rm03 up2 1752457552 38696
This worked fine - the bad sector was written out to sectors
	131648, 131650, 131652, 131654, 131656
However, when I reran fsck /dev/up2c I continued to get 
	can not read: blk 38696
and
	up2c: hard error ....
After rereading the manual page I saw
	"Note, however, that bad144 does not arrange for the specified
	 sectors to be marked bad in this case."
I thought simply rebooting the computer would force the system to
reread the bad sector table and mark the sector as bad.
	NOPE
I double checked the table and 38696 was still in the table.
SO, HOW DO I MARK A SECTOR BAD ??????   I cannot find anything to help me.
===
Second question
---
Since bad144 wasn't helping me I thought I would try using badsect so...
	mount up2c /usr2
	mkdir /usr2/BAD
	cd /usr2
	badsect /usr2/BAD 38696
Instead of solving my problem I got back an error message
	block 38696 in non-data area: cannot attach
Any ideas on what that means?
===
My eventual solution was to reformat the disk.

Thanks,
Aydin Edguer			!{cbosdg,decvax,sun}!mandrill!edguer

chris@mimsy.UUCP (Chris Torek) (03/27/88)

In article <2390@mandrill.CWRU.Edu> edguer@mandrill (Apostle of Zeus) writes:
>	up2c: hard error sn38696 cn=241 tn=4 sn=9
>I decided to mark the sector as bad using bad144(8).  
>	bad144 rm03 up2
>returned a two page list - 126 entries.  The entries were not in
>order, and of course there is only room for 126 entries in the bad
>sector list.  Two strikes.
>From speaking with Keith Bostick, it would appear that something
>overwrote the bad sector table.  So I decided to simply create a new
>one.

(Bostic: no `k'.)  Most likely, your file system uses the whole area in
up2c.  Since the C partition in the `up' driver includes the bad sector
table, this is a bad thing.  If you have not changed the size of your
file system, you may lose that area again.  You can check the size of
your file system with `dumpfs' (multiply `blocks' times `fsize/512'
to get number of sectors).  Your best bet is not to use the last cylinder
of such a device.  (The same goes for `hp' and `rk' disks.  `ra' disks
are generally safe; the bad sector area is beyond the reported end of
media.  The distributed RA60 or RA80 tables are, however, wrong.  I
forget which it is; probably RA60.)

>According to bad144(8)
>	"The -f option may be used to mark the new bad sectors as 'bad'"

... but only if the device driver supports it ...

>So I tried
>	bad144 -f rm03 up2 1752457552 38696
>It didn't work.  Instead I received the error message:
>	ioctl: no such device

... and apparently the up driver does not.

>... I double checked the table and 38696 was still in the table.
>SO, HOW DO I MARK A SECTOR BAD ??????

Rewrite the sector header.  If the driver will not let you do it,
you will have to reformat (or change the driver).  Some disks do
not allow rewriting individual sector headers, making this particularly
hard.

>Since bad144 wasn't helping me I thought I would try using badsect so...
>	mount up2c /usr2
>	mkdir /usr2/BAD
>	cd /usr2
>	badsect /usr2/BAD 38696
>Instead of solving my problem I got back an error message
>	block 38696 in non-data area: cannot attach
>Any ideas on what that means?

That means block 38696 is in one of the inode or cylinder group areas,
and cannot be allocated as a file block.

>My eventual solution was to reformat the disk.

Probably the easiest fix.  Just make sure your file system does not
overlap the bad sector table!  It is generally best not to use the
`c' partitions for file systems; when we redid the partitioning on
our two large Vaxen, I made `h' partitions for `all but the bad
sector table' file systems:

brillig% disklabel hp4		# (this is a 4.3BSD-tahoe command)
# /dev/rhp4c:
type: SMD
disk: eagle
label: 
flags: badsect
bytes/sector: 512
sectors/track: 48
tracks/cylinder: 20
sectors/cylinder: 960
cylinders: 842
rpm: 3961
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0		# milliseconds
track-to-track seek: 0	# milliseconds [these are not used yet anyway -Chris]
drivedata: 0 3 8 15 

8 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:    63360        0    unused      512  4096       	# (Cyl.    0 - 65)
  b:    63360    63360      swap                    	# (Cyl.   66 - 131)
  c:   808320        0    unused      512  4096       	# (Cyl.    0 - 841)
  d:   680640   126720    unused      512  4096       	# (Cyl.  132 - 840)
  h:   807360        0    4.2BSD     1024  8192    16 	# (Cyl.    0 - 840)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris

root@uokmet.UUCP (03/30/88)

>The background information
>---
>Hardware: VAX 11/750, CS21, CDC9762	OS: BSD 4.3
>	up2c: hard error sn38696 cn=241 tn=4 sn=9
>====
>The Problem:
>---
>I decided to mark the sector as bad using bad144(8).  
>	bad144 rm03 up2
>returned a two page list - 126 entries.  The entries were not in
>order, and of course there is only room for 126 entries in the bad
>sector list.  Two strikes.
>From speaking with Keith Bostick, it would appear that something
>overwrote the bad sector table.  So I decided to simply create a new
>one.
>
>Thanks,
>Aydin Edguer			!{cbosdg,decvax,sun}!mandrill!edguer

You might check to see if your controller is looking/writing the bad sector
file in the same place that the UNIX driver expects.  Under 2.9bsd, the
RM02 driver looks in the wrong place for the bad sector file when the
controller is an Emulex SC21.

	Kevin W. Thomas
	University of Oklahoma
	School of Meteorology
	Norman, OK  73019

UUCP:	ihnp4!occrsh!uokmet!kwthomas