Please How do I calculate the offset of a file within a ext3 partition

Theodore Tso tytso at mit.edu
Mon Jul 23 14:59:03 UTC 2007


On Sun, Jul 22, 2007 at 08:07:31PM -0500, William Tambe wrote:
> Thank you for your response, but one more question, does this logical 
> block 0 hold the header of the file, if not where is located the header 
> of a file in a ext3 filesystem.
> 
> The reason why I need to know that is because I wish to use swsusp on my 
> swap-file so I really need to know the location of the file's swap header.

The swap header is located at the beginning of the file, so yes, that
would be found in block 0 of the file.

The bugger question is what are you *doing*?  If you're just trying to
enable swsusp, you should need to be using debugfs to find the block
number and then manually editing the swap header.  The swap file
should have been set up correctly before you started using it, or if
you want to initialize a new swap-file, you can use the mkswap
command.  If you're needing to manually edit the swap header, you're
almost certainly doing something wrong....

						- Ted




More information about the Ext3-users mailing list