How Do I Defragment a Hard Drive?
Disk fragmentation should be called file fragmentation, because files are scattered and stored in different places on the entire disk, rather than being formed in a continuous cluster of disks. File fragmentation generally does not cause problems in the system, but too much file fragmentation will make the system look back and forth when reading files, causing system performance to decline, and severely shortening the life of the hard disk. [1]
- After using the hard disk for a period of time,
- While Disk Defragmenter is defragmenting the disk, the computer can perform other tasks, but at this time the computer will run slower and Disk Defragmenter will take longer. During defragmentation, the disk defragmentation program must be restarted whenever other programs write to the disk. To prevent the disk defragmentation program from restarting too frequently, be sure to close other programs while defragmenting the disk. [3]
- Optimization settings
- section
- Disk fragmentation can reduce overall system performance
- If the files are stored on different fragments, the computer must search the hard drive when the files are opened in order to piece the fragments back together. The response time may be significantly longer.
Disk Defragmenter is a Window
- XP Defrag
In addition to running the disk defragmenter regularly (preferably once a month), in addition to the usual monthly practice, the utility can also be run if certain specific events occur.
Disk Defragmenter should be run under the following conditions:
Added a large number of files.
· Only about 15% of free disk space.
· Installed a new program or a new version of Windows
- Linux file system
- Here is a brief introduction to the Linux file system in this category. For more details, see Ext2.
- The file system of Linux can be roughly divided into two blocks, the inode area and the block area, which store different blocks called inode and block, respectively.
- There are many records stored in the inode. Each record is used to store all information except the actual content of the file, including permissions, modification date, name, etc. The actual content of a file may be scattered in different locations in the block area. The information is also all recorded in one record of the inode.
- The block area is a fixed-size block that is responsible for storing the actual content of the file.
- The relationship between the two is that the inode is equivalent to the index, and the block is the actual content.
- Linux vs. Windows
- Suppose you want to read a file,
- Linux's approach is:
- 1. Find the corresponding file in the inode area
- 2. Find the different blocks where the file is located
- 3. Design the best path to get (read) these blocks on the hard disk.
- Windows handles it like this:
- 1. Find the corresponding file in the allocation table and read the first cluster.
- 2. According to the position of the next cluster recorded, move to the next position and read it.
- 3. Repeat the second step until you finish reading the file.
- The difference is that if the files are scattered on the disk, Windows needs to look around more, while Linux can set the reading order and read them all at once. Therefore, for Windows, the concentration of file placement is conducive to improving reading efficiency, which is why Windows needs disk defragmentation.