Top Navigational Bar

The Truth About Lost Allocation Units And Cro
DocumentID: 628689
Revision Date: 29-Feb-96 1:42:31 PM

The information in this document applies to:
WordPerfect® 5.1 for DOS

Problem

Solutions: What is a Lost Allocation Unit or a Lost Cluster?
In fact, it is not lost at all. It is really a "found allocation unit" whose owner is unidentified. Let me explain...

A file is stored on a hard drive in allocation units. An allocation unit (also referred to as a cluster) is the smallest chunk of data that the hard drive can store or address. Typically it consists of four sectors (1 sector = 512 bytes; 4 sectors = 2K). Cluster size increases as hard drive size increases. On larger hard drives, an 8K cluster or allocation unit is common. We'll use a 2K cluster size for the examples in this document. If you were to save a file containing only one byte, it would still consume an entire cluster on the hard drive.

The hard drive is organized into different areas: the Reserve Area or Boot Sector, the File Allocation Table, the Root Directory, and the Files Area which contains the files and subdirectories stored on the disk. The Directory Table is actually a file stored on the disk. The File Allocation Table (FAT) contains an entry for each and every cluster in the Files Area of the hard drive. These entries can indicate that the corresponding cluster is unused, reserved, bad, or contains the next cluster of a file or the last cluster of a file.

As the file is written to the hard drive, the first 2K of data is written in one allocation unit or cluster. The next 2K is written in another cluster. These clusters can be contiguous or not, depending on the fragmentation level of the hard drive. DOS simply picks the next available cluster and writes to it. This continues until the file is completely written. DOS records the name of the file in the Directory Table. It also records in the Directory Table the File Allocation Table entry which contains the location of the first cluster of the file. That same FAT entry also contains the entry number for the next cluster of the file. The FAT entry for the last cluster contains a last cluster of file value rather than the entry for the next cluster location. As DOS writes the file in the above example, each time it prepares to write a cluster of data, it checks the FAT to determine the location of the next available cluster.

Now that we understand a bit of how DOS uses the Directory Table and the File Allocation Table (FAT), we can better understand lost allocation units. When we run CHKDSK, it checks all of the files listed in the Directory Table and compares them to the information in the FAT. When it compares the files listed in the Directory Table and checks the clusters indicated in the FAT as in use, it sometimes finds that there is a cluster that is marked as "in use" in the FAT, but which is not part of any file listed in the Directory Table. None of the current files in the Directory Table include that allocation unit. DOS reports this cluster as a "Lost Allocation Unit" because it is marked in the FAT as in use, but none of the files claims it. This is why I said they are really "found" allocation units. It was never really lost, but it was "lost" from the list of available clusters and now it has been found.

What causes Lost Allocation Units?
This is the source of much confusion. There are those who think that DOS simply loses parts of files and they become "lost." While this can conceivably happen, it is not a common occurrence and would not account for ten to fifteen megabytes of lost allocation units occurring in a relatively short period of time on a single computer.

The most common, identifiable cause of lost allocation units is simply user error. When you use software that makes temporary files and you do not exit that program before turning off or rebooting the computer, you are likely to find lost allocation units. These are not parts of program files, nor are they parts of data files. They are most often temporary files that were never properly closed and deleted. WP 5.1 DOS is a good program to use to demonstrate this. Turning the computer off without exiting WP 5.1 on a continual basis will lead to considerable lost allocation units.

What other programs write temporary files? Current DOS and Windows versions of WordPerfect do. Microsoft Windows does. Most current WPCorp programs do. Many other programs from other companies do as well. Does this mean that the lost allocation units are WordPerfect's fault? Absolutely not. When WP is exited normally, all temporary files are closed and deleted.

Any time you find lost allocation units on a customer's computer, you should recommend to them that they always close or exit their programs and Windows before turning the computer off or rebooting.

Why do customers find parts of their current documents in these .CHK files that are created from lost allocation units by CHKDSK?
Remember that when WP opens a document and manipulates it, it continually writes parts of it in the temporary file. When printing, the document is written to a temporary print file. If these temporary files are not closed and deleted properly, they may become lost allocation units.

What happens if the computer locks? The customer can't exit WP before rebooting.
This is true. Locking is another cause of lost allocation units, but one that is harder to control. The cause is still the same, but the customer has little or no control over it. After rebooting from a locked computer, it is a good idea to run CHKDSK to verify whether any lost allocation units have occurred. On computers running MS-DOS 6.2 or newer, either SCANDISK or CHKDSK can be used.

What does CHKDSK mean when it says there is a certain number of lost allocation units in a certain number of chains?
This is the file structure we spoke of earlier. These chains are actually files, or at least pieces of files. For example, there might be 100 lost allocation units in 2 chains. That means that the File Allocation Table entries for the lost allocation units shows them as parts of two files. But, as explained earlier, none of the files in the Directory Table includes these clusters.

What does CHKDSK mean when it says there are cross-linked files? Are these more lost allocation units?
Cross-linked files are much more serious than lost allocation units. As explained earlier, lost allocation units are clusters marked in the FAT as in use, but that are not part of any file in the Directory Table. They were simply not deleted properly. Cross-linked files are two or more current files that include the same cluster or clusters. For example, you might have two cross-linked files. This means that two or more FAT entries point to the same FAT entry as part of a file. Obviously, any given cluster can only be part of one file. The other file (or files) has become damaged so that one of the FAT entry pointers is pointing to the wrong FAT entry.

After all is said and done, what this means is that at least one of the two files is already damaged. Part of it is already lost. Normally, one of the files will probably load and work properly, because the "shared" cluster is actually part of this file. The only solution to this problem is to manually copy the cross-linked files to another location, then fix the crossed links. Both files will probably be damaged after the links are fixed. We should never tell a customer to run CHKDSK/F on a drive with cross-linked files or to use any other utility to fix them. Even if we follow this above procedure correctly, one (or more) of the files will be damaged when you are finished (since it already was). The customer will probably blame you when they can't retrieve the damaged file(s).


In Summary:
-      Lost Allocation Units are clusters that are marked "in use" in the File Allocation Table, but are not included in any of the files in the Directory Table. They most generally come from temporary files that were not properly closed and deleted. They are usually created when users turn off or reboot their computer without first exiting to the DOS prompt. Locking while in certain programs will also cause lost allocation units.

-      Chains are strings of lost allocation units that are linked together in the FAT as if part of a file. They were originally part of the same temporary file which was not properly closed and deleted.

-      Cross-linked files are two or more files containing FAT entries that point to the same FAT entry, referring to a common cluster on the disk. Only one of the files is the actual owner of the cluster. The others are damaged and will most likely be lost or damaged further when the links are repaired.

-      Lost allocation units and lost clusters are the same thing. A cluster is an allocation unit. Clusters on hard drivers generally vary from 2K to 8K in size (4 to 16 sectors).

-      The File Allocation Table (FAT) contains an entry for every allocation unit (cluster) in the Files area of the hard drive. The entry identifies whether the associated cluster is reserved, unused, bad, or contains the next cluster of a file or is the last cluster of a file.

Answer:

Details:


Product specifications, packaging, technical support and information (*Specifications*) refer to theUnited States retail English version only. Specifications for other versions may vary. All Specifications, claims, features, representations, and/or comparisons provided are correct to the best of our knowledge of the date of publication, but are subject to change without notice.OUR MAXIMUM AGGREGATE LIABILITY TO YOU AND THAT OF OUR DEALERS AND SUPPLIERS IS LIMITED. IT SHALL NOTEXCEED THE AMOUNT YOU PAID TO ACCESS THE INFORMATION. SEE LEGAL DISCLAIMER.