Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Defragmentation by cloning/re-cloning with Disk Utility?

Defragmentation by cloning/re-cloning with Disk Utility?
Thread Tools
Fresh-Faced Recruit
Join Date: Jul 2008
Status: Offline
Reply With Quote
Sep 11, 2008, 08:45 AM
 
To take up a question posted in another forum:

I've used Disk Utility (booting from the OSX install disk) to clone my system, the purpose being to re-install in a defragmented state so Bootcamp can finally partition the drive.

Questions:

1. Is this really a viable way to defragment? I've just learned that there are two 'levels' of disk imaging; one of which actually maintains the fragmentation by making an exact copy. Which one is Disk Utility using?

2. How do I check that the disk image created will work? It's now on an external FW drive. I've been told to boot from this, but don't know how.

3. In case the .dmg turns out to be fine, do I choose the option 'erase disk' in Disk Utility's 'Restore' menu?

Your help is much appreciated.
     
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status: Offline
Reply With Quote
Sep 11, 2008, 11:45 AM
 
Obviously, if you choose not to erase the drive with Disk Utility before restoring, then it is not making a sector for sector clone since it obviously can't. So erase the drive yourself beforehand and don't check that box in Disk Utility. Files should be restored in one big chunk. Whether Disk Utility makes a sector for sector clone when you do check the erase option I don't know.

When you hold down the option key while booting you will see a screen that allows you to choose the boot volume. You can also choose the boot volume in System Preferences. Use either method to boot from the external drive.
     
Krank  (op)
Fresh-Faced Recruit
Join Date: Jul 2008
Status: Offline
Reply With Quote
Sep 13, 2008, 08:00 AM
 
Originally Posted by TETENAL View Post
Obviously, if you choose not to erase the drive with Disk Utility before restoring, then it is not making a sector for sector clone since it obviously can't. So erase the drive yourself beforehand and don't check that box in Disk Utility. Files should be restored in one big chunk. Whether Disk Utility makes a sector for sector clone when you do check the erase option I don't know.

When you hold down the option key while booting you will see a screen that allows you to choose the boot volume. You can also choose the boot volume in System Preferences. Use either method to boot from the external drive.
Thanks a lot.

I've tried before without checking 'erase drive', and got an error message (that I can't recall). Possibly because there simply wasn't enough room on the internal disk. I guess it's a given that I should either wipe it first or check that box. I'll see how it goes now.
     
Admin Emeritus
Join Date: Oct 1999
Location: Zurich, Switzerland
Status: Offline
Reply With Quote
Sep 13, 2008, 02:34 PM
 
OK, so there are two kinds of Restore: file copy and block copy. File copy is much like making Finder copies, and does defragment in the process, but takes a while. Block copy is true disk cloning, where all fragmentation, etc is preserved, but it's faster. Block copy is triggered by selecting "erase disk" in the Restore part of Disk Utility.

For your case, you want the file copy, so you must not select "erase drive" in Restore. Instead, first erase the destination disk in Disk Utility, then do a Restore without "erase drive".

Are you going to be cloning back to the original disk? If so, then you can do a block copy in one direction and a file copy in the other. Order doesn't matter.
     
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Sep 13, 2008, 03:34 PM
 
What other conditions need to be met for block copy? I thought there was some issue with the size of the source and target partitions. I regularly set it to erase the target drive and yet I still always get file copies rather than block copies.
( Last edited by Simon; Sep 13, 2008 at 11:34 PM. Reason: spelling)
     
Admin Emeritus
Join Date: Oct 1999
Location: Zurich, Switzerland
Status: Offline
Reply With Quote
Sep 13, 2008, 06:14 PM
 
I think the target must be larger than the source, and you can't do it from a live volume, you must be booted from another disk (such as an OS X install disc).
     
Krank  (op)
Fresh-Faced Recruit
Join Date: Jul 2008
Status: Offline
Reply With Quote
Sep 14, 2008, 01:07 PM
 
tooki, thanks so much for helping out.

