Is Defrag Still Necessary

0 views
Skip to first unread message

Marion Georgi

unread,
Aug 5, 2024, 12:46:09 PM8/5/24
to boothcarare
Ive looked around and found multiple answers around the web on this. I turned off auto defrag on my Windows 7 machine because some people have told me it creates more wear and tear on the disk (using a regular magnetic platter hd), and that its also not as necessary because Windows has better file system optimization now that creates less fragments.

I have not found any reasons to believe that there is less fragmentation in modern windows than there was back in win9? or xp, they do say that, but I spent a lot of times looking at the data tossed in clusters, I assume they did not. There is no evidence to show that happening. It does get all fragmented, and even tossed all over the disk.


Much (and many) of the OS files are locked up (when in that OS). Locked files will not be defrag while the system is running, making the on-line defragmenting that windows own defragmenter does, not really efficient. And off-line defrag, one done before the OS runs is much more complete.


This pic shows the locked files in Red, from my system, which has a number of things turned off, Give you a good idea of just how many things will not get defragged when the OS is still running. This cluster view is zoomed up, to show the data area not the unused areas.


Does it matter? Between the large caches, the larger caches on the disk hardware itself, the speed of disks nowdays even the lower RPM drives because of increased data density, and improved methods, plus the pre-loading, the percieved performance does not change that much. Sequential reading is still much faster.


The pre-fetcher system that MS made, parts of it are dependant on the defrag process itself, allowing for the aligning of that data to be read sequentially, without that it would not be as effective at all.


One thing people like to forget when discussing the need for defragging, is disk recovery, it is much easier to un-delete files, or recover file items when the data is sequential in the next clusters. When the file tables are all gone, and your recovery software is of the lesser type the data being sequential could improve recovery chances by a lot. (That doesn't replace needing a proper back-up)


It is false. Fragementation affects the performance of your hard drive and it will do it even more as time passes by. A hard drives is continuously reading, writing and deleting data. So it can happen that logical connected data does not appear always in the same place. If you are opening a file, where your hard drive has to search for the data, it is obvious that is going to take longer.


Defragmentation is responsible for arranging the logical connected blocks again in order. It is no coincidence that Microsoft enabled auto defragmentation for hard drives by default. If you got a solid state drived installed, this option should be disabled, because it will unnecessary stress it.


However, In 64 bit systems, we have an address space of virtually unlimited size. To prevent overuse of the RAM or swap space, the free function could just return the memory to the OS when an unused block is of size bigger than 4096 (Page size) and never use that address again. So while I know freeing RAM is important, I'm saying that defragmentation is not.


So, my question is if memory defragmentation is still relevant. If not, then perhaps we can have a different sort of malloc/free for 64 bit systems, which might be more efficient if it does not try to spend time defragmenting memory. At least for applications that we know are not gonna use the whole 256 TB of address space. What are your opinions?


It'll always be relevant, but not because of the lack of address space, but because of memory coherency. Thanks to the 32bit systems we also already have many algorithms for low fragmentation allocators and free-space coalescing allocators, and there is no reason why they would just be ignored on 64bit systems, they don't add much overhead at all and the amortized overhead may even drop on a 64 bit system).


Imagine that all of the information on your hard drive is a load of laundry. There are lots of different types of clothing and colors, and they all get mixed together in the wash. All of your clothes are still there, but they're jumbled together and take up a lot of space. This is similar to what happens over time to the data on your hard drive. Everything gets moved around and separated (or fragmented) and your computer has to work harder to find everything it needs.


When you finish doing the laundry, you usually sort your clothing back into organized piles so they can go back into your closet or dresser. When you defrag your hard drive, your computer is doing something similar. It's taking all of the data and reorganizing it so your computer can find things more easily and make the most of its available space.




Defragging your computer can both solve and prevent a number of problems. If you don't regularly defrag your hard drive, your computer may run slowly and/or may take a long time to start up after you turn it on. If a hard drive is too fragmented, your computer may freeze up or not start at all.


