How to Optimize and Repair a Hard Drive
In my first Hub called: “Everything you need to know about a Harddrive” I explained exactly how a harddisk works. This Hub is intended to explain how to optimize your harddisk to keep it running at good speed and good condition. Also how to repair if possible and if it’s necessary.
Here are some optimization tricks and some guidelines you have to keep in mind to keep your harddisk running at peak performance level and here they are.
Clean up your harddrive
Temporary (Internet) files, recent documents, downloaded files and log files which belong to Windows are files that can build up very quickly. If your harddisk get’s fuller then it needs to be it will decrease in performance, because of the extra head movements. You need to delete all of the junk files to make Windows work at normal speed so it doesn’t need to work any harder. It is very important to keep your operating system (OS) running as clean as possible. Clean up old files and junk with the following software.
Windows XP/7 is equipped with build in drive cleaner that can be found here: Start -> All Programs -> Accessories -> System Tools and then Disk cleanup. You’ll see options like “Temporary Internet Files” and “Temporary files” which are the most disk space consuming things you can clean up.
Personally, I use the program CCleaner which is a more advanced and comprehensive utility to cleanup any harddrive. It also has some tools like uninstalling software, disable startup programs and checking and repairing registry error’s. There are 2 versions the 32-bit and the 64-bit version and they can be downloaded here: http://www.piriform.com/ccleaner
Fragmentation is process when files are used in Windows. Windows store files in a contiguous way and attempts to keep the data as close as possible on the harddisk (tracks/sector’s). But Windows has to move data to different free space blocks when files are changed and resaved. Scattered file pieces over the disk could be the results if a typical file might be access. And so the disk has to work harder retrieving the file comprised of the pieces throughout the harddisk to assemble it as one total data file.
A very important task is to optimize Windows disk performance by defragmentation. File fragmentation will be corrected with defragmentation software that repair those scattering of file pieces. Over time in any file system like NTFS these scattering will occur sooner or later. Recommended time to defrag a drive would be at least once a month to prevent clutters. You can find Disk Defragmenter in Windows 7 here:
- Go to Start -> Search programs and files and type defrag.
- Left click on Disk Defragmenter
- The Disk Defragmenter program opens and click on “Analyze disk”.
- This analysis of the drive will let you know if a defragmentation is necessary based on the current fragmentation of the files.
- Click the Defragment button If the percentage of fragmented files show some percentage. The time it takes depends on how much data is on a drive and how much it’s fragmented. It could take some time so be patient!
Also for this task I use a more advanced and better optimized software program called Ultimate Defrag. This very handy piece of software optimizes the pc to the max.There are 4 things this very powerful tool accomplishes. First it defragmentes your files so the drive head movements are minimized while reading. Secondly it places your data files as far possible towards the outer tracks/sector’s because that’s the fastest part of the hard drive. Thirdly the files need to be place (consolidated) as closely together. This will minimize head movement and reduces the short stroking also called “seek confinement”. And fourthly most used data files are clustered together closely as possible and rarely used data files are placed out of the way.
So what this software does is put the data on the outside of the platters. Because the speed is greater at the outside of the platters this is where the data should be. The speed is faster at the outer platters because a disk is bigger and makes more turns outside then inside of the platter. It’s like a transmission on your bike, the bigger disks can give you a fast spin on the pedals and the small ones give you a slower tougher spin. You can download the trial version here: http://download.cnet.com/UltimateDefrag/3000-2094_4-10840834.html
NTFS is the best file system of choice on Windows XP/7. NTFS is much more comprehensive then FAT32 such as file management, NTFS and Share security, quotas, file compression. Also NTFS can recover from errors more readily then FAT32, if bad sectors are detected it will prevent them from using them and it remaps them. You’ll get the most out of your harddisk with NTFS, so if you are still using FAT32 it’s time to convert to NTFS.
Keep in mind when converting to NTFS:
- When you convert you can only convert from FAT32 to NTFS. Also you preserve your data during the conversion.
- If you want FAT32 back on a disk you have to reformat the disk! If you want a NTFS drive to FAT32 you can’t convert it back. The only way is to reformat your harddisk, but you’ll lose all of your data.
Do the following to convert your FAT32 drive to NTFS:
- Click Start -> search programs and files. Type “cmd” and right click on cmd.exe and click on “run as administrator”. You have to execute this command with administration permissions.
- The Convert command will be used to convert the FAT32 drive to NTFS. Remember your data will stay safe and exactly as it is. The command is:
convert C: /FS:NTFS then press Enter
This process takes some time (some minutes). The size of the drive and the data on it are depended how long it takes. When the conversion process is done exit the command interface. Windows will say it has to reboot if you converted a Windows boot partition/volume. Any disk you want to convert can be converted the same way just replace it with the letter of the disk you want to convert. C: is the default drive letter for the Windows disk but there are other letters you might want to convert to.
Although very effective and powerful, NTFS has some overhead that could be unnecessary. To retain MS-DOS and Windows 3.x systems compatibility Windows has support for 8.3 filenames. 8.3 filenames mean files containing eight characters (which make the name). This eight character name is followed by a dot and also a three character extension. Usually this is not a problem but the overhead is not necessary. If you don’t have any old programs or file systems, you can turn this feature off. Because no long filenames (8.3) has to be created this can improve performance considerably.
MS-DOS programs are rarely used anymore so it’s fair to say you can turn this feature off. The dependency of some old programs on 8.3 filenames still exist, so if you turn it off it could be possible some programs won’t work correct anymore. At this point in time this is rare but keep this in mind.
8.3 names are enabled on every volume default. Disable it on all volumes or disable it on all with the exception of the system volume.
These are the values available as option to control the behaviour of the 8.3 naming feature:
0 = Enable 8.3 naming
1 = Disable 8.3 naming
2 = Enable 8.3 naming (creation on a per volume basis (default setting))
3 = Disable 8.3 naming (all volumes with the exception of the system volume)
Disable the 8.3 filename option through the register for all of your volumes follow these steps:
- Click Start -> Run. Type regedit and click OK.
- In the Registry Editor, navigate to
- Locate the NtfsDisable8dot3NameCreation entry and change the value to 1.
- Restart your pc
Also you can change the value by using the “fsutil” command:
1. Click Start -> Search programs and files type “cmd”, right-click and click on “Run as Administrator”
2. Type as follows:
fsutil 8dot3name set 0,1,2,3
Which value you want change it to that value (0,1,2 or 3).
3. Restart your pc
Master File Table
The Master File Table is used by NTFS to record data about files. Ensure it has enough space it requires with the use of a registry entry. Although more disk space is required for this it will reduce overall overhead, which will give you more performance.
Create or change the value:
- Click Start -> Run. Type regedit and click OK.
- In the Registry Editor, navigate to
- Create a REG_DWORD (32-bit) entry called NtfsMftZoneReservation
- Set the value to 2
- Close the Registry Editor and reboot your system
Date and Time Stamp Updating
When directories are used the date and time are recorded with the stamp feature of NTFS. Also the last time that it accesses a directory. Because there are a lot of directories this updating can cause a slowdown on your disk performance. When you disable this time and date stamping function, nothing will change when you work with all your files. To disable the dating and time stamping process do the following:
- Click Start -> Run. Type regedit and click OK.
- In the Registry Editor, navigate to
- Find the NtfsDisableLastAccessUpdate entry (create it if not found (REG_DWORD 32-bit))
- Set the value to 1
- Close the Registry Editor and reboot your pc
Bios AHCI vs IDE
IDE (Integrated Drive Electronics) is a standard interface used for a long time for optical devices and harddisks. SATA is substituted for IDE because it has a lot of advantages over IDE. One operation mode for SATA, the new AHCI (Advanced Host Controller Interface), which is an API (application programming interface) that is very useful. Its speed will not be affected by AHCI but it provides the harddisk to advanced technologies/features for SATA.
To support compatibility for older hardware, a SATA controller offers the choice for several operation modes through the bios. AHCI, IDE or RAID are those operation options, where IDE is also referred as legacy mode or native IDE mode. If you want your harddisk to operate like an older IDE disk choose IDE, but you won’t have all those great advantages of AHCI.
When you choose AHCI mode it will give you advanced features supported by SATA. Native Command Queuing or NCQ described in my other Hub called: Everything you need to know about a Harddrive is one of those technologies.
Hot plugging is another feature AHCI also enables, so you can remove and connect harddisks from or to a pc that is running in Windows just like a removable disk. With IDE drives or when you use IDE mode this won’t be possible, because the configuration is done prior to Windows and during boot time. You have to make your choice to whether use AHCI or IDE mode before installing Windows. This setting has to be changed in the setup of your bios, before you install the operating system on the computer.
RAID (Redundant Array of Independent Disks) mode is equal to ACHI mode but used when you use a RAID. A RAID array is several disk together combined as one.
DMA Windows settings
DMA (Direct memory access) allows system memory to be access independently without the CPU (central processing unit) to be access. Make sure DMA is enabled because this will smooth out performance immensely.
Go through the following steps to make sure it’s enabled:
- My Computer -> right click then select Properties
- Select the Hardware tab and then Device Manager
- Expand IDE controllers and double click the IDE primary channel
- Select the Advanced settings tab and make sure “Enable DMA” is selected
- Click OK then your computer needs to restart
Intel Rapid driver
The Intel driver provides acceleration of separate disks or raid arrays. Especially when you have a RAID this driver gives you a lot more performance. This driver is highly recommended when you use ACHI or RAID mode. When you install the driver left click on each hd and check if “Disk data cache” is enabled. Also you can see if Native command queuing is enabled (if supported by the disk) and what the SATA transfer mode is. SATA transfer mode is explain in my other hub called: Everything you need to know about a Harddrive.The latest Intel Rapid driver can be downloaded here: https://www.station-drivers.com/index.php?option=com_remository&Itemid=353&func=select&id=103&lang=en
Repair your harddisk
Check Disk typed as “chkdsk” command is a tool that can repair a harddisk. By scanning the MFT (Master File Table) and through an entire harddisk surface it finds problems. It scan’s for corruptions in the Master File Table (MFT) that has a list of all files (Metadata). Also when used with the switch /R it checkdisk can be used to detect and if possible repair bad sector’s.
All the switches for checkdisk are:
filename: FAT only. A specific file to check fragmentation. Allowed Wildcard characters (* and ?).
path: FAT only. Gives the file(s) location within a folder of a volume.
size: NTFS only. To be used with the switch /I. Provide the size of the log files to a desired kilobyte size. Must be used with the /l switch.
/c: NTFS only. Folder structure cycles checking skipped.
/f: Repairs errors on the volume. It's necessary for the volume to be locked. If the volume can't be locked down, the message to check the pc during the next restart will appear.
/i: NTFS only. A less intensive check of index entries.
/l[:size]: NTFS only. Shows the log file size currently. If size option is used, the log file will be changed to that size (kilobytes).
/p: Available only at the recovery Console, this switch will cause a disk to be checked without it being marked as a dirty disk (Recovery Console only).
/r: This switch searches and repairs bad sector's and makes information readable again (use /f and /p together). If it's not possible to lock down the volume, the message to check the pc during the next restart will appear again.
/v: On FAT: Every file on the volume will be displayed in full path and filename. On NTFS: Cleanup messages wil be shown if there are any.
/x: NTFS only. Will force to dismount the volume first if needed.
/b: NTFS only. This switch is only present from Window Vista/7. Bad clusters are cleared and reset then rescans all those clusters again for errors (same as /r).
/?: Provides you with a list of all the available switches to use with the checkdisk command.
- Click Start -> search programs and files. Type 'cmd' right click and and left click “run as administrator”.
- Type chkdsk /f and press enter. You see a message if you like to schedule this volume to be checked the next time the system restarts.
- Type Y for yes and reboot
- Now your system disk will be checked for errors during the next reboot
HDD LLF Low Level Format Tool
The process to prepare a harddisk for use is called formattting. You have to format a harddisk before you can use it.
Now sometimes when bad sectors or other problems arise a low level format can be used to correct problems. Positioning the tracks and all of its sectors to outline them to point out where those tracks and sector’s are, through structures that will be written is called a low level format. Because real physical formats are created that point out where data files can be stored this is also referred as a “true format operation”.
Usually this is not necessary because every modern day harddisk is low level formatted at the factory. But if for some reason you feel it needs a low level format to repair (for instants) bad sector’s, you can use free tool to accomplish this. HDD LLF Low Level Format Tool is such a tool also referred to as a zero fill utility because it restores a harddisk to a new condition again. You can download it here: http://hddguru.com/software/HDD-LLF-Low-Level-Format-Tool/
Is a very handy tool that can be used for several functions. The most important feature it has you can use it to scan for error’s on your harddisk (bad sector’s) and also benchmark it. Also a very important feature this software has is you can look at the status of your harddrive S.M.A.R.T. status. S.M.A.R.T. is explained in my other hub called: Everything you need to know about a harddrive.
Also you can change Automatic Acoustic Management (AAM) to change between less noice and less performance or more performance and more noise (of the harddisk) (value between 128 and 256). You can download HD Tune here: http://www.hdtune.com/
Is a very powerfull tool that repairs bad sector’s in many cases. Other tools like the once you can get on the site of the brand of your harddisk only mark bad sectors, read data and when write back fails mark as bad sector permanently. Hdd Regenerator uses a technique called “magnetic reversal”.
Many bad sector’s are caused due to magnetic troubles therefore it can only repair those sector’s cause by magnetic troubles. It can’t repair physical damage to a drive! You can download the demo version and restore the first found bad sector here: http://hddregenerator.net/ If you want to restore a full harddisk you have to buy this software!
- Keep your harddisk as empty and as clean as possibly.
- Defragmentation if needed once or twice a month. If a lot of software is uninstalled or installed defragmentation is very smart.
- Use NTFS as a file system for you harddisk.
- Disable 8.3 filename creation when no old programs that need it are used.
- Increase the size of the Master File Table space.
- Set if possible the SATA mode to AHCI or RAID (if RAID is applied).
- Enable if possible DMA mode for all of your devices.
- If an Intel chipset is used install the Intel Rapid driver.
- To repair bad sector’s or check the Master File Table of your disk you can use the checkdisk command.
- If a Low Lever Format is needed for any reason use the HDD LLF Low Level Format Tool.
- Use HD Tune to check S.M.A.R.T status of your harddisk, check bad sector’s or change Automatic Acoustic Management settings.
- To regenerate your harddisk from bad sector’s or other problems use HDD Regenetor.