# defrag the system drive



## dr fletch (Jul 10, 2007)

Anyone have any suggestions as to how best I can defrag my system drive. ? ?

I have a copy if iDefrag but as it's a download, I can't work on the system drive.

cheers


----------



## SGilbert (Jul 10, 2007)

IMHO, you'd be far better served by rebuilding the directory with DiskWarrior.  Onyx, or others, can optimize your HD without booting into another system.


----------



## dr fletch (Jul 10, 2007)

thanks but I tried to rebuild the system directory with Disk warrior and it said it was unable to do so due to it being too severely damaged. I assumed the next step was a defrag.????


----------



## Giaguara (Jul 10, 2007)

Defrag isn't really for much use in OS X unless you severely abuse your system (creating and deleting huge files all the time several times a day of different sizes, for months or years, without any maintenance).
What was the original issue you were trying to fix wih dw?


----------



## dr fletch (Jul 10, 2007)

Giaguara said:


> Defrag isn't really for much use in OS X unless you severely abuse your system (creating and deleting huge files all the time several times a day of different sizes, for months or years, without any maintenance).
> What was the original issue you were trying to fix wih dw?



DW suggests I rebuild the system directory before installing it on the Mac (G4), but when I try it says I cannot as it's too badly damaged. No other explaination is offered. i'm merely concerned that it has 'issues'.


----------



## SGilbert (Jul 10, 2007)

In my experience, if DW can't fix it (it's REALLY bad), you need to do an "Archive & install" from your Original system disk.


----------



## ex2bot (Jul 15, 2007)

I have iDefrag, and it works VERY well if you keep it in perspective. Dr. Fletch, it's probably not going to help your scrambled data. You need to reformat your hard drive and restore your data from backups. If you don't have backups, there are are some steps you can take to recover your data. 

If you have two Macs, search this site ("Search" on the dark blue strip above) or Google for "Firewire Target Disk Mode". Use it to try and recover important data. Start up the computer with the damaged hard drive holding down T. Connect the two with a Firewire cable that has the correct ends. The scrambled drive will hopefully show up as a disk on the other Mac's desktop.

If you have a bootable external drive, install OS X on it. Boot from the external drive by restarting and holding down the Option key. Select the external drive. The internal drive may mount on the Desktop. if so, try to copy important data off it to your backup drive.

Or try the commercial Data Rescue II by ProSoft Engineering. I've heard good things about it.

The best thing to do is back up your data BEFORE your disk gets scrambled. I hope you did.

Good luck!

--------------------------
More info on iDefrag:

It's good for defragging a disk that has been used for quite awhile, especially if you download a lot of stuff from the Internet or use big audio and video files. If you defrag monthly, for example, you're probably not going to notice a performance benefit month to month.

iDefrag optimizes the hard drive in addition to defragging it. Go to their website, login and download the Coriolis CD Maker. It will put your iDefrag on a CD. Boot from the CD by restarting the computer and holding down C.

Good software, good interface. Worth $30 to me, at least. I use it once every 6 months or so on my multiple machines. BTW, OS X does defrag its drives automatically, but only files smaller than 20 megs (I believe). It's nowhere near as thorough as iDefrag.

