Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!usc!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!uw-beaver!Teknowledge.COM!unix!hplabs!hpfcso!hpfinote!pnl From: pnl@hpfinote.HP.COM (Peter Lim) Newsgroups: comp.sys.ibm.pc Subject: Re: Cluster Size on disks? Message-ID: <19450011@hpfinote.HP.COM> Date: 12 Apr 90 19:39:46 GMT References: <90096.100956KDA101@psuvm.psu.edu> Organization: Hewlett Packard CICD Lines: 60 > > 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 !