You are currently offline, waiting for your internet to reconnect

Err Msg: Error Defragmenting Drive <X>. Windows Could Not...

This article was previously published under Q160043
SYMPTOMS
When you run Disk Defragmenter (Defrag.exe), you may receive the followingerror message:
Error Defragmenting Drive <drive>. Windows could not access part of the drive. Click Help and carry out the instructions for running ScanDisk. IMPORTANT: To fix this problem, you must run ScanDisk and choose the Thorough option.
ID No: DEFRAG005
Note that the "ID No: DEFRAG005" portion of the error message may bereplaced by "ID No: DEFRAG006."
CAUSE
This error occurs when Disk Defragmenter is unable to read from or writeto one or more bad sectors on the hard disk. The DEFRAG005 error messageis displayed when Disk Defragmenter is unable to write to a sector. TheDEFRAG006 error message is displayed when Disk Defragmenter is unable toread from a sector.
RESOLUTION
Before you attempt to work around this problem, you should first make abackup copy of any important data on your hard disk. After doing so, runScanDisk (Scandskw.exe) and perform a thorough test on the hard disk. Todo so, follow these steps:
  1. Click the Start button, point to Programs, point to Accessories, point to System Tools, and then click ScanDisk.
  2. Click the hard disk referenced in the error message, and then click Thorough in the Type Of Test area.
  3. Click Options, verify that System And Data Areas is selected, and then click OK.
  4. Click Start to begin the test.
If ScanDisk does not find any bad sectors, or if running ScanDisk does notcorrect the problem, configure ScanDisk to detect disk timeouts and checkeach cluster five times while performing a surface scan. To do so, followthese steps:
  1. Use any text editor (such as Notepad) to open the Scandisk.ini file in the Windows\Command folder.
  2. Create an [Environment] section in the file, if the section does not already exist, and then add the following lines to the section:
    ScanTimeOut=On
    NumPasses=5
    Note that the "ScanTimeOut=" and "NumPasses=" lines may already exist, but with different values.
  3. Save and then close the Scandisk.ini file.
  4. Click the Start button, click Shut Down, click "Restart the computer in MS-DOS mode," and then click Yes.
  5. Type the following line and then press ENTER to run ScanDisk
    scandisk <drive>:
    where <drive> is the drive letter of the hard disk you want to check. Note that you should run a surface scan when ScanDisk prompts you to do so, repair any errors that ScanDisk finds, and view and save the log file that ScanDisk creates.
  6. When ScanDisk is finished, type exit and then press ENTER to return to Windows 95.
  7. Run Disk Defragmenter again.
If you still receive the above error message, run Disk Defragmenter toconsolidate free space only, then defragment files only, and then perform afull defragmentation (both files and free space). To do this, follow thesesteps:
  1. Click Start, point to Programs, point to Accessories, point to System Tools, and then click Disk Defragmenter.
  2. Click the hard disk referenced in the error message, and then click OK.
  3. Click Advanced, click Consolidate Free Space Only, and then click OK.
  4. Click No when you are prompted to quit Disk Defragmenter.
  5. Click the hard disk referenced in the error message, and then click OK.
  6. Click Advanced, click Defragment Files Only, and then click OK.
  7. Click No when you are prompted to quit Disk Defragmenter.
  8. Click the hard disk referenced in the error message, and then click OK.
  9. Click Advanced, click "Full defragmentation (both files and free space)", and then click OK.
  10. Click Yes when you are prompted to exit Disk Defragmenter.
If ScanDisk does not find any bad sectors, or if running ScanDisk does notcorrect the problem, contact the manufacturer of your computer or harddisk to inquire about additional workarounds that may correct the problem.
MORE INFORMATION
Many hard disks have sectors that are unusable. If the sectors have beenmarked as bad by ScanDisk or another disk tool, Disk Defragmenter displaysthe sector as a white box with a red line through it. This indicates thatthe cluster has been marked as bad and cannot be used to store data.

If the disk tool you use is unable to detect bad sectors on your harddisk, or if you do not run a disk tool on a regular basis, unusablesectors that are not marked as bad may exist on the disk. When thisoccurs, you may not realize that the bad sectors exist until Windows 95attempts to store data in them. Therefore, it is possible for bad sectorsto appear while you are using the drive normally. If bad sectors begin toappear on a regular basis, your hard disk may need to be repaired orreplaced.

Note that you may be able to prevent the error message from beingdisplayed by deleting some files on your hard disk, but doing so doesnot fix the problem that is causing the error message to appear. DiskDefragmenter does not read from unused sectors while defragmenting adrive. Therefore, if an unusable sector that does not contain any dataexists on your hard disk, the problem described in this article may notoccur.
REFERENCES
For help with common system maintenance tasks in Windows Vista, visit the following Microsoft Web page:
osr1 osr2
Properties

Article ID: 160043 - Last Review: 10/29/2009 06:06:12 - Revision: 2.0

  • Microsoft Windows 95
  • Microsoft Plus! 95 Standard Edition
  • Microsoft Windows 98 Standard Edition
  • kbdefrag kbenv kberrmsg kbscandisk KB160043
Feedback