Caution: Defragging is, by nature, a bit risky. Back up your valuable data before defragging. Also, make sure you have the most recent version of iDefrag. Updates are free to registered users (perhaps until they come out with a major new version, I'm not sure).

Doug


----------



## Mikuro (Jul 15, 2007)

Defragging does not repair a damaged drive. If your drive is damaged, you need to take other steps. Have you tried repairing the disk in Disk Utility yet? And do Disk Utility or Disk Warrior give you any other information?

It sounds like your system is still working, so I assume the damage isn't too severe. You should back up your important data before doing anything further. That's just good practice.


Generally, defragmenting OS X volumes is more trouble than it's worth. OS X keeps its disks a bit tidier than Windows to start with, so fragmentation doesn't usually become a big issue. There are certainly exceptions to this rule, but unless you're suffering unusual performance hits that you can clearly trace to disk access, I wouldn't bother defragmenting at all.


----------



## Natobasso (Jul 16, 2007)

OS X utilizes disk space in such a way that it does not need to be defragged. What you do need to do regularly is repair permissions: apps/utilities/disk utility/repair permissions. 

Onyx is a great program for this, though you don't absolutely need it on a regular basis. Repair permissions once a month, or so, should suffice. Restart your computer every now and then as well.


----------



## bluedevils (Jul 16, 2007)

another recently active thread (geek message) confirmed to me that osx has the old unix disk utility fsck.  Would this be a solution for you?


----------



## DeltaMac (Jul 16, 2007)

fsck also has no provision for defragging the hard drive.
defragging is only needed in certain limited situations, and as others have posted, is usually of little concern with OS X, especially with more recent versions.


----------



## bluedevils (Jul 16, 2007)

Sorry I didn't make myself clear.  Wouldn't fsck be more appropriate than defragging, if he is having hard drive problems?  I have never had to defrag a unix machine, but fsck can be helpful correcting filesystem errors.


----------



## jbarley (Jul 16, 2007)

A very thorough defragging can be had, if you really feel the need, by cloning your drive to say, an external harddrive.
Then reformatting the drive in question and restoring the clone back onto it.
Each and every file will be laid on in one piece with no spaces between.
   Probably the best way to get it done, as most would recommend the backup stage before any attempt to rearrange the files on your disk.

jb.


----------



## DeltaMac (Jul 16, 2007)

About the fsck question. OS X has Disk Utility, which is a GUI for fsck. A more powerful utility, DiskWarrior, reports problems it cannot repair. So, fsck really is a moot point here. Back up  while you can, reformat, and restore to the hard drive, if it is working OK then. Otherwise, replace the HD.


----------



## MisterMe (Jul 16, 2007)

DeltaMac said:


> About the fsck question. OS X has Disk Utility, which is a GUI for fsck. ...


No. *Disk Utilities* is limited to repairing permissions on your boot volume and to verifying it. It cannot repair the volume itself. If you want to repair your boot volume, you must boot into single-user mode--the Darwin CLI--and type *fsck -fy* at the command prompt. To accomplish the same thing with *Disk Utilities*, you must boot from a second volume such as a CD, DVD, or second partition and run *DU* from there.


----------



## Natobasso (Jul 17, 2007)

bluedevils said:


> another recently active thread (geek message) confirmed to me that osx has the old unix disk utility fsck.  Would this be a solution for you?



To run fsck -f:
restart and hold command + s till black screen comes up, then type fsck -f. Type reboot when process is finished.


----------



## Kees Buijs (Jul 19, 2007)

bluedevils said:


> Sorry I didn't make myself clear.  Wouldn't fsck be more appropriate than defragging, if he is having hard drive problems?  I have never had to defrag a unix machine, but fsck can be helpful correcting filesystem errors.



Defragmentation is used to increase speed by re-arranging files in suc a way that they can be read more quickly. Normally after some time a file may be stored in multiple fragments on different parts of the drive, which will decrease reading speed because the head has to make additional movements). Therefore DEFRAGMENTATION has no consequence for the proper function of a drive, a drive never fragment might be slow, but will work as good as a defragmented one. DEFRAGMENTATION therefore will not solve this problem.


Good luck, Kees


----------



## ex2bot (Aug 1, 2007)

This thread is more about a corrupt drive format than defragging, but there's some misconception here. OS X does defrag automatically, but only to files less than 20 MB in size. There are plenty files on modern hard drives bigger than that.

