[comp.sys.ibm.pc] Cluster Size on disks?

"Arnold G. Gill" <GILLA@QUCDN.QueensU.CA> (04/07/90)

     The cluster size depends explicitly on the software used to format them.
For example, with MS-DOS 2.1, the cluster size on the hard disk was 8k.  At
MS-DOS 3, the cluster size dropped to the current 2k.  I don't know if it is
any different for the very large (40+ Mb) hard disks, but it might be.

     I found it interesting to find out that the high-density disks have 1/2k
cluster sizes.  Is this due to the fact that the extra address space needed is
available on 286 machines, but never on 8088/8086 ones?
-------
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|  Arnold Gill                        |                                     |
|  Queen's University at Kingston     |     If I hadn't wanted it heard,    |
|  BITNET   : gilla@qucdn             |       I wouldn't have said it.      |
|  X-400    : Arnold.Gill@QueensU.CA  |                                     |
|  INTERNET : gilla@qucdn.queensu.ca  |                                     |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

KDA101@psuvm.psu.edu (KeithPetto Alexander) (04/09/90)

In article <90096.104817ESH101@psuvm.psu.edu>, Eric Hvozda
<ESH101@psuvm.psu.edu> says:
>
>My question what is a cluster?  Is is equated with the BLKSIZE on mainframes,
>or is it some kind of I/O buffer size?

A cluster is the smallest amout of space you can alocate to a file.  On the
mainframe here at PSU the smallest amout of space is called Block size as
you have noted, if a file gets larger than one block by even one byte, it
takes up two blocks.
                                       Petto :->

"You weren't like that before the beard."  -- Q

Petto is still an AI program run amuck, his opinions are the result
of a deranged program from a less deranged programmer.
kda101@psuvm.psu.edu

PMW1@psuvm.psu.edu (Peter Weiss) (04/09/90)

In article <90098.164830KDA101@psuvm.psu.edu>, Keith "Petto" Alexander
<KDA101@psuvm.psu.edu> says:
>
>In article <90096.104817ESH101@psuvm.psu.edu>, Eric Hvozda
><ESH101@psuvm.psu.edu> says:
>>
>>My question what is a cluster?  Is is equated with the BLKSIZE on mainframes,
>>or is it some kind of I/O buffer size?
>
>A cluster is the smallest amout of space you can alocate to a file.  On the
>mainframe here at PSU the smallest amout of space is called Block size as
>you have noted, if a file gets larger than one block by even one byte, it
>takes up two blocks.

A BLKSIZE in the MVS world has no direct relationship to disk/tape
geometry, but is often times used as the unit of physical data transfer
in Queued non-VSAM access methods.  (Typically, VSAM does it's physical
I/O based on Cluster Index.) The basis of queued record processing is
the LRECL, which populates the BLKSIZE.  Nevertheless, chosing a _good_
BLKSIZE can improved the performance of your program (sometimes,
though, at the expense of system thruput in a multitasking system).

On a real 3380 DASD controlled by MVS, the minimum unit of allocation
is the track (47,476 bytes).  Though the Channel Command Word has 16
bits for a block length (65,535 bytes), I don't recall that the
standard access methods support more than 15 bits (32,767 bytes).
Consequently, based on the CKD geometry, it would appear that a maximum
BLKSIZE of 23,476 bytes, would give a 98.9% utilization of the track
(Source - IBM 3380 Direct Access Storage: Reference Card form
GX25-1678-4 (October, 1987)) assuming non-keyed data.

I don't know what happens to track utilization when you start emulating
another device type on a foreign geometry.
--
Peter M. Weiss                   |  (this line intentionally left blank)
31 Shields Bldg (the AIS people) | advertize here, reach Mega populi
University Park, PA USA 16802    | Disclaimer -* +* applies herein

ted@helios.ucsc.edu (Ted Cantrall) (04/12/90)

>     The cluster size depends explicitly on the software used to format them.
>For example, with MS-DOS 2.1, the cluster size on the hard disk was 8k.  At
>MS-DOS 3, the cluster size dropped to the current 2k.  I don't know if it is

