Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!hybrid!robohack!druid!darcy From: darcy@druid.uucp (D'Arcy J.M. Cain) Newsgroups: comp.sys.ibm.pc Subject: Re: What should I do when HD has lost clusters ? Keywords: Hard Disk Drive, Lost Cluster Message-ID: <1990Jun3.210946.1088@druid.uucp> Date: 3 Jun 90 21:09:46 GMT References: <10755@medusa.cs.purdue.edu> Reply-To: darcy@druid.UUCP (D'Arcy J.M. Cain) Organization: D'Arcy Cain Consulting, West Hill, Ontario Lines: 67 In article <10755@medusa.cs.purdue.edu> wjin@cs.purdue.EDU (Woochang Jin) writes: >I have a 42 M Fujizu MFM hard drive and when I 'chkdsk', it complains : >11 lost clusters. convert to files ? >My friend advised to reformat the disk drive. Re-format your list of friends. :-) >So I backed up the whole >disk and reformatted it using 'Disk Manager' which was provided with the >hard disk. I chkdsk'ed and it was ok. But after a week, the lost clusters >happened again. But the whole thing seems to work O.K. >Do I leave it or have to do something for this ? >Could anybody tell me why this happens and what I should do this case ? >I saw an advertisement of SpinRite II and it seems to fix almost everything >in hard disks. Will it be of any help ? > Although not that frequent, this question is pretty standard and should probably be added to the FAQ. OK, first a short course in how DOS handles files. I will ignore the question of subdirectories for the moment. Each DOS disk whether hard or floppy has a directory area and a FAT (*) or "File Allocation Table." The FAT is a table with one entry for each possible cluster on the disk. As an example, consider a mythical disk which is 4K and uses a cluster size of 1K. Assume that the FAT and directory are in addition to the 4K. When the disk is first formatted, the FAT is set up with with 4 entries, with 0 in each entry. This indicates that no clusters on the disk are in use. Let's say you now create a 2K file. DOS finds the first 2 available clusters on the disk (1 & 2 in this case) and reserves them for the file. It places a 2 in entry 1 to show that the files which starts in cluster 1 continues in cluster 2. It places a -1 in entry 2 to indicate that the file ends in that cluster and does not continue. Now the entire file is pointed to by following the pointers starting at entry 1 in the FAT. DOS next has to point to the first cluster of the file and somehow keep track of the file name and other information. It uses the directory for this. It finds the first directory entry that is not being used and puts into it the file name, date and other information including the number of the first cluster where this file is stored. Now back to the question. Consider what would happen in the above example if the computer lost power after creating the FAT entries but before it had a chance to create the directory entry. You now have a bunch of clusters which are reserved for a file but there is no pointer to it so you can't access the file. This is what chkdsk determines. It sees that there is a cluster chain but it can't find any directory entry so it reports that there are some lost clusters. What do you do about this? Run chkdsk with the '/f' option. When it asks you if you want to save the clusters say yes. Chkdsk will then give all the lost chains a name in the form "FILExxxx.CHK" where "xxxx" is replaced by a number. These files are created in the root directory. You can then examine these files to see if there is anything important but the usual next step is to simply erase them. This will free up all the space lost to unreferenced clusters. Well, I didn't mean to write a novel here but I hope this clears up the subject for many people. BTW: I have made a number of simplifications above so it isn't exactly as described but the essentials should be correct. -- D'Arcy J.M. Cain (darcy@druid) | Government: D'Arcy Cain Consulting | Organized crime with an attitude West Hill, Ontario, Canada | (416) 281-6094 |