This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: du does not find all directories


MLDickey@softart.com wrote:
> 
>    The cluster size under Win95 is dependent on the size of the partition in
>    question.  I think I have some rough numbers ... nope can't find them.
> 
>    I don't remember where I've seen them, but it's true.  The larger the
>    partition size, the larger the cluster size.  The table is ROUGHLY like
>    this:
> 
>          0-200M    4k
>        201-500M    8k
>       500-1000M   16k
>      1000-2000M   32k
> 
>    Again, these are rough -- from memory not from valid source.

It's more useful to understand how things work than to memorize tables.
A FAT16 filesystem stores cluster numbers in 16 (funny thing) bits, so a
cluster can be at most <partition size>/2^16 bytes.  If you want to turn
that into a table, you get:

cluster size    partition size
512             0-32M(-1)
1K              32M-64M(-1)
2K              64M-128M(-1)
4K              128M-256M(-1)
8K              256M-512M(-1)
16K             512M-1G(-1)
etc. (note that DOS can't handle partitions >= 1G)

Note, though, that the cluster size has NOTHING WHATSOEVER to do
with the numbers reported by ls and du; under cygwin, they report
strictly based upon the file size, but they report half as many blocks
as they should.  The fact that they don't know about clusters makes them
not very useful, even if they did report the right numbers; if you
have 1000 100 byte files on a 512M partition, you are actually
using 15.6M, but a "working" du would think you are only using 500K.
Now you know where your disk space is going!  If a 32:1 disk space usage
for small files isn't what you had in mind, consider switching to NTFS
(or FAT32 if you have it).  There's even a freeware NTFS redirector that
you can run under Windows 95, though I haven't tried it and don't
know how reliable it is (it was created by reverse engineering NTFS,
the precise details of which seems to be on of those MS "secrets",
though there is a pointer to the redirector on one of MS' own pages).

--
<J Q B>
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]