I'm stuck with a simple problem: I can't seem to boot from the disk image I've created on the external drive. There's a .dmg on the disk with the correct file size (and it took hours to create), but it doesn't show up as boot volume in System Preferences nor when holding down the 'option' key when re-starting. I don't want to proceed cloning it back until I know it's okay. What could be the problem? FWIW, it's a bus-powered FireWire drive.
( Last edited by Krank; Sep 14, 2008 at 01:20 PM. )
     
Moderator
Join Date: Jan 2001
Location: Polwaristan
Status: Offline
Reply With Quote
Sep 14, 2008, 01:22 PM
 
It won't work that way. Open Disk Utility and click the Restore tab. As the source, choose the .dmg you created, and as the destination, drag your external drive from the left-hand pane to the Destination field. Now when you choose restore, it will use the .dmg to make a bootable system on the external.
     
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Sep 14, 2008, 02:59 PM
 
BTW, these days, you don't need to defrag your disk anymore. MacOS X automatically defrags your drive in the background*. I don't think you'll notice any difference.

* Only certain files are defragged, I don't remember the exact size anymore, though.
I don't suffer from insanity, I enjoy every minute of it.
     
Admin Emeritus
Join Date: Oct 1999
Location: Zurich, Switzerland
Status: Offline
Reply With Quote
Sep 14, 2008, 03:08 PM
 
