home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 1998 July / Image.bin / FESTPLAT / CLUSTRS / CLUSTR!.EXE / CLUSTERS.TXT < prev   
Encoding:
Text File  |  1995-11-07  |  4.9 KB  |  110 lines

  1. With the advent of larger and larger hard disks, one of the factors
  2. that seems to be consistently overlooked is the factor of cluster
  3. size.
  4.  
  5. A cluster is the smallest allocation unit on a disk.  Every file that
  6. is created on a disk drive takes up at least one cluster.  MS-DOS and
  7. Windows 95 use a file system called FAT (file allocation table).  One
  8. of FAT's limitations is that it can only address a finite number of
  9. clusters on a hard disk.  So, as hard disk partitions get bigger, so
  10. must cluster sizes.  IBM's OS/2 operating system can be set up to use
  11. an alternate file system, called HPFS (high performance file system),
  12. that does not have this limitation.
  13.  
  14. This chart shows the relationship bewtween hard disk partition size
  15. and cluster size.  This table applies to all version of DOS from 4.0
  16. on up.
  17.  
  18.      +----------------------------------------+
  19.      | Partition size    |  Cluster Size      |
  20.      |-------------------+--------------------|
  21.      |    0MB - 128MB    |   2K (2048 bytes)  |
  22.      |  129MB - 256MB    |   4K (4096 bytes)  |
  23.      |  257MB - 512MB    |   8K (8192 bytes)  |
  24.      |  513MB - 1.02GB   |  16K (16384 bytes) |
  25.      | 1.02GB - 2.04GB   |  32K (32768 bytes) |
  26.      +----------------------------------------+
  27.  
  28.  
  29.  
  30. As you might guess, a smaller cluster size will waste less of your
  31. hard disk.  A batch file with 400 bytes in it will consume one
  32. cluster, regardless of whether it's a 2K cluster or a 32k cluster.
  33.  
  34.  
  35. Why did I write CLUSTERS?  Well, I was contemplating the purchase of a
  36. one gigbyte hard drive, and I was wondering how much of it would go to
  37. waste when I re-installed my files.  I figured a more generic utility
  38. might be usefull to the public.
  39.  
  40. CLUSTERS will examine the size of each individual file on a specified
  41. hard drive.  It will display a chart showing the cluster alocation for
  42. all five possible cluster sizes.  The current cluster size of the hard
  43. drive being processed is highlighted.
  44.  
  45. Simply type CLUSTERS at the DOS prompt.  It will ask whish drive you
  46. would like to examine, and will ask what your "pain threshold" is.
  47. The pain threshold is simply the highest percentage of waste that you
  48. think is tolerable.  If using a cluster size would exceed this number,
  49. the screen report will flash the number.  CLUSTERS will first create a
  50. list of all he directories on your hard drive.  Don't be alarmed if
  51. the listing pauses -- some directories contain a lot of files to
  52. process.
  53.  
  54.  
  55.  
  56. Next, CLUSTERS will check the size of every file on your hard drive,
  57. and will display running computations for all five default cluster
  58. sizes used by MS-DOS.  The screen will look this:
  59.  
  60. -------------------------------------------------------------------------------
  61.  
  62.  Disk usage prediction program                            (c) Nathan C. Durland
  63.  Processing  283  directories. Pain threshold is  30.00%
  64.  Current drive cluster size is  8192
  65.  Directory D:\WORKSHOP\RESTEST\
  66.  File:     RESTEST.TXT
  67.  
  68.     5,739 Files have been checked.     283 directories have been checked
  69.  
  70.  
  71.  Clust Size  Clust Alloc     Bytes Alloc     Bytes used         Wasted   %Slack
  72.  ~~~~~~~~~~  ~~~~~~~~~~~     ~~~~~~~~~~~    ~~~~~~~~~~~        ~~~~~~~  ~~~~~~~
  73.    2,048        132,155      270,653,440    253,032,550     17,620,890     6.51
  74.    4,096         70,602      289,185,792    253,032,550     36,153,242    12.50
  75.    8,192         40,047      328,065,024    253,032,550     75,032,474    22.87
  76.   16,384         24,919      408,272,896    253,032,550    155,240,346    38.02
  77.   32,768         17,531      574,455,808    253,032,550    321,423,258    55.95
  78.  
  79.  DOS partition size/cluster size relationship:
  80.      0MB - 128MB  =  2K (2048 byte) Clusters
  81.    128MB - 256MB  =  4K (4096 byte) Clusters
  82.    256MB - 512MB  =  8K (8192 byte) Clusters
  83.    512MB - 1.02GB = 16K (16384 byte) Clusters
  84.   1.02GB - 2.04GB = 32K (32768 byte) Clusters
  85.  
  86. ------------------------------------------------------------------------------
  87.  
  88. Personal observation  --  Every menu item on the Windows95 "start" menu,
  89. and meny of your "normal" icons, represents what Microsoft calls a
  90. "shortcut".  Shortcuts are small (200-400 byte) files that point to the
  91. "real" file.  This is very wasteful of space on big disks.
  92.  
  93. CLUSTERS, it's source code, and the documentation is placed in the
  94. public domain; however, I retain all copyright to the program and
  95. source code.  You cannot charge for, sell, or lease this program.
  96.  
  97. If you think CLUSTERS is kinda cool, let me know.. E-Mail me at
  98. OFFSYS@CENCOM.NET on the internet, NDURLAND on America on-Line, or
  99. 76467,3355 on CompuServe.
  100.  
  101. If you are feeling philanthropic, send a $5.00 donation to:
  102.  
  103.     Nathan Durland
  104.     47 Spring St.
  105.     Keeseville,  NY 12944
  106.  
  107. Clusters was written using PowerBASIC, from POWERBasic inc.  If you
  108. need a DOS compiler that easier to use than C or C++, and generally
  109. creates faster executables, it's the only way to go.
  110.