Resolved Question about defragging

UncleSchnitty

macrumors 6502a
Original poster
Oct 26, 2007
851
13
I know questions about defragging have been asked before but I'm having trouble finding an answer on this. I am wondering if defragging will help on my secondary/media drive. Its a 3tb drive that has been slowing down recently, scrolling thru files while watching a movie off it will cause the movie to jitter as I scan. The drive is about 3 years old and is 2/3 full but thats 1tb of free space.
Again this is NOT my system drive, thats a ssd so I know it shouldn't be touched with defrag.
Like always any suggestions would be appreciated.
 
Last edited:

UncleSchnitty

macrumors 6502a
Original poster
Oct 26, 2007
851
13
This is the official answer from Apple.

http://support.apple.com/kb/ht1375

So, if you do think it's a problem then you could use a 3rd party app to defrag the drive and see if it helps but chances are it probably won't help.
I read that about an hour ago and unfortunately it doesn't really help because that addresses osx slowing and not a secondary drive that has many large files on it. In fact most of the articles I read were about system drives and how small files are automatically "defraged" also a lot of the suggestions were verify permissions if you have performance issues. Well obviously that doesn't pertain to secondary/media drives either.
 

AidenShaw

macrumors P6
Feb 8, 2003
18,071
4,138
The Peninsula
Again this is NOT my system drive, thats a ssd so I know it shouldn't be touched with defrag.
Actually, occasional (say every few months) defragging of an SSD is beneficial. (Daily/hourly/continuous is not a good idea.)

Although an SSD has no "head motion" penalty -- it costs CPU and latency for each fragment of a file that has to be written or fetched.

If a file is in tens or hundreds of thousands of fragments, access is significantly slower than for files in a few fragments. This slowdown is at the OS filesystem level - many more IOs are needed (each with a CPU and latency cost), and when writing a file the filesystem has to work harder to find free space if it's only available in small chunks scattered across the LBA range.

Note that the standard advice is not to run the SSD close to full -- it's not a coincidence that disks with a small percentage of free space suffer from much more fragmentation. (Although, TBH, if you have TRIM enabled a nice buffer of unused space also helps the internal garbage collection on the SSD.)

SSDs are not the fragile "OMG don't write to it" devices that some believe - a little housecleaning doesn't really affect the life of the drive.
 
Last edited:

paulrbeers

macrumors 68040
Dec 17, 2009
3,960
120
I know questions about defragging have been asked before but I'm having trouble finding an answer on this. I am wondering if defragging will help on my secondary/media drive. I.
No. Media is not something you constantly delete and write to. Even if you do, the files are "large" thus you are leaving "large" gaps (not just a sector or two like what happens with system files and/or documents and/or internet cache). Therefore, there is usually very little benefit to defragging a Media Drive. I have 18+ TB worth of media that has never been defragged.

Now, if you have 3TB of Media that is on a drive that is 3+ years old, it might be time to consider getting yourself a backup drive if you don't have it already or else.....
 

AidenShaw

macrumors P6
Feb 8, 2003
18,071
4,138
The Peninsula
(not just a sector or two like what happens with system files and/or documents and/or internet cache)
You're mostly on-target - but defragging as an experiment won't do any damage. To UncleSchnitty - if you can find a reputable defragger with a trial period - see if it helps.

But you (PaulRBeers) are off-target on the quoted bit - modern filesystems allocate space in units of a handful or four of sectors. (New AF drives have increased the sector size to the typical allocation unit size, which doesn't get you the bulls-eye but at least you're hitting the target.)

Once you pass the 16 TiB filesystem size, even the AF sector size can be too small for an allocation unit. When I put my new 6-core E5-1650v2 system online, I used a 20 TB volume for one filesystem. It raised the base allocation unit to 8 KiB (two AF sectors, sixteen traditional sectors).

Things have changed since the 90's, you need to keep up.
 

paulrbeers

