Author: David LaightDavid Laight Date: Mar 26, 2008 14:38
On Sat, Mar 22, 2008 at 01:10:04PM -0400, Greg A. Woods; Planix, Inc. wrote:
>
> Now as to the problem with your 10485760-byte file, well that's easy
> to understand if you first take a peek at just how much space has
> been allocated for that file (and keep in mind that "du" shows disk
> usage, not file size) [use "stat -s"]. For example when I create an
> exactly 10MB file I get a file that uses 20512 "blocks" (i.e. 512-
> byte-blocks) of disk space. If you multiply that back out then the
> bytes of disk space used are 10502144, i.e. 10.015625MB, and so by
> the logic above that means that in 1MB units the file does indeed use
> what must be counted as 11MB of disk space. This is of course
> because the block size on the filesystem is 16KB, not 512B, and your
> 10MB...
|