* Re: Bad Block and Sector elimination - Novice ?
2000-03-31 5:00 Bad Block and Sector elimination - Novice ? Stephen W. Hodge
@ 2000-03-31 5:00 ` John HILL
2000-03-31 5:00 ` Tim Shoppa
2000-03-31 5:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
2 siblings, 0 replies; 4+ messages in thread
From: John HILL @ 2000-03-31 5:00 UTC (permalink / raw)
Before I continue with the rest of the reply, I should warn you that
what I'm describing is very likely not to work and might lose all the
data from your disk. USE AT YOUR OWN RISK!!
You could try using scu. Something like
scu -f /dev/rrz?c (replace the ? by the correct digit)
scu> verify media starting 0
This is a non-destructive check of the disk. If you then want to take
the risk, you can try
scu> reassign lba xxxxxx (where xxxxxx is the bad block number)
which will replace the bad block. Note that this is likely to corrupt
your file system, so you may find you have to "newfs" the bad partition
and hence lose all the existing data. Also from experience, the
success rate is low. Having said that, I managed to reassign ~50 blocks
on a disk that clearly had a bad region (the blocks were adjacent) and
the disk has worked fine since then.
Regards,
John Hill
"Stephen W. Hodge" wrote:
>
> First let me say that I am NOT a system manager but have been forced into
> this role to fix this problem.
>
> I have a 23 gig drive on a DEC AlphaStation 500 (digital unix 4.?) that has
> a bad partition When I do an "fsck" on the disk it says that block 64 is
> bad. When I say continue, it then says that sector 68 is bad and then
> finishes the fsck.
>
> The disk participation will not mount, saying something about bad medium
> block at 376658 when you boot the system up.
>
> I think I could use "badsect" to get rid of this sector, but I first have to
> mount the partition (right?). Well I cant mount the partition because of
> the bad block/sector. Catch 22(?)
>
> the other partition with data seems ok. 2 small partitions used as swap are
> ok as well.
>
> Any ideas?
> Thanks in advance
> Stephen W. Hodge
> shodge@admin.fsu.edu
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Bad Block and Sector elimination - Novice ?
2000-03-31 5:00 Bad Block and Sector elimination - Novice ? Stephen W. Hodge
2000-03-31 5:00 ` John HILL
2000-03-31 5:00 ` Tim Shoppa
@ 2000-03-31 5:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
2 siblings, 0 replies; 4+ messages in thread
From: Alan Rollow - Dr. File System's Home for Wayward Inodes. @ 2000-03-31 5:00 UTC (permalink / raw)
In article <8c2eck$agi$1@news.fsu.edu>, "Stephen W. Hodge" <shodge@admin.fsu.edu> writes:
>I have a 23 gig drive on a DEC AlphaStation 500 (digital unix 4.?) that has
>a bad partition When I do an "fsck" on the disk it says that block 64 is
>bad. When I say continue, it then says that sector 68 is bad and then
>finishes the fsck.
Since fsck is reporting the block number it is probably relative to the
start of the partition. For a UFS, that is the first sector of the
inode space for the first cylinder group. That's a bad place to have
a bad block, but it could be worse. Block 68 is the same area (same
group of inodes).
You can verify this for yourself using the icheck command and the
-b option:
# icheck -b 64 68 /dev/rrz{whatever}
>
>The disk participation will not mount, saying something about bad medium
>block at 376658 when you boot the system up.
What you have to pay close attention is that the particular file system
may not start at the beginning of the disk. So, the bad blocks reported
by fsck are offset by the offset of the partition the file system is
on. You can see the partition offset and size by looking at the disk
label.
>
>I think I could use "badsect" to get rid of this sector, but I first have to
>mount the partition (right?). Well I cant mount the partition because of
>the bad block/sector. Catch 22(?)
As someone else noted, badsect harkens back to a previous era. When you
can get access to the desired block it may have the desired affect, but
in this case, the block is an important part of the file system. The
manual page suggests that the shipped version works closely with fsck(8)
to do the designed job.
However, on modern SCSI disks that support the Reassign LBA command (an
optional command according to the SCSI spec), you don't really need
badsect. On such disks you can get the disk to reassign the block and
not ever worry about the operating system having to deal with it.
As someone else suggested (hill@hep.phy.cam.ac.uk I believe), use
scu(8) to make a pass of the disk looking for more bad blocks. If
there aren't many, simply reassign them, let fsck repair the damage
and go to work recovering the file system. If there are "many"
you might want to consider getting the disk replaced.
When scu(8) tells the disk to replace the block, it will work pretty
hard to get a good copy of the data for the replacement block. However,
since hadn't succeeded in getting a good block yet, it probably won't
when scu(8) tells it to replace the block. So, you'll have corrupt
data in a readable block. For that particular part of the file system
(the inode space), each bad sector is four files that may be lost.
If those files are directories, fsck will reattach the files to a
lost+found directory. If they're regular files, they'll probably
be gone when fsck is done.
fsck will print the inode numbers as it works, so you may want to
make two passes. Use the first to get the inode numbers of the
affected files and then use ncheck to see what the affected files
are:
# ncheck -i 1 2 3 16 17 18 19 /dev/rrz{whatever}
(for the file system blocks you listed, these are the inode numbers
of the files that might be affected. Some are reserved numbers, so
use fsck to see what the actual list is.)
Once you know the affect files you can let fsck repair the damage
and restore or reorganize the affected files.
>
>Any ideas?
>Thanks in advance
>Stephen W. Hodge
>shodge@admin.fsu.edu
--
Alan Rollow alan@nabeth.cxo.dec.com
^ permalink raw reply [flat|nested] 4+ messages in thread