This website uses cookies to measure and analyze our traffic. For more information about the cookies we use, see our Terms of Use. If you want to change your decision later on, select the 'Cookie Policy' link in the footer.


so I know that my primary ext SSD doesn't need to be defragmented, but I have a storage HDD that is formatted as NTFS. Does this drive still need to be defragged? If so, what programs would you recommend?


Obviously if you do not plan on ever booting that would-be-NTFS HDD under any Win OS, then backup/reformat it as ext3 o ext4 and restore its contents. That is your best functionality and performance hope for journalling under Linux.


If at a later time you discover that you need to access the contents of your ext3 or ext4 fs under Windows, then know that it's possible to r/w on ext3/4 volumes from Windows XP up, with flaws and unpredictable large surges in CPU usage, in my experience. Just use the the windows extension Ext2Fsd at your own risk for your data and with some limitations for ext4 compared to ext3.


1) To make sure r/w, hard and symbolic links as well as partial journalling are correctly handled by Lx, install ntfs-3g from the Canonical repo, before rebooting and mounting your ntfs volume. It is perfectly safe in my experience. Your fstab line for that mount should read something like:


Other possibilities are either use a Win OS to defrag your volume before mounting it on yr Lx OS (not very satisfactory) or use "ultradefrag". Yet another is to go for a TRIM ready SSD for your NTFS file system. In that latter case you will have zero need for defragmentation. Ever.


Modern Linux filesystem(s) keep fragmentation at a minimum by keeping all blocks in a file close together, even if they can't be stored in consecutive sectors. Some filesystems, like ext3, effectively allocate the free block that is nearest to other blocks in a file. Therefore it is not necessary to worry about fragmentation in a Linux system


I've been running Linux at home since 1996 and have never defragmented any filesystem. I have never had the need. The most I have done in this direction was pay attention to the kind of files I will be putting on a filesystem and using appropriate options when I mkfs. For example, if a filesystem will primarily contain large files, I'll use a larger block size. If I am making a huge file system but I know it will never have more than 1,000,000 files, then I'll use the -N 1000000 option to limit the number of inodes. In general, I'll tune the filesystem at creation to its task if a particular kind of file will inhabit it.


While ext2 and ext3 do not provide for it (and generally need it less as they keep files relatively together in the first place) ext4 does provide for defrag. This article talks about the e4defrag program. But ext4 is a new filesystem.


Dear Lifehacker,

I hear people talk about "defragging" their computers all the time as a way to make it faster, but I'm not really sure what that means. What does defragging do and is it something I need to do to my computer? How often?


Most hard drives have spinning platters, with data stored in different places around that platter. When your computer writes data to your drive, it does so in "blocks" that are ordered sequentially from one side of the drive's platter to the other. Fragmentation happens when those files get split between blocks that are far away from each other. The hard drive then takes longer to read that file because the read head has to "visit" multiple spots on the platter. Defragmentation puts those blocks back in sequential order, so your drive head doesn't have to run around the entire platter to read a single file. Image by XZise.


If you have a solid-state drive (SSD) in your computer, you do not need to defragment it. Solid-state drives, unlike regular hard drives, don't use a spinning platter to store data, and it doesn't take any extra time to read from different parts of the drive. So, defragmentation won't offer any performance increases (though SSDs do require their own maintenance).


Windows 7 and Windows 8 automatically defragment your hard drives for you on a schedule, so you shouldn't have to worry about it yourself. To make sure everything's running smoothly, open up the Start menu or Start screen and type "defrag." Open up Windows' Disk Defragmenter and make sure it's running on a schedule as intended. It should tell you when it was last run and whether your drives have any fragmentation.


Note: A lot of you are finding that Windows 7's "automatic" defrag leaves a lot to be desired. All the more reason you should check in with Disk Defragmenter every once in a while and make sure it's doing its job! Windows 8 seems to be much better about running it regularly.


Note that in Windows 8, you'll see your SSDs in the Disk Defragmenter, but it doesn't actually defrag them; it's just performing other SSD-related maintenance. So don't worry if it's checked off along with the other drives.

3a8082e126
Reply all
Reply to author
Forward
0 new messages