Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: alan@nabeth.cxo.dec.com (Alan Rollow - Dr. File System's Home for Wayward Inodes.)
Subject: Re: Bad Block and Sector elimination - Novice ?
Date: 2000/03/31	[thread overview]
Message-ID: <8c2pc1$3qh$1@mailint03.im.hou.compaq.com> (raw)
In-Reply-To: 8c2eck$agi$1@news.fsu.edu


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




  reply	other threads:[~2000-03-31  5:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-31  5:00 Bad Block and Sector elimination - Novice ? Stephen W. Hodge
2000-03-31  5:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes. [this message]
2000-03-31  5:00 ` Tim Shoppa
2000-03-31  5:00 ` John HILL
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox