| From | Sent On | Attachments |
|---|---|---|
| Eugeny N Dzhurinsky | Mar 8, 2010 2:26 am | |
| Alexander Motin | Mar 8, 2010 2:31 am | |
| Eugene Dzhurinsky | Mar 8, 2010 2:52 am | |
| Eugene Dzhurinsky | Mar 8, 2010 2:54 am | |
| Eugene Dzhurinsky | Mar 8, 2010 3:08 am | |
| Miroslav Lachman | Mar 8, 2010 3:21 am | |
| Wes Morgan | Mar 8, 2010 3:46 am | |
| Eugene Dzhurinsky | Mar 8, 2010 3:50 am | |
| Miroslav Lachman | Mar 8, 2010 5:28 am | |
| Alex Keda | Mar 8, 2010 12:14 pm | |
| Ulrich Spörlein | Mar 11, 2010 5:47 am | |
| Dag-Erling Smørgrav | Mar 11, 2010 7:20 am | |
| Svein Skogen (Listmail Account) | Mar 11, 2010 7:23 am | |
| Miroslav Lachman | Mar 13, 2010 12:44 pm | |
| Dag-Erling Smørgrav | Mar 13, 2010 1:24 pm | |
| Miroslav Lachman | Mar 14, 2010 1:54 am | |
| Gary Jennejohn | Mar 14, 2010 4:38 am | |
| Miroslav Lachman | Mar 14, 2010 9:18 am | |
| Gary Jennejohn | Mar 14, 2010 10:47 am | |
| Dag-Erling Smørgrav | Mar 17, 2010 3:58 am | |
| Miroslav Lachman | Mar 17, 2010 4:35 am | |
| Miroslav Lachman | Mar 17, 2010 4:41 am | |
| Dag-Erling Smørgrav | Mar 17, 2010 4:59 am | |
| Gary Jennejohn | Mar 17, 2010 5:05 am | |
| Miroslav Lachman | Mar 18, 2010 3:29 am | |
| Miroslav Lachman | Mar 18, 2010 3:32 am | |
| Dag-Erling Smørgrav | Mar 18, 2010 4:10 am | |
| Pieter de Goeje | Mar 18, 2010 4:33 am | |
| Miroslav Lachman | Mar 18, 2010 4:45 am | |
| Dag-Erling Smørgrav | Mar 18, 2010 5:17 am |
| Subject: | Re: A tool for remapping bad sectors in CURRENT? | |
|---|---|---|
| From: | Gary Jennejohn (gary...@freenet.de) | |
| Date: | Mar 14, 2010 10:47:43 am | |
| List: | org.freebsd.freebsd-current | |
On Sun, 14 Mar 2010 17:18:45 +0100 Miroslav Lachman <000....@quip.cz> wrote:
Gary Jennejohn wrote:
On Sun, 14 Mar 2010 10:55:19 +0100 Miroslav Lachman<000....@quip.cz> wrote:
[big snip]
fsdb (inum: 3)> blocks Blocks for inode 3: Direct blocks: 3001 (1 frag)
fsdb (inum: 3)> findblk 3001 fsdb (inum: 3)>
^^^^^^^^ findblk did not returned inode 3!
This is almost guaranteed to be a file system block and not a disk block.
Do you mean the number 3001? I am sorry for my ignorance, but it is not clear to me from fsdb manpage what "blocks" means FS block and what disk block.
And how can I use (calculate with) this numbers?
How can I get the right number to pass to findlbk command (in the example above) to give me back the inode 3?
If FS block is 16384 bytes, then it means 16384/512 = 32 disk blocks per FS block.
If 3001 is FS block, then it means 3001*32 = 96032 disk block number. Am I right?
fsdb (inum: 3)> findblk 96032 fsdb (inum: 3)>
Again - findblk did not returned inode 3.
So what is the exact formula to get the right findblk number and then right inode number as result of findblk command?
I am still lost in terms (words) and numbers :(
Well, it's pretty hairy.
Looking at findblk() it does this to go from disk block to file system block (this is greatly simplified)
file_system_blockno = disk_blockno >> fs_fsbtodb;
So conversely, you'd do disk_blockno = file_system_blockno << fs_fsbtodb.
You can get this information using "ffsinfo -l 0x001 -o some_file /dev/ataXY" (using ahci) and grep'ing for fsbtodb in some_file. The 0x001 means to only dump the first super block.
I looked at a file system which has default 16kB file system blocks and fsbtodb is 2 ==> *multiply file_system_block by 4 not 32*. This is probably because it's a multiple of a 4kB block, which is the smallest usable file system block size AFAIK.
BTW looking at the code leads me to conclude that fsdb will not print out anything if the disk block you're trying to find has bever been allocated to an inode ==> unused disk block, safe to overwrite. This assumes that you calculated the disk block correctly.
--- Gary Jennejohn
_______________________________________________ free...@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "free...@freebsd.org"





