In-depth understanding of disk defragmentation

  
If you use the Windows XP operating system operating system, then please pay attention to the problem of disk defragmentation.
1. Why do you need to defragment
The file layout on the disk will strongly affect the I /O performance, severely fragmented or scattered files and directories on the disk will damage performance, although Windows XP will automatically Targeting certain files to improve performance, but in general, this is not a routine that the system must have, and usually only contains a small portion of the file on the disk.
In this regard, the disk should be completely defragmented immediately after the system is installed. By default, Windows XP performs a local defragmentation every 3 days, and adjusts the physical location of the file on the disk according to the usage of the day. The moved file will be written to the Layout.ini file, which Windows XP thinks. The physical location of the file on the disk should be arranged in this order, and the path to the file is in C:WindowsPrefetch.
The system will automatically defragment the disk when it is idle. At this time, the contents of the Layout.ini file will be read first, and the files involved in it will be partially defragmented. This is also the basis for the defragmenter to transfer the file location.
2. Deeply familiar with the Prefetch directory
In Windows XP and later operating systems, the pre-reading function (also known as "preloading") has been added, which can improve system performance and speed up the system. The speed of booting and file reading. These read-ahead files are stored in the %systemroot%Prefetch directory with the *.pf extension. These *.pf files include the specific information and loading order of the loaded file.
Each application, including the Windows XP startup process, will leave a corresponding pre-read file in the PrefetCh directory. The pre-read file describes the loading order of each module in the application or startup. The naming method is Based on the name of the application's executable file, add a "-" and a hexadecimal value describing the full path of the executable file, plus the file extension .pf, for example, QQ.EX-0065A2A1.pf. Whenever a user launches a program, it automatically leaves a record in the corresponding *.pf file in the Prefetch directory. However, the pre-read file that Windows XP starts is always the same name, NTOSBOOT-B00DFAAD.PF, which contains the record of the file loaded at startup.
The next time you start the system or run a program, Windows will refer to the corresponding *.pf file and load all the files recorded in it into memory instead of loading the files one by one as in the previous one. In addition, Windows will use the *.pf file of the launcher or program to develop an optimized disk allocation scheme. The information about this scheme is stored in the Lyaout.ini file.
3. Do not let the system automatically defragment the disk
Sometimes, you may feel that the local defragmentation function is very boring, because the defragmentation of the disk will also perform some degree of operation on the hard disk. The technique of disabling local defragmentation by modifying registry keys is plausible on the Internet, but in fact, these so-called tricks are completely ineffective. In fact, even if you delete all the files in the C:WindowsPrefetch directory, the Layout.ini file will be created automatically after restarting the system. The local fragment auto-storing function will be reactivated once every 3 days. The correct way to flash this is to open the Layout.ini file with Notepad, delete all the contents, and set this file to read-only property, so Windows XP can not activate the local fragment auto-completion function, of course you do not need Worried that C: WindowsPrefetch will get bigger and bigger.
4. One-step discussion
We often see online tips on modifying registry keys to improve Windows XP startup speed. Are these techniques really effective? Below, we take a step-by-step discussion with the example of disk defragmentation:
Question 1: Why can't the C drive be defragmented?
Windows XP system, when defragmenting the C drive, the prompt can not continue because the C:WindowsprefetchWMIPRVSE.EXE-28F301A9.PF file is damaged.
C: WindowsPrefetch is a Windows XP pre-reading folder. Windows XP stores frequently used data in a pre-reading folder. When you need to use this data again, the reading speed can be greatly accelerated, but as time goes on, The size of this folder will become bigger and bigger, and there may be some dead chain files. If you perform defragmentation, you may get the above mentioned error. The solution is to empty this folder and then organize it. Fragmentation.
Question 2: Can also defragment at startup?
Windows XP can be defragmented at startup, so that the files necessary for booting can be arranged next to each other, so that the speed is increased at the next startup, but the function is turned off by default. The activation method is to open the registry editor, find HKEY_LOCAL_MAHCINESOFTWAREDfrgBootOptimizeFunetion, double-click the Enable button in the right pane, and change the key value from the default "N" to "Y".
Question 3: Can the system start speed be improved after pre-reading is prohibited?
There is a trick on the network to improve the startup speed of Windsws XP. The specific method is to change the key value of "1" by modifying the EnablePrefeteher subkey in the HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerMemory ManagementPrefetchParameters directory in the registry. This can reduce the pre-read file and reduce the wait time of the progress bar. The effect is that the progress bar runs into the login screen after one round.
Microsoft's technical documentation explains the meaning of EnablePrefetcher being given different values:
0: cancel pre-read function;
1: pre-read application only;
2: pre-read only Windows System Files.
3: Pre-read Windows system files and applications, this is the default value of Windows XP.
Although the EnablePrefetcher key value is set to 1, it can indeed reduce the pre-read file, but the system initialization of the kernel is a very complicated process, which requires loading a lot of underlying drivers, startup subsystems and related Service, even when we see the welcome screen, we can't think that the system has been started at this time, because the system will continue to initialize the loading of those unfinished drivers in the background, although the number of actions of the scroll bar is much smaller than before, but The black screen process before the welcome screen is displayed has increased, so the total system time has not changed.
Copyright © Windows knowledge All Rights Reserved