3 ms·
From the article: "If you actually need to defragment a file system, the simplest way is probably the most reliable: Copy all the files off the partition, erase
by joejohnson 14y ago
From the article: "If you actually need to defragment a file system, the simplest way is probably the most reliable: Copy all the files off the partition, erase the partition, then copy the files back onto the partition. The file system will intelligently allocate the files as you copy them back onto the disk."
- gouranga 14y agoIsn't that a form of defragmenting? It also contradicts the point that it is unecessary to defragment the volume.
- dredmorbius 14y agoIt's extremely rare to need to do this. It's generally a sign that you're running your disks / filesystems overutilized. Retaining 10-20% free space is generally encouraged. If you do elect to do the "copy out, wipe, copy in" method, you can do this, in general, while not completely losing the use of your system. There are some tricks (union mounts, remounting filesystems) which will allow you to flip between filesystems, in most cases. Specifics will depend on your partitioning scheme, use case, and the filesystems under consideration (usually you'd be dealing with user files under /home, spool or variable files under /var, source trees, etc.). As the article states, Linux systems generally experience very minimal fragmentation, and dynamically resolve the issue for you, unlike Windows. You can typically run a Linux system for years, given a 10-20% disk reserve, without running into appreciable fragmentation issues. The gains from any sort of manual defragmentation would be minimal compared to the cost of performing the task.
- Lerc 14y agoThat is true for any filesystem that needs defragging. The entire notion of a disk defragmentor is that it fixes the problem without needing to do this step. It's like saying "Our car never breaks down so you don't need to be able to repair it. Even if it does break down you can still walk."