From: alan@nabeth.cxo.dec.com (Alan Rollow - Dr. File System's Home for Wayward Inodes.)
Subject: Re: fsck: CANNOT READ: BLK
Date: 1997/02/20 [thread overview]
Message-ID: <5eia75$t74@nntpd2.cxo.dec.com> (raw)
In-Reply-To: ubpvxyp253.fsf@kmb07.ing.tu-bs.de
In article <ubpvxyp253.fsf@kmb07.ing.tu-bs.de>, Stefan Hasselbach <stefan@kmb07.ing.tu-bs.de> writes:
>is there a way to repair BAD BLOCKS detected with fsck on ULTRIX - 32.
Sure, identify what file the bad block belongs to and restore the
file from a backup. In all likelyhood, the block is bad and the
data in it CAN NOT be recovered or repaired. If was, some of the
I/O subsystem that ULTRIX supports would have done so and replaced
the block with a good one.
So, taking the above step by step.
1. Get the block number and normalize for the partition offset.
If the partition happens to start at the beginning of the
you can skip this step. Look at the partition table using
chpt and note the start of the partition where the block
was. Add the offset to the block number given by fsck and
this is the LBN of the disk.
2. On an MSCP disk (rd or ra device name), the block has probably
already been replaced, but MSCP has a feature that allows the
block to remember that it has corrupt data in it. The feature
is called a forced error. You can clear the FE flag using the
radisk command. Check the manual page for the options.
On a SCSI disk, you can use rzdisk to force a replacement of
the block (assuming the disk supports that; most should). On
V4.4 you can use scu(8) and the "reassign lba" command.
3. Now, you should have a good block, but since the original data
couldn't be read, corrupt data. You need to track down where
the block was. Use icheck:
# icheck -b BN /dev/rr{whatever}
This will scan the file system to see where that block is
used. Use the original block number given by fsck, since
icheck expects partition relative block numbers. If the
block is in a file, the file's inode number will be given
as well as the position in the file. If the file is in a
file system data structure that will also be given.
For an inode, you can backtrack to the name(s) using ncheck:
# ncheck -i inode /dev/rr{whatever}
Once you know the file you can restore it from backup or
the system distribution.
The file happens to be a directory, the directory is
probably corrupt. Run fsck to relink any unattached files
to lost+found. All the files in the directory may be
unattached, so you may have to create the directory and
go through lost+found and rename all the files.
The block was in metadata, it probably left the file system
corrupt in other ways, but fsck can make the repairs that
are possible. If a range of inodes was corrupted, you'll
want to back-track all those to names, so you can restore
them if necessary.
> Stefan Hasselbach eMail: stefan@kmbserv1.ing.tu-bs.de
--
Alan Rollow alan@nabeth.cxo.dec.com
prev parent reply other threads:[~1997-02-20 5:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-02-18 5:00 fsck: CANNOT READ: BLK Stefan Hasselbach
1997-02-20 5:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes. [this message]
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