Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I retrieve the block number(s) of a certain file in a file system (the blocks the file is using on the harddisc)?

I'm using the gentoo linux based SystemRescueCD, so I got plenty of tools installed which might get that information for me.

Best regards

share|improve this question
What filesystem are you looking at? Is this a rescue of a Windows/NTFS system, an old FAT32 system, ext2, ext3, ext4, ReiserFS, etc.? The kind of information and tools may vary widely by filesystem. – fencepost Feb 28 '10 at 23:01
up vote 1 down vote accepted

If you're looking at Linux with ext2, ext3 or (probably) ext4, you want e2fsprogs, specifically the debugfs program.

For NTFS and FAT32, there may be Linux-based utils that will provide that information but you might also look into the Windows Defragmentation API, but there seems to be little information about it. Jeffrey Wall's C# wrappers for the Windows defragmentation API might be a good place to start, and the MyDefrag forums might also have some information of use.

Quick additional notes:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.