Brett Glass to the Rescue
 Solutions to your toughest technical problems.     http://www.brettglass.com

Links 
 
 Back to the 
"Brett Glass to the Rescue" Index 

Back to the 
YMMV Home Page 
 


How Much Free Disk Space Do I Really Have? 
Q: I've run into an odd discrepancy on which perhaps you can shed some light. When I checked my Windows 95 system's hard drive to determine how much space was in use, I got different values depending on the method I used. 
 
When I opened the "My Computer" icon and checked the properties of the C Drive, I saw a capacity of 539,639,808 bytes with 409,403,392 bytes used. When I opened a DOS session and invoked CHKDSK, I saw a capacity of 539,688,960 bytes with 410,401,120 bytes used. Finally, the DIR command with the /s option said that only 314,419,504 bytes were used. 
 
Can you explain the different values? Which is the most accurate? 
 
Thomas R. Glasco 
 
A: There are several ways to measure both the available space on a disk and the amount of space that's "used." 
 
First, there's the issue of the File Allocation Table, or FAT, which stores essential bookkeeping information for the operating system. Some programs include the FAT when computing the disk's total capacity. Others exclude it because it can't be used to store your data. Likewise, some programs include the disk's boot sector and root directory, while others exclude it. 
 
Second, there's the issue of directories. Some programs count the space used to maintain directories (represented on the "desktops" of graphical user interfaces as "folders") as part of the space that's used to store data. Others do not. The latter programs will, of course, report that less space is in use. 
 
Third, there's the issue of "slack" space. Some programs, such as DIR, report the amount of space used by a group of files simply by adding up the lengths of the files. However, because the operating system allocates space in fixed-sized blocks called "clusters," the amount of disk space reserved for each file is always greater than or equal to the "size" you see when you do a directory listing. For example, on a disk which is divided into 8K clusters, a 1 byte file takes up 8192 bytes (a full cluster) and wastes all but one of them! The wasted space is called "slack." The more small files you have, and the larger the clusters on your drive, the more room is likely to be wasted. 
 
In general, it's best to use the most conservative estimate of how much space you have left. You won't be able to use every byte of that space, since -- as mentioned above -- some of it will inevitably be lost to slack. So, when you figure how much more data you'll be able to store, deduct 20%. 

One thing you can do to reduce the amount of slack is divide your disk into smaller partitions with smaller clusters. (PartitonMagic, from PowerQuest, can help you do this.) Another way to reduce waste is to move to an operating system that stores files more efficiently. OEM Service Release 2 of Windows 95 includes the FAT32 file system, which creates smaller clusters. (You'll need to reformat, however, to move to FAT32 from an older file system.) And UNIX -- virtually any version -- uses a different scheme called "inodes" that's more efficient still. 
 

© 1998 by Brett Glass. All rights reserved.  About us  | Feedback Trademarks