iDefrag, which Dr_Fletch owns, is currently the BEST defrag util for OS X (AFAIK) because it optimizes the data, clustering more important data first on the disk. (I'm sure you can Google for a better explanation.)

iDefrag is not going to work wonders, but it can increase speed and efficiency when used occasionally. It's "only" $30. If that seems like a relatively small amount of money to you for a piece of software, it may be a worthwhile purchase. 

But to say iDefrag is useless is inaccurate.

** And, again, I know Dr_Fletch's drive is corrupt and can't be fixed by defragmentaion. **

Doug


----------



## Natobasso (Aug 1, 2007)

Apple says defragmentation is not necessary:
http://docs.info.apple.com/article.html?artnum=25668


----------



## Mikuro (Aug 1, 2007)

Defragmentation is _generally_ not necessary, but sometimes it is.

OS X gets a little too much credit for it's "auto-defragmenting", which is very limited. Compared to Windows, yes, it's great. That doesn't make it perfect. It used to be a huge issue for me, really crippling my performance. These days it's not a problem (the last time I defragmented was over a year ago), because I now take preventive measures, like keeping larges files (like video) off of my startup partition.

There are many cases when defragmenting is called for &#8212; this just isn't one of them.

I still advocate the backup-erase-restore method, though. I've had bad experiences with iDefrag. Whatever you do, be sure to make backups first.


----------



## dr fletch (Aug 1, 2007)

Agreed, I think after my recent horrors with my drives, backup - erase - restore is the best option. I don't use iDefrag now at all. It seems there's no need. I recently bought Personal Backup X4 and use that to backup VERY regularly now. Once bitten......


----------



## ex2bot (Aug 1, 2007)

Natobasso, iDefrag is the only defragmentation app that is aware of the "hot band" on HFS + drives that is mentioned toward the end of the tech note you linked to. 

And from what I've seen when running iDefrag on my own hard drives, there's room for improvement. I just ran iDefrag to check my system drive. Lots of fragmentation indicated.

Your referenced tech note also mentions some usage patterns where fragmentation is more likely to occur, such as when manipulating large video files. Or when the drive is close to being full (say, less than 10% free).

So, Apple doesn't exactly say it's not necessary. Just that gains are smaller with modern drives. I remember some people talking about defragging their drives every week. This never was necessary or beneficial. Once every few months perhaps.

Doug


----------



## Natobasso (Aug 2, 2007)

dk,

I have never ever defragged since OS X came out and apple has stated this is the beauty of the operating system that you do not have to defrag your drive because of the way it handles files. I've not seen that it treats small or large files any differently.

I just repair permissions and disk once a month or so and restart every once in a while and that's it. To me, defragging is a thing of the past. If you want to do it, go right ahead.


----------



## ex2bot (Aug 2, 2007)

The 20 meg limit is not an opinion, it's a design limitation of the filesystem.

Reference:

http://www.kernelthread.com/mac/apme/fragmentation/

Doug


----------



## Natobasso (Aug 2, 2007)

except that the author of the article states:
"Note that I do not intend to make any claims regarding the fragmentation-resistance of HFS+. I have sampled too few a volume to generalize my "results". This discussion is more illustrative than empirical, wherein I am only suggesting a tool/method that you could use to gauge your own volumes' situation."


----------



## Mikuro (Aug 2, 2007)

The 20MB rule is pretty well established. See:

http://www.kernelthread.com/mac/osx/arch_fs.html (look under "Optimizations")
Or if you're feeling extra geeky today, http://episteme.arstechnica.com/eve/forums/a/tpc/f/8300945231/m/9900929295/p/1 .

It would not be practical (or even possible in many cases) to relocate large files.


----------



## g/re/p (Aug 2, 2007)

SGilbert said:


> In my experience, if DW can't fix it (it's REALLY bad), you need to do an "Archive & install" from your Original system disk.



The post quoted above is the most applicable solution to your problem, 

but you should use erase and install with the Zero out Data option 

selected from the Security Options tab - instead of archive and install.

Zeroing out the drive will map out any bad sectors -  If your drive is 

corrupted so bad that DW cannot fix it, archive and install  may not  

get rid of all the corrupted data.



Also - i see from your post that you backup regularly, so you should 
be good to go with erase and install.


----------



## Kees Buijs (Aug 3, 2007)

dr fletch said:


> Agreed, I think after my recent horrors with my drives, backup - erase - restore is the best option. I don't use iDefrag now at all. It seems there's no need. I recently bought Personal Backup X4 and use that to backup VERY regularly now. Once bitten......




Also make extra backups when doing dangerous things like defragging or cleaning up the drive. These are the most vulnerable moments to lose data.

I would not suggest to erase your drive for the sake of making it defragmented. Smarter OS handing and faster drives will reduce the profit to a minimal. The moment you start restoring, defragging will start again, so the result of a couple of hours of work is less defragmention, not NO defragmentation.


Good luck, Kees


----------



## mishap87 (Sep 19, 2009)

where to get the Coriolis CD Maker?
what is their website


----------



## DeltaMac (Sep 19, 2009)

Download CD Maker at the Coriolis web site. (registration required)
https://secure.coriolis-systems.com/login.php


----------



## mishap87 (Sep 19, 2009)

and the only way to register is to buy a product?
or is there a free way to register?


----------



## DeltaMac (Sep 20, 2009)

Did you try that yet? I think you can register without purchasing, just to download a demo. You may find that the download will be limited without purchasing, perhaps only for one try, or some limited number.


----------

