Skip to contentSkip to conversation

"block_dump, bd" in debugfs

DISCUSSION jon ernst 3 participants 4 messages Jun 27, 2013

lore
Share & tools
lore

jon ernst

author
#0 lore raw

Hi,
When I use "block_dump" to dump certain block. I got 12288 bytes dumped.
But I checked my block_size, it is 4k.
At debugfs interactive prompt, it says "Dump contents of a block". So I am confused here.
I read the code, it has    for (i=0; i<current_fs->blocksize; i+=16) ,I don't understand why I can get 12k output.

Also at the beginning of each line. The output pattern is "0000, 0020, 0040, 0060, 0100, 0120", where are numbers such as"0080,"?

Thanks in advance for any explanation.

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw
Quoted 2 lines · jon ernst

Hi,
When I use "block_dump" to dump certain block. I got 12288 bytes dumped.

output example? It dumps a hexadecimal representation w/ octal offsets, if you're counting bytes in the *text* output it'd be more than 4096.

Quoted 3 lines

But I checked my block_size, it is 4k.
At debugfs interactive prompt, it says "Dump contents of a block". So I am confused here.
I read the code, it has for (i=0; i<current_fs->blocksize; i+=16) ,I don't understand why I can get 12k output.

Each line represents 16 bytes worth of data, with the starting offset of each line in octal.

When I run it on nonrepeating data, line starting points go from 0000 to 7760 (octal) on a 4k block (so it ends at 07777, or offset 4095)

Quoted 1 line

Also at the beginning of each line. The output pattern is "0000, 0020, 0040, 0060, 0100, 0120", where are numbers such as"0080,"?

Identical lines are suppressed, similar to what hexdump does by default. You might have had a "*" in between?

Quoted 1 line

Thanks in advance for any explanation.

I suppose manpage docs would help, but who has time to write those! ;)

-Eric

#2 lore raw
Quoted 8 lines · Eric Sandeen

On 6/26/13 11:05 PM, jon ernst wrote:
...

Quoted 2 lines

Also at the beginning of each line. The output pattern is "0000, 0020, 0040, 0060, 0100, 0120", where are numbers such as"0080,"?

Identical lines are suppressed, similar to what hexdump does by default. You might have had a "*" in between?

Offsets are octal, so there is no 0080: adding octal 020 to octal 0060 gets you to octal 0100.

Signature · 1 line
Nick
#3 lore raw
Quoted 7 lines · Nick Dokos
Quoted 5 lines · Eric Sandeen

On 6/26/13 11:05 PM, jon ernst wrote:
...

Quoted 2 lines

Also at the beginning of each line. The output pattern is "0000, 0020, 0040, 0060, 0100, 0120", where are numbers such as"0080,"?

Quoted 7 lines
Quoted 3 lines

Identical lines are suppressed, similar to what hexdump does by default. You might have had a "*" in between?

Offsets are octal, so there is no 0080: adding octal 020 to octal 0060 gets you to octal 0100.

Oh right, that too. :) Thanks.

-Eric