Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Aug 1998 21:41:05 +0000
From:      Mike Smith <mike@smith.net.au>
To:        Jacques Vidrine <n@nectar.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: disk going bad? 
Message-ID:  <199808312141.VAA00572@word.smith.net.au>
In-Reply-To: Your message of "Mon, 31 Aug 1998 22:48:26 EST." <E0zDhQg-0000td-00@spawn.nectar.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> -----BEGIN PGP SIGNED MESSAGE-----
> 
> I don't suppose I can just mark a sector as bad on a SCSI
> drive, can I?
> 
> (da1:ahc1:0:0:0): READ(10). CDB: 28 0 0 95 c0 20 0 0 e 0 
> (da1:ahc1:0:0:0): MEDIUM ERROR info:95c02b asc:11,0
> (da1:ahc1:0:0:0): Unrecovered read error

Yup.  It's a bit convoluted, but start by using the 'camcontrol' command
to set ARRE and AWRE to 1.  Use the syntax as for the example editing 
the read-write error control page in the scsi(8) manpage, and harrass 
Ken Merry to write a manpage for camcontrol.  8)

Then you need to arrange to write to the sector; you can do this a 
number of ways, depending on the disk in question.

If you can back everything up and dd over the entire disk or partition, 
that's the simplest way to go.

Failing that, if the defect is in the data area of a file, delete it.  
When the block is reused, the drive will spare it out.  You can use 
'badsect' to work out where the block is; give it the 'fsbn' value from 
the console error message.  If it's willing to spare the block, then 
it's in a file, and when you fsck the filesystem, you can decide if you 
want to keep it.  (See badsect(8) for more details.)

If the block is in a critical area, then you really do have to rebuild 
the filesystem from scratch.

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\  msmith@cdrom.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808312141.VAA00572>