macrumors 68040
Dec 17, 2009
3,960
120
You're mostly on-target - but defragging as an experiment won't do any damage. To UncleSchnitty - if you can find a reputable defragger with a trial period - see if it helps.

But you (PaulRBeers) are off-target on the quoted bit - modern filesystems allocate space in units of a handful or four of sectors. (New AF drives have increased the sector size to the typical allocation unit size, which doesn't get you the bulls-eye but at least you're hitting the target.)

Once you pass the 16 TiB filesystem size, even the AF sector size can be too small for an allocation unit. When I put my new 6-core E5-1650v2 system online, I used a 20 TB volume for one filesystem. It raised the base allocation unit to 8 KiB (two AF sectors, sixteen traditional sectors).

Things have changed since the 90's, you need to keep up.
So let's recap.... I took time out of my day to provide an ACCURATE assessment to a stranger on the internet that I will never meet.

However, you needed to flex your extensive knowledge of file systems to prove your superiority simply because I used sector vs allocation unit. Got it.

Then you insulted me. Got it.

You win the internet today sir!
 

UncleSchnitty

macrumors 6502a
Original poster
Oct 26, 2007
851
13
So let's recap.... I took time out of my day to provide an ACCURATE assessment to a stranger on the internet that I will never meet.

However, you needed to flex your extensive knowledge of file systems to prove your superiority simply because I used sector vs allocation unit. Got it.

Then you insulted me. Got it.

You win the internet today sir!
I would just like to say thank you to everyone for taking the time to talk about this with me. In fact I think it helps me learn a lot when people on here have apposing stances. All of this is very useful to me
 

macuser453787

macrumors 6502a
May 19, 2012
569
149
Galatians 3:13-14
FWIW, I've seen defrags make somewhat of a difference in performance, albeit not a large leap, but some. And just FYI if you're not already aware, Drive Genius is a great utility for defragging among several other things.
 

UncleSchnitty

macrumors 6502a
Original poster
Oct 26, 2007
851
13
FWIW, I've seen defrags make somewhat of a difference in performance, albeit not a large leap, but some. And just FYI if you're not already aware, Drive Genius is a great utility for defragging among several other things.
Thank you, I have a copy of idefrag I never used. Iactually don't remember how I got it hah I use onyx for all other maitanence.
I think I'm going to run the defrag to see what happens. I have a backup if things go terribly wrong. Hopefully after it runs I can report back if I noticed a difference
 

phrehdd

macrumors 68040
Oct 25, 2008
3,265
724
This is a rather broad topic as to why drives seem "slow" at times.

Here is a little test you can do if you have an extra drive - back up that drive in question and then (assuming you backed it up properly) restore it to the drive in question. You might want to before restoring do a disk utility check to make sure the drive is performing correctly.

What this will do is typically repack the drive without significant numbers of fragments. This is an old way of doing things that some I.T. folks use.
1) back up
2) check drive in question
3) restore

As for iDefrag, a reasonable tool with some additional features related to the OS db/indexes that can be rebuilt or packed.

Where SSD is concerned, I am in the other camp and would not bother defragging but might do the above. Defragging moves data around and as such, SSDs have their own write life cycles being shortened (though probably not too significant if only done once in a while). Also, SSD is not the same as an electro-mechanical drive where fragments are concerned and the amount of CPU cycles is not too relevant or rather insignificant for a "fragged" SSD.
 

AidenShaw

macrumors P6
Feb 8, 2003
18,071
4,138
The Peninsula
Also, SSD is not the same as an electro-mechanical drive where fragments are concerned and the amount of CPU cycles is not too relevant or rather insignificant for a "fragged" SSD.
But the additional CPU cycles and latency are significant for a heavily fragmented SSD.

The filesystem has to create an IO request, send it over serial lines to the disk, the disk has to decode the packet, do the transfer, and send the response to the filesystem.

This has to be done for each fragment, and if the filesystem isn't heavily multi-threaded, the latency can be significant with an SSD. (The latency for a spinner is of course much higher, since disk rotation and head movement are involved.)
 

