[Ocfs2-devel] Calculating volume size from superblock

Joel Becker Joel.Becker at oracle.com
Mon Aug 2 12:46:05 CDT 2004


On Mon, Aug 02, 2004 at 11:13:46AM -0700, Villalovos, John L wrote:
> How do I calculate the size of the volume from the superblock?
> 
> Do I just use the two fields:
> 
> u_int32_t s_blocksize_bits;         /* Blocksize for this fs */
> u_int32_t s_clustersize_bits;       /* Clustersize for this fs */
> 
> What is the formula to use?

	As Sunil pointed out, you need to use the global bitmap to
determine the number of clusters and multiply it by the clustersize.
The libocfs2 library can help you get that information, or you can code
up the bits to parse the information yourself.  Doing it yourself means
learning how to navigate directories.

Joel

-- 

"Sometimes I think the surest sign intelligent
 life exists elsewhere in the universe is that
 none of it has tried to contact us."
                                -Calvin & Hobbes

Joel Becker
Senior Member of Technical Staff
Oracle Corporation
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127


More information about the Ocfs2-devel mailing list