3 ms·
I'm a bit puzzled by the second method (with the partition swipe and copy back) . So, linux scatters the files. My partition is almost full and fragments. Now
by toemetoch 14y ago
I'm a bit puzzled by the second method (with the partition swipe and copy back) .
So, linux scatters the files. My partition is almost full and fragments. Now I copy all the files to a second location and wipe the partition. Now I copy them all back. Won't that just scatter all the files and fragment all over again ?!?
- dredmorbius 14y agoIn the first case, the file create & scatter may have occurred in stages, leaving less optimal disk utilization. By copying files back en mass, fragmentation / allocation will be more optimized. If you have insufficient disk overhead and continue the file destruction/creation process, you may end up with higher levels of fragmentation in future. This depends on your particular usage scenario. If you're not underallocating disk, generally you won't have much of a problem.
- gillianseed 14y agoWell there must be some mistake in what he wrote, you don't have to 'wipe' the partition, merely remove the files (and directories if any) which you copied over before copying them back. When you copy the files 'back' they will be copied sequentially and thus be placed 'scattered' (as in position on harddrive, not fragmented file) with appropriate space left between them for possible growth without needing to fragment them. This copy method can of course be done on Windows aswell, the only difference is that NTFS's file placement strategy generally results in more fragmentation over time than the strategies employed by Linux filesystems like ext(x). That said all filesystems get fragmented over time, no strategy can avoid this fully. Also if your partition is very fragmented and you have many large files it can be faster to use this 'copy to another partition' method rather than using a defragmenter which will operate solely on the target partition and thus need to move many parts of files around in the partition to 'fit' in parts of other files. Of course using the copy-method requires you having another partition with enough free space so it might not always be a feasible option.