Number of Sectors of FAT: It must be calculated. The method of calculating the size of FAT has been given in the description of FAT given in the chapter.
The DBR of a FAT32 File System has been given in the figure given next:
Sectors Per Track (or Sectors Per Head): Sectors Per Head is the number of sectors grouped under one head. Likewise, Heads per Cylinder reflects the number of cylinders per head. If this partition is a CHS partition, these values must be the same as those returned by BIOS. If they are not the same, you must consider that the disk has been misconfigured and that the partition may be unusable.
Hidden Sectors: As we have already discussed, this is the number of sectors on the physical disk preceding the start of the volume, before the boot sector itself. It is used during the boot sequence in order to calculate the absolute offset to the root directory and data areas. Think of it as the number of sectors between the beginning of this partition and the partition table itself.
This field should be the same as the "number of sectors preceding the partition" in the partition table. Note that it is not necessarily the physical LBA address of the first sector, as secondary partitions may exist.
If the Hidden Sectors are not the same as in the partition table, you may consider the boot sector as corrupted and the partition unusable. Note also that the high word usually contains garbage in old versions of DOS.
If you suspect that a Boot Sector has become corrupt, you can check several of the fields listed above to see whether the values listed there make sense.
For example, Bytes per Sector will be 512 in the vast majority of cases. You may also expect to see text strings in the executable code section of the boot sector that are appropriate for the operating system that formatted the disk.
For Example, Typical text strings on FAT volumes formatted by MS-DOS include: "Invalid system disk.", "Disk I/O error.", "Replace the disk, and then press any key", "Non-System disk or disk error", "Replace and press any key when ready.” and "Disk Boot failure." Text strings on FAT volumes formatted by Windows NT include: "BOOT: Unable to (or Could not) find NTLDR", "I/O error reading disk." and "Please insert another disk."
But remember that you should not regard this list as being all inclusive. If you find other messages in the boot sector, this does not necessarily indicate that there is a problem with the boot sector. Different versions of MS-DOS and Windows NT may sometimes have slightly different message strings in their boot sectors.
On the other hand, if you find no text whatsoever, or if the text is clearly not related to MS-DOS or Windows NT, you should consider the possibility that your boot sector may have been infected by a virus or that some other form of data corruption may have taken place.
To recover from a boot sector that has been infected by a virus, it is usually best to use a commercial anti-virus program. Many viruses and Trojans will do much more than just write data to the boot sector, so manual repair of the boot sector is not recommended, as it may not completely eliminate the virus or Trojan and in some cases, may do more harm than good. However we are going to deal with DBR in programming section of this book.
If you suspect that the boot sector was damaged for some other reason, it may be possible to recover from boot sector damage without reformatting the drive by manually modifying the fields described above. We shall try to overcome such problems with programming in programming techniques of recovery in this book.
|