Re: Disk Usage Incorrect
Re: Disk Usage Incorrect
- Subject: Re: Disk Usage Incorrect
- From: Jerry Pendergraft <email@hidden>
- Date: Wed, 12 Jan 2005 16:34:07 -0600 (CST)
On the point of comparing file size to allocated size I did a quick and
dirty perl script to stat files and find out what allocated size was for
various file sizes. Got a big surprise when this reported more than a
fraction of a block of waste for larger files. And the the minimum
allocation seems to be 8 blocks even for the 1 byte file.
Does darwin set the stat struct variable st_blocks somehow different than
the man page describes as /* blockes allocated for file */ ??
Surely something is fishy here?
foreach my $filename (@ARGV)
{
chomp($filename);
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($filename);
my $allocsize = $blksize * $blocks;
printf("blksize:%d blocks:%d usage:%d\n", $blksize, $blocks, $allocsize);
printf("%-14s size:%d alloc:%d waste:%d\n", $filename,
$size, $allocsize,
$allocsize - $size);
}
--
Jerry Pendergraft email@hidden
Endocardial Solutions voice: 651-523-6935
1350 Energy Lane, Suite 110 fax: 651-644-7897
St Paul, MN 55108-5254 mobile: 651-491-0163
On Wed, 12 Jan 2005, Jonas Maebe wrote:
>
> On 12 jan 2005, at 22:49, Eric Ocean wrote:
>
> > The number of files is 860,137. I haven't run fsck yet; I guess I'll
> > do that now.
>
> fsck does the same as Disk Utility.
>
> What does
>
> sudo du -ks /*
>
> say?
>
>
> Jonas
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden