Command to view sector/block level details of a file

  • Thread starter Thread starter Shivaramakrishnan
  • Start date Start date
S

Shivaramakrishnan

I wanted to know if there is a command to view the details/contents of the file at the sector/block level? Meaning ,I want the following details: I have 2 files.I needed to know whether the contents stored at the block/sector level are same for the two files?Is there a command or tool to check it?If so,can you please direct me in the right way? I know both the files I am comparing are running linux operating systems

Extra Info: Here is my situation.I have two image files.I want to see if the contents of the two image files at block/sector level are the same (first few mb's where the kernel code would reside).Assuming both the image files contain linux os,I know that first few MB of both should be the same.So, I did the following:

1. ls -i web-test.img -- got the inode as 13

2. debugfs /dev/sdb1

3. stat <13> -- (ETB0): 33409

4. dd if=/dev/sdb1 of=success.txt ibs=4096 count=1 skip =33409.

The contents of o/p are not in clear txt.I needed to see if its contents are the same.

In simple words,Read the first few mb of data from the images files (kernel portion at block/sector level)

Looking forward to your reply.

Continue reading...
 
Back
Top