I had my ST-225 divided into 4 partitions when I first got it. (Just exploring
the options) When I realized that I was getting 4K clusters, I repartitioned
to one and my cluster size went to 2K. (dos 3.21) 	-ted-

-------------------------------------------------------------------------------
ted@helios.ucsc.edu         | "If I get any phone calls while I'm gone,
(408)459-2110               |    just don't answer them."
-------------------------------------------------------------------------------

pnl@hpfinote.HP.COM (Peter Lim) (04/13/90)

> 
>         Here's the deal, I have tested several disk drives, and found that
> the cluster size of a low density (3.5 or 5.25") disk is 1024 bytes.  The
> cluster size of a high density (again 3.5 or 5.25") disk is 512 bytes.  And
> the hard drives I have tested all have 2048 bytes per cluster.  I tested
> each drive with Norton Utilities, NU program, under Disk Information, under
> Technical Information.  It claimed the Cluster size for each hard drive was
> 2048 bytes, it did not explicitly state the cluster size for any of the
> floppy drives, but you can sort of extrapolate it.  I also tested the drives
> by copying files to them and by a method of asking TurboC for the sector
> size in bytes, and multiplying it by the sectors per cluster number.
>        I have also heard (a while back, I don't remember where) that some
> hard disks have cluster sizes of 4096 bytes.  Now, what I would like is to
> know is what is the size your cluster?? I am writing a program that shows
> how much space a file actually uses on your disk (I know there are other
> programs that do this) and I would like to make sure everyone is counted.
>        If anyone has any info about this other than your own cluster sizes,
> I wouldn't mind it being posted, like why the cluster sizes are different,
> I know it has to do with the amount of space allocated for the fat but why
> are high and low density clusters like they are? (and so on).
>        As for your personal cluster sizes, if everyone just e-mailed them
> to me, I would post a summary in a week or two.  Thanks for your responses!
> 
>                                        Petto :->
> 
Okay, lets sum everything up. The cluster size have to do with the size
of the disk and the number of bits used in the FAT (file allocation table).

For DOS2.1 they used strictly 12-bit FAT and when your hard disk size
is > 16 MB, the cluster size becomes 8K (very wasteful). Then come DOS3.x;
and somehow, M*cr*S*ft decided that for disk size less than 16 MB, use
a 12 bit FAT which resulted in 4K cluster size. And for disk size >= 16 MB,
use 16 bit FAT which gives 2K cluster size. Neat isn't ? The floppy cluster
size is pretty standard (1K for low density & .5K for hi density); but
this has something to do with selected FAT size and disk capacity and NOT
the addressing capacity of AT vs XT. This information is tucked away
somewhere in DOS and can be obtained via. DOS interrupt service. I've
done this before but can't quite remember how to.

In fact, I've written a C program (MSC) which works like the UNIX "du"
command, but can tell the different cluster sizes. It will also deduce
the amount of space needed for the directory entry (in a kludgy way :-))
and allow you to force size evaluation to a fixed cluster size (this allows
you to do "du" on a hard disk with a cluster size of floopy disk; then you
can be sure if the files will fit on the floppy). I wrote this way back in
1987 using the "DIR" package posted by someone else (sorry can't remember
his name). Works fairly fast as far as I'm concern. May be I'll post it
to the net sometime soon ..... (if anyone e-mail request to me, it might
be faster  :-)  .. as getting from MS-DOS to UNIX is not exactly trivial
at this site).



Regards,                       ## Life is fast enough as it is ........
Peter Lim.                     ## .... DON'T PUSH IT !!          >>>-------,
                               ########################################### :
E-mail:  plim@hpsgwg.HP.COM     Snail-mail:  Hewlett Packard Singapore,    :
Tel:     (065)-279-2289                      (ICDS, ICS)                   |
Telnet:        520-2289                      1150 Depot Road,           __\@/__
  ... also at: pnl@hpfipnl.HP.COM            Singapore   0410.           SPLAT !