Files under 20MB are automagically defragged upon use. However, Mac OS X does not defragment free space, which can also be a worthwhile endeavor for demanding applications. (For everyday use, it's not worth the effort.)
     
Krank  (op)
Fresh-Faced Recruit
Join Date: Jul 2008
Status: Offline
Reply With Quote
Sep 14, 2008, 07:00 PM
 
Originally Posted by OreoCookie View Post
BTW, these days, you don't need to defrag your disk anymore. MacOS X automatically defrags your drive in the background*. I don't think you'll notice any difference.

* Only certain files are defragged, I don't remember the exact size anymore, though.
Well, BootCamp can't proceed, so some kind of defragmentation is needed.
     
Krank  (op)
Fresh-Faced Recruit
Join Date: Jul 2008
Status: Offline
Reply With Quote
Sep 14, 2008, 07:03 PM
 
Originally Posted by Cold Warrior View Post
It won't work that way. Open Disk Utility and click the Restore tab. As the source, choose the .dmg you created, and as the destination, drag your external drive from the left-hand pane to the Destination field. Now when you choose restore, it will use the .dmg to make a bootable system on the external.
Thanks, I'll go ahead and try that. How come this step is necessary though?
     
Admin Emeritus
Join Date: Oct 1999
Location: Zurich, Switzerland
Status: Offline
Reply With Quote
Sep 15, 2008, 01:04 AM
 
Because a disk image is a file, not a disk. The actual boot files are then hidden inside that dmg file, instead of right inside the disk where the boot ROM can find them.

I think somehow there was some confusion between using Disk Utility to make a clone vs using it to make a disk image. That said, to defragment by copying back, either way should work fine.
     
Admin Emeritus
Join Date: Oct 1999
Location: Zurich, Switzerland
Status: Offline
Reply With Quote
Sep 15, 2008, 01:05 AM
 
Originally Posted by Krank View Post
Well, BootCamp can't proceed, so some kind of defragmentation is needed.
Specifically, a free-space defragmentation. During normal use, even if none of the files are fragmented, all the free space on the disk becomes broken up into a zillion pieces. I imagine that's what causes Boot Camp fits.
     
Krank  (op)
Fresh-Faced Recruit
Join Date: Jul 2008
Status: Offline
Reply With Quote
Sep 15, 2008, 04:02 AM
 
Originally Posted by tooki View Post
Because a disk image is a file, not a disk. The actual boot files are then hidden inside that dmg file, instead of right inside the disk where the boot ROM can find them.

I think somehow there was some confusion between using Disk Utility to make a clone vs using it to make a disk image. That said, to defragment by copying back, either way should work fine.
Thanks again - great to have that clarified.
     
Krank  (op)
Fresh-Faced Recruit
Join Date: Jul 2008
Status: Offline
Reply With Quote
Sep 21, 2008, 07:46 AM
 
Sorry - still having trouble. I've tried to 'restore' repeatedly, but each time get an error message at the end (after hours of seemingly copying just fine).

Could it be because I've used the internal drive a bit after making the disk image, so it's not an exact clone anymore?

Should I erase (wipe) the internal drive first?
     
Krank  (op)
Fresh-Faced Recruit
Join Date: Jul 2008
Status: Offline
Reply With Quote
Sep 23, 2008, 06:59 AM
 
bump
     
Krank  (op)
Fresh-Faced Recruit
Join Date: Jul 2008
Status: Offline
Reply With Quote
Sep 23, 2008, 03:18 PM
 
Oh, and does it make a difference if the disk image is compressed?
     
Professional Poster
Join Date: Oct 2001
Status: Offline
Reply With Quote
Sep 24, 2008, 01:04 PM
 
Originally Posted by tooki View Post
OK, so there are two kinds of Restore: file copy and block copy. File copy is much like making Finder copies, and does defragment in the process, but takes a while. Block copy is true disk cloning, where all fragmentation, etc is preserved, but it's faster. Block copy is triggered by selecting "erase disk" in the Restore part of Disk Utility.
That's why it took 6 HOURS to copy all my crap back over! Haha! I just did this yesterday after installing a new hard drive in my MBP.

I did click "erase disk" at first though, and it gave me some error... Oh well, at least all my stuff is defragged now. Just a warning to those that are going to do this, prepare to find something else to do for the rest of the day!
     
Professional Poster
Join Date: Mar 2002
Location: Boston
Status: Offline
Reply With Quote
Sep 24, 2008, 01:29 PM
 
If you wanted your drive defragged why not just use idefrag, it only costs 35 bucks and for a defragmentation program it seems to be highly regarded.
~Mike
     
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Sep 25, 2008, 03:13 AM
 
I highly doubt wasting six hours is worth the minute gains you might observe after defragmenting in addition to what OS X already does by itself.
     
Professional Poster
Join Date: Mar 2002
Location: Boston
Status: Offline
Reply With Quote
Sep 25, 2008, 07:51 AM
 
Not only six hours a couple of weeks to figure it out, which is why I mentioned idefrag. While the debate over defragging in osx rages on the. The fact remains (at least in my twisted brain) that buying an application that does this instead of backing up/formatting/restoring is much more efficient.
~Mike
     
Fresh-Faced Recruit
Join Date: Mar 2008
Location: Kalamazoo, Michigan
Status: Offline
Reply With Quote
Sep 26, 2008, 06:05 PM
 
I'd like to make an image file copy of my boot drive and store it on one of my other two 1TB internal drives. Both of those drives have only one partition with plenty of space, and one of the drives is my Time Machine drive.

Am I correct that as long as I don't check "Erase destination", I get an image file copy?
Must the destination be "wiped" prior to the copy, or can I copy to a disk that has other files on it?
Is it recommended to create another partition on either of these disks to better protect the copy?
What utility do I use to do the partitioning?
2.8Ghz 8 Core Mac Pro, 8GB RAM, BenQ FP241W display, Epson R1900
--Alan
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Sep 26, 2008, 06:10 PM
 
Originally Posted by Maflynn View Post
Not only six hours a couple of weeks to figure it out, which is why I mentioned idefrag. While the debate over defragging in osx rages on the. The fact remains (at least in my twisted brain) that buying an application that does this instead of backing up/formatting/restoring is much more efficient.
Well, you want to back up first before running any defrag utility anyway, so you're really only saving yourself the restore phase.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Professional Poster
Join Date: Mar 2002
Location: Boston
Status: Offline
Reply With Quote
Sep 26, 2008, 06:25 PM
 
Originally Posted by CharlesS View Post
Well, you want to back up first before running any defrag utility anyway, so you're really only saving yourself the restore phase.
With TM, you really don't need to take that extra step, so again, you're not buying anything by going the backup/restore approach.
~Mike
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 07:35 PM.
All contents of these forums © 1995-2014 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2014, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2