[TriLUG] Disk space calculations in Linux
djerman at pobox.com
Fri Jan 25 18:02:16 EST 2008
On 1/25/08, Owen <oberry at trilug.org> wrote:
> On Fri, Jan 25, 2008 at 12:42:32PM +1100, Jeremy Portzer wrote:
> > William Sutton wrote:
> > > While we're discussing... how much space gets wasted in overhead of files
> > > that allocate a particular block size but don't use all of the blocks?
> > I think you mean, files that don't use all the bytes in a block.
> > That is an important difference - du - disk usage - will list the actual
> > disk usage. The output of du will always be in increments of the file
> > system block size (I'm not quite sure exactly how this is determined,
> > but in most of my ext3 filesystems, this unit seems to be 4096 bytes,
> > determined by running "dump2fs" - there may be simpler way to show this).
There are yet more rounding errors lurking in the wings - fdisk
typically rounds off at cylinder boundaries. The size of the
round-off error depends on your physical disk layout more than
capacity, but larger disks tend to have more platters, and therefore
larger cylinder sizes, so when you say you want a partition of so many
GB, you may get a little more or a little less.
Similarly, your LVM physical volumes will be allocated at a particular
block size, depending how they're set up.
These losses will be independent of filesystem block size, but may
contribute to differences in the size of the partition or logical
volume in which you've built a filesystem.
More information about the TriLUG