2004-04-12 06:39:21

by Daniel Brahneborg

[permalink] [raw]
Subject: block -> name ?

Hi,

Recently my computer running Linux kernel 2.4.25 started
halting all of a sudden, and running badblocks a couple
of times showed that it was caused by reading around block
20.200.000 on one of the SATA disks. I'll replace the
drive eventually, but is there a way of finding out what
file is currently residing in a specific block? I'd prefer
something a bit more efficient than doing a 'wc' on 300GB
of data (which also would miss all the directories). To
make things more interesting, the disk is 1 of 4 in a RAID5
array, and is formatted with XFS.

Best regards,

/Daniel


2004-04-13 00:41:28

by Nathan Scott

[permalink] [raw]
Subject: Re: block -> name ?

On Mon, Apr 12, 2004 at 08:41:48AM +0200, Daniel Brahneborg wrote:
> Hi,
>
> Recently my computer running Linux kernel 2.4.25 started
> halting all of a sudden, and running badblocks a couple
> of times showed that it was caused by reading around block
> 20.200.000 on one of the SATA disks. I'll replace the
> drive eventually, but is there a way of finding out what
> file is currently residing in a specific block? I'd prefer
> something a bit more efficient than doing a 'wc' on 300GB
> of data (which also would miss all the directories). To
> make things more interesting, the disk is 1 of 4 in a RAID5
> array, and is formatted with XFS.
>
> Best regards,

See xfs_db(8) and its blockget/blockuse commands.

cheers.

--
Nathan