Return to the Manual Index

Scanning the disk surface for errors

Introduction

ByteBack D.R.I.S.TM allows you to scan a selected partition, an entire disk or a user defined area of the disk for what is commonly referred to as 'bad sectors'. Bad sectors can be the cause for many kinds of dataloss: files may become corrupt because some of the sectors that the file was saved to have become unreadable, or whole partitions may become inaccessable because the structures that define the partitions contain unreadable sectors. An interesting fact is that bad sectors account for more dataloss than virusses do!

Sometimes disk problems can be fixed by the tools that are included with several operating systems: scandisk, checkdisk or similar tools will sometimes restore access to files if disk structures such as the FAT were damaged. These tools however do not correctly address the problems that might arise from bad sectors! Let's look at this a bit more closely:

The first priority for a tool such as scandisk or checkdisk is a consistent filesystem. In other words, their main job is to keep the filesystem okay, not the actual data that resides on the disk. If a problem occurs with the filesystem, scandisk or checkdisk may repair the damage, but always in favor of the filesystem. The result may be that access to actual data can be compromised because the repair could only be completed by removing references to certain files from the filesystem. These removed files (or fragments of them) then appear as filexxxx.chk files (in case of scandisk or checkdisk).
Another point of interest is how tools like scandisk and checkdisk handle read problems. To put it simple: they don't do that very well. If they encounter a read problem (aka bad sector) the entire cluster that the bad sector was a part of, is discarded. If a disk has large clusters (32K clusters for FAT32 is normal, that's 64 sectors per cluster) you lose a lot of capacity, not to mention the impact this may have on files or filesystem structures. Also, since scandisk and checkdisk by default only check the used areas of the disk, bad sectors may not announce themselves until data is written to one. That may be too late.
Scandisk in particular is not able to deal with bad sectors in a FAT area at all; these sectors will not be recovered by scandisk.

ByteBack D.R.I.S.TM will scan each sector on the disk, whether it's a part of a FAT, filled with data or empty. By allowing ByteBack D.R.I.S.TM to detect 'bad sectors' before the Operating System or the on-board disk repair tools do, you allow your harddisk's internal error management (see below) to take care of the bad sector: it will be re-allocated.

ByteBack D.R.I.S.TM interacts with sectors on a lower level and does not interact with the file system. When ByteBack D.R.I.S.TM detects a read or write problem, it is handled using one of the following strategies: 

  1. Error on read that can be corrected:
    Hard disks apply multiple strategies for correcting 'bad' data allowing the disk to provide you with your data even if a sector could not be read entirely. If the data in a sector can be recovered using this strategy, the data is copied to a spare sector and the bad sector is taken out of service.

  2. Error on read that could not be corrected:
    If a sector can not be read and the automatic error correction can not recover the data in the sector, the sector will become a candidate for reallocation. A read error will be reported. The candidate for reallocation will be reallocated when the sector is written to.

  3. Error on write:
    The bad sector is taken out of service and the data is immediately written to a spare sector. In other words, the bad sector is 'reallocated'.

If sectors were corrected they will not appear again during the next disk surface scan; this means that if errors that appeared in the first surface scan do not appear in the next surface scan, these 'bad sectors' were reallocated and should now be available again for use.

Using ByteBack D.R.I.S.TM to find and correct disk errors

ByteBack D.R.I.S.TM offers several ways to scan your disks for read/write errors: you can scan the disk surface read-only or perform a non destructive read/write test.

Enter the area that is to be scanned, defaults for the entire disk

  • The read-only surface scan: By scanning your disk's surface you allow the disk's internal error management as described above to become aware of read problems. If a read error is encountered there are 2 options: the data can be corrected and is placed in a spare sector (strategy 1). If the data can not be corrected a read error is reported and the sector becomes a candidate for reallocation, the data in the sector is lost (strategy 2) and the candidate sector will be reallocated during the next write to the sector.

    If a sector can not be read on the first attempt, ByteBack D.R.I.S.TM will retry the read action as many times as is configured in the 'Read Retries' option. If the read eventually succeeds, the correct sector handling strategy is applied.

    To run a read-only surface scan:

    [Select Disk], [Disk Operations], [Surface Scan (RO)], now select either a partition or select a region manually. To scan the entire disk, select 'entire disk' and leave the suggested default values (just press <enter>).

  • The read-write surface scan: The read-write surface scan is non-destructive: data that can be read remains unmodified. During a read-write scan ByteBack D.R.I.S.TM reads and writes from/to each sector in the scan area. By reading the sectors  bad sectors can be detected and corrected by applying strategies 1 and 2 (see above). 

    Sectors that are 'reallocation candidates' are reallocated when written to. The data in these sectors is lost and is replaced by an F6h byte pattern. By writing a pre-defined byte pattern you can determine if files were affected by the repair and if so, which files were affected (see below).

    If write errors are reported this indicates sectors could not be reallocated, possibly because the spare pool (a pool of spare sectors than can replace 'bad sectors') was exhausted. Run an additional read/write surface scan to see if the error(s) are persistant. You can use a S.M.A.R.T. utility such as the disk manufacturer's diagnostic tool (refer to the disk manufacturer's website) to determine the exact condition of the hard disk. Once the pool of spare sectors is exhausted bad sectors can no longer be reallocated, and bad sectors will continue to appear during surface scans.

    Tip: A free DOS based S.M.A.R.T. utility is SMARTUDM by Sysinfo Lab. To make your boot diskette even more complete and useful, you may want to add that to your ByteBack D.R.I.S.TM boot diskette!

    To run a read-write surface scan:

    [Select Disk], [Disk Operations], [Surface Scan (RW)], now select either a partition or select a region manually. To scan the entire disk, select 'entire disk' and leave the suggested default values (just press <enter>).

Tip: determining if and which files were affected by sector reallocation on write:

When ByteBack D.R.I.S.TM re-writes a bad sector that was reallocated, the sector is filled with 512 F6h characters (÷). If a file was affected by such a sector repair, the file will contain a string of these characters. You can use the Windows file search tool to identify these files.

  • start the windows search tool
  • in the 'text to search for' box, type the character ÷ as follows : hold the Alt button and type 246, then release the alt button. Put at least 5 of these characters in the search field, do not use spaces or other characters
  • make sure the search tool searches all files (*.*) and that the search includes hidden and system files
  • start the search

The resulting file list contains files that are likely to be damaged. Verify this and if necessary restore correct versions of these files.
If a disk contains more than 1 partition, repeat this process for all partitions.

http://www.toolsthatwork.com