flowrider

macrumors 603
Nov 23, 2012
5,538
1,964
TRIM is unrelated to defrag - the two do completely different things.
I understand they're different things. But, IMO, they are not unrelated. TRIM erases SSD previously used space using garbage collection techniques thereby releasing that space for use. That was what was meant by my comment.

However, both techniques strive for the same goal. To Improve Performance.

Lou
 

UncleSchnitty

macrumors 6502a
Original poster
Oct 26, 2007
851
13
This is a rather broad topic as to why drives seem "slow" at times.

Here is a little test you can do if you have an extra drive - back up that drive in question and then (assuming you backed it up properly) restore it to the drive in question. You might want to before restoring do a disk utility check to make sure the drive is performing correctly.

What this will do is typically repack the drive without significant numbers of fragments. This is an old way of doing things that some I.T. folks use.
1) back up
2) check drive in question
3) restore

As for iDefrag, a reasonable tool with some additional features related to the OS db/indexes that can be rebuilt or packed.

Where SSD is concerned, I am in the other camp and would not bother defragging but might do the above. Defragging moves data around and as such, SSDs have their own write life cycles being shortened (though probably not too significant if only done once in a while). Also, SSD is not the same as an electro-mechanical drive where fragments are concerned and the amount of CPU cycles is not too relevant or rather insignificant for a "fragged" SSD.
I have checked the drive with diskutil and disk warrior, I backed up, now I'm running the defrag(its been going about 12 hours hah)
My original question was rather simple, should I defrag a large mechanical drive after years of use with large files that have been moved offten? It got a little conveluted with the fact that its not my system drive that's a ssd. I don't defrag my ssd because its newish and only has about 65gb of data. But I am also in the other camp that I don't really have to.
Either way I'll post the results of my defraging on the large drive after I check it out(its about 3/4 done)
 

AidenShaw

macrumors P6
Feb 8, 2003
18,071
4,138
The Peninsula
I understand they're different things. But, IMO, they are not unrelated. TRIM erases SSD previously used space using garbage collection techniques thereby releasing that space for use. That was what was meant by my comment.

However, both techniques strive for the same goal. To Improve Performance.

Lou
I consider them unrelated since TRIM does nothing to reduce the extra CPU cost and latencies associated with fragmented files.

Cache has the goal of improving performance, does that make it related to TRIM and defrag? ;)

In any event, I was talking about severely fragmented SSDs benefiting from an occasional defrag.
 

phrehdd

macrumors 68040
Oct 25, 2008
3,265
724
I have checked the drive with diskutil and disk warrior, I backed up, now I'm running the defrag(its been going about 12 hours hah)
My original question was rather simple, should I defrag a large mechanical drive after years of use with large files that have been moved offten? It got a little conveluted with the fact that its not my system drive that's a ssd. I don't defrag my ssd because its newish and only has about 65gb of data. But I am also in the other camp that I don't really have to.
Either way I'll post the results of my defraging on the large drive after I check it out(its about 3/4 done)
Again, if you backed up the entire drive, then restored it using a tool like CCC or SuperDuper, it repacks the drive. This would take far less time than a defrag. The restore goes by file and not position on a given disk. This means that if you have 10,000 files, each one is copied over and thus avoids a fragmented state (for the most part). Given that this is not your primary disk with the OS but a storage disk, you really should try the repacking process.

If I understand correctly you have some larger files on your drive (media files) and that would explain the lengthy time required for defragging as quite a bit of movement is required to gain space to make files contiguous. Also, defragging is heavily dependent on percentage* free space available.

Having used iDefrag in the past I found it works reasonably well. Then again, I have also used the back up and restore (copy back the back up to the original disk) with excellent results.
 

UncleSchnitty

