TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Mike Ruskai
from: Mike Bilow
date: 1996-01-26 13:48:02
subject: Cluster algorithm

Mike Ruskai wrote in a message to All:

 MR> This is the algorithm I'm using to determine a drive's
 MR> cluster size based on  its size:

 MR> Rough cluster size is drive size divided by 65536
 MR> Convert rough cluster size to binary
 MR> Count number of digits in binary number (starting with first
 MR> '1') Actual cluster size is 2 raised to the power of the
 MR> number of digits above 

 MR> Is there anything wrong with this *other* than it not taking
 MR> into account the  12-bit FAT of a <16MB drive?

This is substantially right.  The cluster size is based on the use of a
16-bit FAT which can point to only 65536 clusters.  (Actually, the number
is slightly smaller due to the media ID byte and some special overhead, but
it is within 10 or so of being correct.)

 MR> The reason I ask is because I have a 60MB FAT partition with
 MR> 2048 byte  clusters, but according to my reasoning, it
 MR> should have only 1024 byte  clusters.

 MR> I shrunk it down from 100MB with PartitionMagic (1.0), but I
 MR> also reformatted the drive.

 MR> Is the cluster size still being affected by what
 MR> PartitionMagic did, or is my  algorithm (and hence my
 MR> understanding of FAT) flawed?

When you format originally, the cluster size information is picked up from
the BIOS Parameter Block in the boot sector.  Partition Magic would not
change this, so running the format program again would likely leave the old
cluster size unchanged.  Nothing prohibits you from using a less efficient
clustering algorithm than is optimal, except for the fact that the FORMAT
program usually does not do it.  FORMAT may assume that only FDISK changes
the partition size, which is reasonable.
 
-- Mike


--- 
* Origin: N1BEE BBS +1 401 944 8498 V.34/V.FC/V.32bis/HST16.8 (1:323/107)
SEEN-BY: 50/99 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 323/107 170/400 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.