up vote 2 down vote favorite
share [g+] share [fb]

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

link|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
feedback

1 Answer

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:

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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