macrumors 6502a
Original poster
Oct 26, 2007
851
13
Again, if you backed up the entire drive, then restored it using a tool like CCC or SuperDuper, it repacks the drive. This would take far less time than a defrag. The restore goes by file and not position on a given disk. This means that if you have 10,000 files, each one is copied over and thus avoids a fragmented state (for the most part). Given that this is not your primary disk with the OS but a storage disk, you really should try the repacking process.

If I understand correctly you have some larger files on your drive (media files) and that would explain the lengthy time required for defragging as quite a bit of movement is required to gain space to make files contiguous. Also, defragging is heavily dependent on percentage* free space available.

Having used iDefrag in the past I found it works reasonably well. Then again, I have also used the back up and restore (copy back the back up to the original disk) with excellent results.
That is an excellent suggestion and it makes a lot of sense. If I hadn't started the defrag last night I definetly would have tried that out. Its funny my first instinct would have been that CCC copy's sector by sector including the fragmented and blank spaces but that would take hours and hours when CCC takes a fraction of that. Hmm excellent point.
 

phrehdd

macrumors 68040
Oct 25, 2008
3,265
724
That is an excellent suggestion and it makes a lot of sense. If I hadn't started the defrag last night I definetly would have tried that out. Its funny my first instinct would have been that CCC copy's sector by sector including the fragmented and blank spaces but that would take hours and hours when CCC takes a fraction of that. Hmm excellent point.
Always a next time. Best luck to you on your defrag and gaining some better results from your drive. Many of us have gone through similar issues one time or another and its all a learning experience.
 

UncleSchnitty

macrumors 6502a
Original poster
Oct 26, 2007
851
13
So I let the defrag run and after many many hours it finished. After looking around folders and loading a few things it seems that it DID end up fixing the slowdown I was experiencing. There is less lag when opening files, previews for pictures pop up quickly, when watching a video and simultaneously searching for a file I don't get the lag there either.
I would like to thank everyone for their time and suggestions. I guess we can now say on a healthy large drive with many many large files that doing a defrag will help with some slow down.
 

macuser453787

macrumors 6502a
May 19, 2012
569
149
Galatians 3:13-14
So I let the defrag run and after many many hours it finished. After looking around folders and loading a few things it seems that it DID end up fixing the slowdown I was experiencing. There is less lag when opening files, previews for pictures pop up quickly, when watching a video and simultaneously searching for a file I don't get the lag there either.
I would like to thank everyone for their time and suggestions. I guess we can now say on a healthy large drive with many many large files that doing a defrag will help with some slow down.
And there you have it! :)
 

Dr. Stealth

macrumors 6502a
Sep 14, 2004
812
713
SoCal-Surf City USA
No. Media is not something you constantly delete and write to. Even if you do, the files are "large" thus you are leaving "large" gaps (not just a sector or two like what happens with system files and/or documents and/or internet cache). Therefore, there is usually very little benefit to defragging a Media Drive. I have 18+ TB worth of media that has never been defragged.

Now, if you have 3TB of Media that is on a drive that is 3+ years old, it might be time to consider getting yourself a backup drive if you don't have it already or else.....
Ding Ding Ding.... This is the correct answer! :D
 

crjackson2134

macrumors 601
Mar 6, 2013
4,486
1,618
Charlotte, NC
I'm going to put in my 2¢ worth of input just because I'm bored. I have a lot of years of wasted time playing with defraggers and have learned that when dealing with the various popular file systems for Unix derivatives it's generally a waste of time. If you have modified and replaced so much data that it's actually causing a performance problem, there is a faster and safer alternative that won't overheat your drive (I have to assume we're discussing electro-mechanical spinners), or rely on the quality of the tool which sometimes proves to be not so great when working with many Terabytes, and may cause data loss.

I find it much more efficient to copy the data to a different drive, reformat the fragmented drive, then copy the data back. This is generally much faster, and gets mostly similar results. This also produces less wear to the actuator parts and less internal heat.

IMHO it's much better to use the copy method if you REALLY need to reduce data fragmentation.

If it's a system drive, a backup & restore can accomplish the same thing.