[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH] Include journal size in ext3/ext4 existing size value.



David Cantrell wrote:
> For ext3 and ext4 filesystems, add the journal size to the value we get
> from statvfs() and use that total for the existing size of the
> filesystem.  Existing size is meant to be the amount of space occupied
> by the filesystem on the volume, for journaled filesystems that means
> there is a disconnect between what we get from statvfs() and how much
> space the filesystem consumes on the volume.

FWIW, I don't think stat f_blocks + journal size adds up quite right
either :(  I don't know why.  I didn't write it ;)

I was talking to dlehman on irc tonight ... If you really want to know
the total blocks under the filesystem, for ext$FOO you can do:

# dumpe2fs -h $DEVICE  | grep "Block"
dumpe2fs 1.41.4 (27-Jan-2009)
Block count:              65536
Block size:               1024
Blocks per group:         8192

for xfs you can do:

# xfs_db $DEVICE -c "sb 0" -c "p dblocks" -c "p blocksize"
dblocks = 65536
blocksize = 1024

and those should be accurate for your purposes, if you want to know the
total nr of blocks that are under the filesystem's purview...

-Eric


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]