MacOS size weirdness
Peter Bagnall
yellowdog-general@lists.terrasoftsolutions.com
Mon Jul 15 08:01:01 2002
> But part of what puzzles me is that this is occurring on a /brand new/
> installation. I just reformatted the whole hard drive and did a basic
> installation off a MacOS 9.1 install CD. I haven't had time to corrupt
> anything. =)
That's the reason I suspected block size as the culprit. I must admit
I'm puzzled why the 1Gb disc is reporting 431.2 MB used in total, but
only 252.5 used by the system folder etc. It seems a remarkable
coincidence that the size is the same as the size used by the larger
disc though.
I've just been looking a bit more closely at an HFS standard partition
using OS X. The command line allows a bit more analysis that you can
easily do on Mac OS 9. The partition is 1013.9MB, so roughly the same
size as yours.
If I select everything on the disc and do "get info" I get 350.9MB on
disk (313,380,894 bytes)
If I select the disk itself I get 373.1 MB on disk (391,266,304 bytes)
That's a diff of 22.2 MB
Now, if I check to see how many blocks are being used from the teminal
in MacOS X I get
total blocks = 2076640
used = 764192
note: this suggests 512 byte blocks, unfortunately this might not be
true, the unix tools display things pretending it's 512 byte blocks even
if your block size is bigger. Doesn't actually matter at for what I'm
doing, so lets just be naive and believe it, for now...)
Now if I use another tool to see how many blocks are used by files I get
760096. So the total used is 4096 more than is used by files. That's
about 2MB. That's ok, that 2MB will be things like the free block map
and other data structures of that ilk. So that leaves 20.2MB to track
down.
Ok, now I can list by directory, and on the command line I see loads of
files that I can't see in the finder, such as Desktop DB, Desktop DF and
so on. Summing all the files in that list (that don't appear in the
Finder) accounts for 41282 blocks which is about 20.2MB, voila!
So my disc checks out ok. BUT, comparing the files sizes in bytes with
the number of blocks being used there's something odd going on. Every
file seems to be using a blocks in multiples of 32. Now remember I said
that unix has a tendency to lie about block sizes in the tool I'm using,
what that really suggests is that the block size is 32 times bigger than
it's quoting. That would be a block size of a huge 16kB. On a 1 GB disc.
There is another possibility, that HFS standard allocated blocks in 16kB
groups, but that would be rather strange, that is it allocates 32 blocks
at a time to a file. This tallies with what get info says though. It
reports 16kB used for a 600 or so byte file. That really does suggest a
16kB block size, which is frankly much bigger than I would expect.
Just looking for this effect on my HFS+ partition and it seems to have
4kB blocks which is more as I would expect.
To summarise - it seems that there are a significant number of hidden
files, which doing a select all and get info will not report, about 20MB
worth on my disc (which doesn't have a system installed on it). So it
could be that you're just seeing a lot of hidden files there. It also
seems that block sizes are bigger than you might have imagined, so the
amount of wasted space is going to be pretty large. A rough guide to
this is the number of files on the disc, could you let us know how many
files there are? Trash is hidden, so emptying that will help. I think
someone else has mentioned this already. Rebuilding the desktop may also
change things too, so you might want to try that, cause the desktop DB
is a hidden file, and I think it can get quite large, although you would
expect it not to be just after installing!
But all in all, although what you're seeing is annoying, I don't think
it's actually a cause for alarm. I think your system is almost certainly
working just fine, it's just that some subtleties of the file system are
getting in your way. To really get to the bottom of it you're going to
have to get hold of some tools for MacOS 9 which allow you to see hidden
files etc so you can really see what it going on. I hope this has given
you a little peace of mind though.
> Unless you think this indicates some more serious
> problem--corruption in the formatting itself, or (god forbid) some
> physical problem with the disk.
When you format, the system should mark any bad blocks. A bad block
indicates a region on the disc which has failed for some reason. A few
years back it was very common for discs to have a small number of bad
blocks and no one worried about it. I've not noticed it on any discs of
mine lately but I think they may be getting better at hiding them.
Anyway, if there are bad blocks on the disc you should be alerted to it
if you do a surface scan of the disc. You don't need to worry about a
few, but if you have lots it's time to change the disc. Lots suggest the
disc may fail catastrophically in the near future. Discs do all
eventually die this way, but in recent years many people won't have
noticed this fact since computers go obsolete long before many discs
fail on them!
All in all, I doubt this is a problem, but do a surface scan just to be
safe.
> I'm probably going to reformat again
> within the next few days, so it's not like this is an installation I'm
> going to
> be depending on. But it is hardware I'll be depending on, and I'd like
> to
> get to the root of this before I reformat, in case it informs the sizes
> or
> filesystems I choose...
MOL will run off HFS+ ok I believe, but unless someone has finally
written an HFS+ filesystem for linux it won't be accessible in linux.
HFS is however accessible in linux as you say. The way I've done this in
the past is to use an HFS+ partition as my MacOS install, as big as you
think you will need (also used by MOL). A 2Gb or so HFS partition to
exchange data with linux, and then the rest in linux partitions of
various sizes. I did find an extension for MacOS a while ago for
mounting ext2 partitions in MacOS. I think it was called MountX. It
worked just fine apart from being VERY slow, but if you can live with
that it may be of some help to you. It has been a couple of years since
I tried MountX though, so things may have improved. It was on MacOS
8.something too so I suggest you check compatibility first too.
You may want to make your MacOS partition larger than 1GB too, I'd go
for 2-4 GB myself because I'd install software on the HFS+ partition.
MacOS software is of no use to linux, MOL will be able to use it cause
it can read HFS+ (cause it uses the MacOS filesystems not the linux
ones). The only things I'd put on the HFS are the files I wanted access
to in both systems, which should be ok in 2GB.
Hope this is helpful
Pete