Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2001 10:00:33 -0800 (PST)
From:      Julian Elischer <julian@elischer.org>
To:        Alexander Leidinger <Alexander@Leidinger.net>
Cc:        fs@freebsd.org
Subject:   Re: physical block no -> name of file  (FFS)?
Message-ID:  <Pine.BSF.4.21.0110290957220.26174-100000@InterJet.elischer.org>
In-Reply-To: <200110291328.f9TDSGE04238@Magelan.Leidinger.net>

next in thread | previous in thread | raw e-mail | index | archive | help
you would need to start with 'fsck' and add an option to specify a block
to watch for (partiton relative).

fsck -n -B NUM
could easily return an inode number for you and a filename too given
enough hacking...

Shuould not be toooo difficult, so as you have the itch, if you scratch
it, we can take the patches and put them back in so that the next person
can do this easier..

julian


On Mon, 29 Oct 2001, Alexander Leidinger wrote:

> Hi,
> 
> [Please keep me in the CC]
> 
> I've a bad block on a harddisk and want to know the name of the file
> which the bad block is a part of (to replace the file from a backup
> after writting zeros to the block to remap the block).
> 
> At http://www.leidinger.net/FreeBSD/b2i.c I've a quick hack which is
> able to find the slice and partition which contains the bad block, but I
> don't know what to do now.
> 
> The idea I have is:
>  - find the dinode which has a relationship to the bad block
>  - find the corresponding directory entry
>  - print the name
> 
> But I don't know enough about the ffs to do this, what FM should I read
> to be able to do this (online or basesystem documentation prefered over
> dead wood docs)?
> 
> My main problem at the moment is: how does the on disk layout look like?
> I tried a little bit in b2i.c (state_superblock & state_dinode), but I
> think this is wrong.
> 
> Bye,
> Alexander.
> 
> -- 
>                       Loose bits sink chips.
> 
> http://www.Leidinger.net                       Alexander @ Leidinger.net
>   GPG fingerprint = C518 BC70 E67F 143F BE91  3365 79E2 9C60 B006 3FE7
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-fs" in the body of the message
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0110290957220.26174-100000>