Hi,
How to map a disk sector number to a file in a file system. This is
to identify the file which has a read error. In this case this is a
root file system on 36G drive
Thanks
SN
|
|
0
|
|
|
|
Reply
|
star_night
|
2/14/2004 12:45:25 AM |
|
star night <star_night@my-deja.com> wrote:
> Hi,
> How to map a disk sector number to a file in a file system. This is
> to identify the file which has a read error. In this case this is a
> root file system on 36G drive
There is no index kept for a sector to file mapping.
You would have to write (or find if someone's already written it) a
program that ran the directory tree, then looked up all the blocks
referenced by inodes for each file. When you find the block in
question, you know what file it is.
Don't forget to offset based on the filesystem container if it's not in
a slice that starts at sector 0 on the disk.
--
Darren Dunham ddunham@taos.com
Senior Technical Consultant TAOS http://www.taos.com/
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
|
|
0
|
|
|
|
Reply
|
Darren
|
2/14/2004 1:35:24 AM
|
|
star night wrote:
> How to map a disk sector number to a file in a file system. This is
> to identify the file which has a read error. In this case this is a
> root file system on 36G drive
There is no easy way to do this. But, here is one way that may work.
Be sure you can see the console output so you will see when the
system logs a failure to read a block. You can do this by opening
a console window or by being on the console, whatever. Then, do
something like this:
find / -xdev -type f -print -exec sum '{}' ';'
It will print checksums out for files over and over. Then, when
you get to the file with the unreadable block, you will notice
the files will stop scrolling across the screen and you'll get
an error message. Write down the filename.
If you have multiple files with bad blocks, you will probably want
to build a list of files first, like this:
find / -xdev -type f -print > /tmp/root-fs-files
Then, do something like this:
while read filename
do
echo "$filename"
sum "$filename"
done < /tmp/root-fs-files
When you find a file that is a problem, edit /tmp/root-fs-files
and remove that file (after making a note of its pathname, of
course), so you can continue with the rest of the files.
This is not exactly a perfect method. It can take quite some
time, and you need to standard there and watch it happen so
you don't miss anything...
- Logan
|
|
0
|
|
|
|
Reply
|
Logan
|
2/14/2004 4:59:09 AM
|
|
In article <wXeXb.23490$gy2.16549@newssvr27.news.prodigy.com>,
Darren Dunham <ddunham@redwood.taos.com> wrote:
>star night <star_night@my-deja.com> wrote:
>> Hi,
>
>> How to map a disk sector number to a file in a file system. This is
>> to identify the file which has a read error. In this case this is a
>> root file system on 36G drive
>
>There is no index kept for a sector to file mapping.
.....
>Don't forget to offset based on the filesystem container if it's not in
>a slice that starts at sector 0 on the disk.
The latter is true, the first is not (at least, it may be easily mapped):
ftp://ftp.berlios.de/pub/schily/kernel/ufs/
look for 'bton'
--
EMail:joerg@schily.isdn.cs.tu-berlin.de (home) J�rg Schilling D-13353 Berlin
js@cs.tu-berlin.de (uni) If you don't have iso-8859-1
schilling@fokus.fraunhofer.de (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily
|
|
0
|
|
|
|
Reply
|
js
|
2/14/2004 12:48:41 PM
|
|
Joerg Schilling <js@cs.tu-berlin.de> wrote:
> In article <wXeXb.23490$gy2.16549@newssvr27.news.prodigy.com>,
> Darren Dunham <ddunham@redwood.taos.com> wrote:
>>star night <star_night@my-deja.com> wrote:
>>> Hi,
>>
>>> How to map a disk sector number to a file in a file system. This is
>>> to identify the file which has a read error. In this case this is a
>>> root file system on 36G drive
>>
>>There is no index kept for a sector to file mapping.
> ....
>>Don't forget to offset based on the filesystem container if it's not in
>>a slice that starts at sector 0 on the disk.
> The latter is true, the first is not (at least, it may be easily mapped):
> ftp://ftp.berlios.de/pub/schily/kernel/ufs/
> look for 'bton'
It would appear that 'icheck' is doing the heavy lifting there, not
bton. My assumption is that it runs the directory tree. Otherwise, how
does it find the inode?
--
Darren Dunham ddunham@taos.com
Senior Technical Consultant TAOS http://www.taos.com/
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
|
|
0
|
|
|
|
Reply
|
Darren
|
2/17/2004 4:57:50 PM
|
|
In article <iKrYb.24913$s%1.20243@newssvr27.news.prodigy.com>,
Darren Dunham <ddunham@redwood.taos.com> wrote:
>> ftp://ftp.berlios.de/pub/schily/kernel/ufs/
>
>> look for 'bton'
>
>It would appear that 'icheck' is doing the heavy lifting there, not
>bton. My assumption is that it runs the directory tree. Otherwise, how
>does it find the inode?
ncheck
--
EMail:joerg@schily.isdn.cs.tu-berlin.de (home) J�rg Schilling D-13353 Berlin
js@cs.tu-berlin.de (uni) If you don't have iso-8859-1
schilling@fokus.fraunhofer.de (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily
|
|
0
|
|
|
|
Reply
|
js
|
2/18/2004 12:19:59 AM
|
|
In article <c0ub3f$3eb$1@news.cs.tu-berlin.de>,
Joerg Schilling <js@cs.tu-berlin.de> wrote:
>In article <iKrYb.24913$s%1.20243@newssvr27.news.prodigy.com>,
>Darren Dunham <ddunham@redwood.taos.com> wrote:
>
>>> ftp://ftp.berlios.de/pub/schily/kernel/ufs/
>>
>>> look for 'bton'
>>
>>It would appear that 'icheck' is doing the heavy lifting there, not
>>bton. My assumption is that it runs the directory tree. Otherwise, how
>>does it find the inode?
>
>ncheck
Sorry, this was a bot too short ,-)
icheck searches the inode arry in the FS for block numbers and maps block
numbers to inode numbers ncheck converts the intermadiate information to
names. bton is the glue.
--
EMail:joerg@schily.isdn.cs.tu-berlin.de (home) J�rg Schilling D-13353 Berlin
js@cs.tu-berlin.de (uni) If you don't have iso-8859-1
schilling@fokus.fraunhofer.de (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily
|
|
0
|
|
|
|
Reply
|
js
|
2/18/2004 12:27:18 AM
|
|
Joerg Schilling <js@cs.tu-berlin.de> wrote:
> In article <iKrYb.24913$s%1.20243@newssvr27.news.prodigy.com>,
> Darren Dunham <ddunham@redwood.taos.com> wrote:
>>> ftp://ftp.berlios.de/pub/schily/kernel/ufs/
>>
>>> look for 'bton'
>>
>>It would appear that 'icheck' is doing the heavy lifting there, not
>>bton. My assumption is that it runs the directory tree. Otherwise, how
>>does it find the inode?
> ncheck
But ncheck does scan the whole filesystem from what I can see. Are you
saying that the result from an ncheck run is stored somewhere so that
icheck can read it later?
--
Darren Dunham ddunham@taos.com
Senior Technical Consultant TAOS http://www.taos.com/
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
|
|
0
|
|
|
|
Reply
|
Darren
|
2/18/2004 12:30:26 AM
|
|
|
7 Replies
283 Views
(page loaded in 0.247 seconds)
|