Jump to content

[GUIDE] Use Clonezilla to back up your startup disk


15 posts in this topic

Recommended Posts

If you are going to mess around with trying to create a working Hackintosh, you’re really going to want some form of backup so that you can revert to it when your changes or tweaks don’t work right. You could use Time Machine, Carbon Copy Cloner, SuperDuper! or any number of other GUI programs that run in Mac OS (and then to restore your whole disk you may need to reinstall your boot loader), but there is another alternative in Clonezilla that works very well.

 
This is a tutorial to show how to use Clonezilla Live to make a basic disk clone for backup, or to restore your machine from a perviously created backup. Clonezilla is a very capable program with many options and uses. This tutorial is only intended to show its use in its most basic form for new users. If you want to explore other uses for Clonezilla, you will need to do research and exploration yourself, as for me, this is all I need.
 
Why use Clonezilla Live instead of another backup program?
 
1. Clonezilla Live is FREE and OPEN SOURCE.
 
2. Clonezilla Live is outside of your current operating system and can make a bootable clone of nearly any current boot disk from a current OS and boot loader. For more details, see the Clonezilla website: http://www.clonezilla.org
 
3. Clonezilla Live is fast. Well, relatively speaking I guess, at least for most disks. It only clones the used data portion of the disk, saving time. Connecting my computer to a refurbished Western Digital Caviar Blue 250GB drive in an old-and-really-cheap USB 2.0 case, a clone of my startup drive with about 60GB of data took about 21 minutes. Connecting to a 250 GB SSD in a modern USB3 SuperSpeed Case, the same clone took 4 minutes (running at near 20 GB/min speed).
 
4. Clonezilla Live creates a bare metal backup. What that means is that if everything goes sideways, you could buy new hardware matching your current specs, properly set up the BIOS, then use Clonezilla to restore the information and boot sectors to a new drive and you would be back in business. [i have not tried this with a new disk, but have reloaded my system several times form backup with perfect results.]
 
5. Unlike some commercial cloning programs that run within the Mac OS (or others), there is no need to reinstall the boot loader after the clone is made. The disk is ready to use right after being made.
 
What are the disadvantages to using Clonezilla Live?
 
1. Finding the correct version and creating a usable USB stick, CD, or DVD can be difficult and intimidating for those with a less technical background.
 
2. The user interface, while very usable, is a bit of an antique. It looks and acts like it belongs in ye olde computer museum. This further adds to the difficulty and intimidation factor for new and less technically skilled users.
 
3. Clonezilla cannot do incremental backups. It only does whole disk copies.
 
4. Clonezilla can be very picky about cloning to a drive the is not equal to or greater in size than the source disk – even down to the last sector block.
 
Hopefully this tutorial will help some of you get started with this very useful program.
 
 
 
 
The Setup
 
You need a disk for your backup. The Clonezilla instructions say “the destination partition must be equal or larger than the source one.” So technically, you want a disk equal in size to the one you are Cloning (or a partition of equal size, but this tutorial is ONLY about the BASICS, so we will just use the whole disk). Now, it is true that the program only copies the data portion of the disk, so it is possible that this will work with two different size disks, but this is not supported by the Clonezilla documentation (unless you use Expert Mode, but this tutorial is ONLY for BASICS, remember). Having said that, I used a 1 TB disk for backup and restored the clone to a 250 GB drive with no problems, but this may not always work.
 
For the purposes of this tutorial, I will stick to just a 250 GB internal SSD startup disk, and an external 250 GB hard disk backup for simplicity.
 
Download Clonezilla
 
As stated above, getting the correct version can be intimidating for new users. Almost all modern hardware that is being used for a Hackintosh will use the Ubuntu based version that can be downloaded from the link below. Be sure to download the ISO file. The download options should look like this before pressing the down load button (you want the version labeled amd64 even if you have an Intel processor).
 
post-985174-0-81871500-1445450592_thumb.jpg
 
 
Take the ISO image out of your downloads folder and place it on the desktop before continuing to the next step.
 
 
 
Create a bootable USB flash drive from the ISO file
 
While you COULD use a CD or DVD for this purpose, why would you go for such old technology when a USB flash drive with work better and faster.
 
Before I start: I am using the brackets [ ] to denote something to be replaced in a command. You do not type the brackets, only the item described inside the brackets. If you still don’t understand any part, look at the completed example at the end of this section.
 
1. Insert your USB Flash Drive. Since the ISO file is only about 200 MB, you won’t need a very large drive. I don’t think it even matters what the current file system is on the drive for this because it will all be erased in this process (I have done this with both GUID and FAT32 systems).
 
2. Open Terminal (in the finder, use the Go menu and choose Utilities, there you will find Terminal.app)
 
3. Type
diskutil list
 to get a list of connected drives. Note the identifier for your drive (disk1 in my example)
 
4.  Unmount your USB drive with the following command. 
diskutil unmountDisk /dev/[your disk identifier]
 
5. Copy the ISO image to your USB drive with the following command. Note that you should start typing until “if=“ and then drag the ISO image from the desktop to the insertion point to get its path before continuing to type the rest of the command.
sudo dd if=[drag your ISO image from the desktop to here to get its path] of=/dev/r[your disk identifier] bs=1m
When you press enter your will be prompted for your password. Enter it and press return. Be patient as it will take a bit of time with no indication that anything is happening other than the fact that the $ prompt has not reappeared yet.
 
dd is a direct sector disk copy utility
if=  specifies the source disk or image
of= specifies the destination disk or image
/dev/ means device
r before the disk identifier apparently speeds up the process
bs=1m specifies the size of block to read at one time (if this is not working you can try bs=1M)
 
 
When finished it will give a message about what was copied. Also, a warning should appear on your desktop indicating that the disk is not readable by your computer:
 
post-985174-0-14487200-1445450754_thumb.jpg
 
This is another indication that you followed the steps correctly – IMPORTANT! Click on the Ignore button to dismiss the warning.
 
5. IMPORTANT! After dismissing the warning, go back to the terminal. Enter the command 
diskutil list
 again. You should see your USB drive with something like “FDisk_partition_scheme.”
 
6. Eject your USB drive by issuing the command 
diskutil eject /dev/[your disk identifier]
  You should get a message that the disk was ejected. Remove the USB drive at this time, and use something to write Clonezilla on its case so you know what it is.
 
Here is the text of the entire process on my computer for reference:

Last login: Sun Oct 11 09:06:17 on console
Anachronauts-Computer:~ anachronaut$ diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *250.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS El Capitan              249.2 GB   disk0s2
/dev/disk1 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *7.9 GB     disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                  Apple_HFS Clonezilla              7.6 GB     disk1s2
Anachronauts-Computer:~ anachronaut$ diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
Anachronauts-Computer:~ anachronaut$ sudo dd if=/Users/anachronaut/Desktop/clonezilla-live-20150805-vivid-amd64.iso of=/dev/rdisk1 bs=1m
Password:
191+0 records in
191+0 records out
200278016 bytes transferred in 6.947753 secs (28826301 bytes/sec)
Anachronauts-Computer:~ anachronaut$ diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *250.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS El Capitan              249.2 GB   disk0s2
/dev/disk1 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *7.9 GB     disk1
   1:                       0xEF                         7.5 MB     disk1s2
Anachronauts-Computer:~ anachronaut$ diskutil eject /dev/disk1
Disk /dev/disk1 ejected
Anachronauts-Computer:~ anachronaut$
The following seems like a lot of steps, but it all goes quite quickly once you get the idea.
 
 
Boot from your Clonezilla Live USB drive to clone your startup disk
 
1. Shut down your computer
 
2. Insert your Clonezilla Live USB drive into an active USB port. Clonezilla does seem to use USB3 speeds, so this may be a good option. (Although this is probably only relevant to your backup drive, not the USB stick).
 
3. Attach your backup disk to another USB port (USB3 if available) if your are using an external backup drive (highly recommended).
 
4. Power up your computer while holding down the key for choosing boot options. Since I am using an ASUS board this is f8, but this varies by manufacturer, so check your manual if you are not sure.
 
5. Choose to boot from your Clonezilla USB drive. It should be the one with the smaller capacity. Don’t worry if you have an older USB backup drive that does not show up at this point, we can get it to show later. You will see some text, and then Clonezilla will start. Here is what my boot options list looked like:
 
post-985174-0-19164500-1445450777_thumb.jpeg
 
For all of the following Clonezilla screens, it is usually easiest to use the arrow keys and the enter key to select your options. Ignore the part in the onscreen Clonezilla instructions about using the space key. Most of the time, if you don't know, just stick with the default options.
 
6. Choose screen resolution
post-985174-0-70527300-1445450778_thumb.jpeg
 
7. Choose language
post-985174-0-26759500-1445450780_thumb.jpeg
 
8. Choose keymap
post-985174-0-72936700-1445450781_thumb.jpeg
 
Some text will fly by here and then…
 
9. Choose Start Clonezilla
post-985174-0-07475000-1445450783_thumb.jpeg
 
10. Choose device to device clone
post-985174-0-15237800-1445450784_thumb.jpeg
 
11. Choose Beginner Mode
post-985174-0-57605300-1445450785_thumb.jpeg
 
12. Choose disk_to_local_disk
post-985174-0-75606800-1445450786_thumb.jpeg
 
13. Choose source disk.
post-985174-0-21527100-1445450788_thumb.jpeg
 
Notice in the above image, that my 250 GB external disk does not show here. If the target disk doesn’t appear, as like the image here, choose cancel (use the mouse). Turn the external drive off, and then back on again (or disconnect and reconnect if no external power) and then follow the onscreen instructions to restart Clonezilla. It should appear in the list the next time.
 
14. Here is the source disk chooser after restarting Clonezilla and getting back to this point. Notice that both 250 GB disks now appear. I will choose the M.2 drive for the source, and the WD drive for the target from here.
post-985174-0-76303800-1445450789_thumb.jpeg
 
15. Choose target disk. This will be erased so be sure you have the right one.
post-985174-0-22575100-1445450822_thumb.jpeg
 
16. Choose to skip repair.
post-985174-0-25859600-1445450823_thumb.jpeg
 
17. Press Enter to continue.
post-985174-0-60700200-1445450824_thumb.jpeg
 
18. Enter y and then y again to confirm erasure of your disk. This is your last chance to back out if you did not choose the correct target disk, so double check you are correct.
post-985174-0-86873600-1445450825_thumb.jpeg
 
19. Watch the progress, or go do something else for a while.
post-985174-0-37544200-1445450827_thumb.jpeg
 
20. Press enter to continue again.
post-985174-0-08803700-1445450829_thumb.jpeg

 

21. IMPORTANT! Choose to Poweroff. Once the computer has shut down, remove the Clonezilla USB drive and your external backup drive before starting your computer again.
post-985174-0-24346400-1445450830_thumb.jpeg
 
You should now have a nearly identical, bootable clone to your startup disk. To restore a system, just reverse the choices with the Source and Target disks.

 

One final note: Despite appearances, Clonezilla is still in active development. When I first downloaded and used Clonezilla Live, the file name was clonezilla-live-20150805-vivid-amd64.iso, when writing this tutorial, I downloaded the latest version which is clonezilla-live-20151012-wily-amd64.iso. Notice that the date of issue is conveniently coded in the name, the latest version being issued on October 12, 2015.

  • Like 2
Link to comment
Share on other sites

  • 10 months later...
Thinking this would be ideal for what I'm looking to do.  

 

I want to upgrade from Yosemite to El Capitan but I've got everything dialed in just about how I want in my current setup.  Most importantly, I have iMessage up and running.  For the longest time, I could not get iMessage validated. I mostly gave up on it and then randomly tried logging in a couple of months ago and it worked out of the blue.  Losing it would be a deal-breaker.

 

I'm assuming an upgrade with Clover is pretty straightforward and wouldn't affect that but it still worries me.  

 

So while researching the best way to backup my system, I came across your post.  Would this be the most surefire way to revert back to my current setup untouched if something gets borked? I can clone my SSD and if something goes wrong, I can just restore via Clonezilla and be on my merry way with all my exact apps, settings and log-ins like nothing happened?  

 

And you're recommending that if my system disk is a 256GB SSD, I should use another 256GB SSD as the cloned backup?

Link to comment
Share on other sites

 

Thinking this would be ideal for what I'm looking to do.  
 
I want to upgrade from Yosemite to El Capitan but I've got everything dialed in just about how I want in my current setup.  Most importantly, I have iMessage up and running.  For the longest time, I could not get iMessage validated. I mostly gave up on it and then randomly tried logging in a couple of months ago and it worked out of the blue.  Losing it would be a deal-breaker.
 
I'm assuming an upgrade with Clover is pretty straightforward and wouldn't affect that but it still worries me.  
 
So while researching the best way to backup my system, I came across your post.  Would this be the most surefire way to revert back to my current setup untouched if something gets borked? I can clone my SSD and if something goes wrong, I can just restore via Clonezilla and be on my merry way with all my exact apps, settings and log-ins like nothing happened?  
 
And you're recommending that if my system disk is a 256GB SSD, I should use another 256GB SSD as the cloned backup?

 

 

That is correct. Not just the same size SSD, but the same make and model — the actual sector count needs to be identical to clone easily in both directions.. This is important, as Clonezilla (with basic use) cannot clone from a larger disk to a smaller disk, even if the data on it would fit. If sectors are blocked due to damage, it may not work correctly when trying to restore. That being said, I have not had a problem restoring from my SSD clone, probably because with over-provisioning there are always the correct number of sectors unless the SSD is way overused.. It is possible to do a correct clone from a larger disk to a smaller disk by resizing the main partition and then cloning each partition separately, including the EFI partition. This is a bit sketchy and may not always work but I have done it successfully on occasion. I really like the simplicity of Clonezilla and continue to use it.

 

Oops, one more note to add. When I first used this with SSD's it was easy to identify the internal drive to be cloned because it was an M.2 drive and it said that right on the screen. With my newest Hackintosh, I am using 2 identical SATA SSD's, one internal and one external. It does not say "internal" or "external" in Clonezilla, all you get is sda, sdb, sdc, etc. So what I did to make absolutely sure was to start Clonezilla with only the internal drive and copied down the serial number. Then I restarted Clonezilla (easy to do from the given options onscreen), and I could easily identify the internal and external drives by their serial numbers.

Link to comment
Share on other sites

That is correct. Not just the same size SSD, but the same make and model — the actual sector count needs to be identical to clone easily in both directions.. This is important, as Clonezilla (with basic use) cannot clone from a larger disk to a smaller disk, even if the data on it would fit. If sectors are blocked due to damage, it may not work correctly when trying to restore. That being said, I have not had a problem restoring from my SSD clone, probably because with over-provisioning there are always the correct number of sectors unless the SSD is way overused.. It is possible to do a correct clone from a larger disk to a smaller disk by resizing the main partition and then cloning each partition separately, including the EFI partition. This is a bit sketchy and may not always work but I have done it successfully on occasion. I really like the simplicity of Clonezilla and continue to use it.

 

Oh wow...the exact same brand and model too?  I think they may have discontinued the one I have. 

Link to comment
Share on other sites

Oh wow...the exact same brand and model too?  I think they may have discontinued the one I have. 

 

That is why with my new Hackintosh I just bought two identical drives right from the start. If you have extra money lying around (???!!), you could buy two new SSD's, clone to the new drive, swap it into your current computer in place of the other SSD, and then use the second one you bought for a backup. Note that if the new drive has a larger capacity than the old drive, you may want to resize the main partition after you make the clone, otherwise you will be limited to using only as much space as the smaller original drive.

Link to comment
Share on other sites

That is why with my new Hackintosh I just bought two identical drives right from the start. If you have extra money lying around (???!!), you could buy two new SSD's, clone to the new drive, swap it into your current computer in place of the other SSD, and then use the second one you bought for a backup. Note that if the new drive has a larger capacity than the old drive, you may want to resize the main partition after you make the clone, otherwise you will be limited to using only as much space as the smaller original drive.

 

But wouldn't I have trouble cloning the current SSD to the new one since it would be a different model?

Link to comment
Share on other sites

But wouldn't I have trouble cloning the current SSD to the new one since it would be a different model?

 

Not a problem if the new drive is as large (same sector count) or larger than the drive you currently have. The model only matters for sizing, and restoring from the backup. For the initial clone, you can use any drive that is the same size or larger. It is even possible that two drives from different "manufacturers" have the same sector count because they contain the same chips internally. In that case, a clone would work in both directions. You could try buying the updated model of the drive you currently have. It may still have the same sector count as companies tend to stay the same on these things with SSD's.

Link to comment
Share on other sites

Not a problem if the new drive is as large (same sector count) or larger than the drive you currently have. The model only matters for sizing, and restoring from the backup. For the initial clone, you can use any drive that is the same size or larger.

 

Gotcha.  Debating whether I should bite the bullet and buy two whole new SSDs or buy one used SSD that's the same model I have off Ebay.

Link to comment
Share on other sites

Got it.  I think there's one model in particular that shares the same chipset.  Thanks for the info.

 

Worst comes to worst, could I just swap the cloned SSD into my rig?

 

Absolutely, it should work perfectly if the clone was successful.

Link to comment
Share on other sites

  • 3 months later...

Hi Anachronaut,

 

Thanks for the great tutorial. 

 

New to hack community, so the detail is greatly appreciated.

 

I'm running Sierra on an 256GB NVMe drive. Is it possible to clone my install using Clonezilla?

Would you recommend an external 256GB SSD for this purpose? 
 

From what I understand it should be possible..

Before I tweak my setup further, it seems best to clone and then try and restore from a clone to ensure it works.. does that make sense?

 

thanks!
 

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Thanks so much for the tutorial.

 

My experience may be handy for some people:

 

I have 2 SSD's, a 250Gb and a 60GB. When I upgrade OSX on my Hackintosh, I first install to the 60GB and run off it for a week or so, then clone it over my 250GB when I'm sure everything's OK.

 

Traditionally I was doing that with Carbon Copy Cloner (great software), but then I often have to re-do various Hackintosh-y stuff involving the EFI partition. So this time around, I thought I'd give Clonezilla a go.

 

I had two main problems, both of which I overcame, but thought I'd share my experience in case it shortcuts someone else to solve these problems:

 

1. Computer would not boot after clone. Clover loaded fine off the cloned drive (250GB), but the OSX loading bar slowed, and slowed, and slowed, then I got a ø symbol. I thought that was weird for an exact clone of a perfectly functioning drive, but restarted, went into EFI boot device screen, chose my old 60GB drive that had been working fine for a week... same thing. Panicked. Couldn't see how copying from a drive with Clonezilla could make it unbootable.

 

Disconnected 250GB drive inside my case... and it booted fine off the old 60GB. OK, reconnected the 250GB and disconnected the 60GB... booted fine again off the Cloned drive. OK... weird. Thought maybe OSX was confused about them having the exact same name and everything, renamed the 250GB drive, plugged 60GB back in, booted... once again, would not boot off either drive.

 

So while Clonezilla works flawlessly, there are at least some cases where OSX gets really upset about two identical drives on SATA. Not a problem once you know about it. I can boot from my USB Sierra installer and reformat the 60GB when I want to use it again.

 

2. Drive size - now I had my 250GB running fine, just like the old 60G. Clone was fine. Except the 250GB reported its drive size as... 60GB. Disk Utility showed the disk size as 250GB, but the partition size as 60GB, and wouldn't let me change the partition size. Rebooted off USB, Disk Utility - still couldn't change partition size. Downloaded several 3rd party partitioning tools - none of them would resize it either.

 

Downloaded Gparted Live and followed the exact instructions from the first part of this tutorial again to make a bootable Gparted USB off the ISO. Booted off of that - Gparted would't allow me to resize the boot partition either. Messed around with it, read forums for a long time. Eventually created a second HFS+ partition using all remaining free space and restarted into OSX. Disk Utility again - deleted the new partition I'd made with Gparted, and finally! Drive shows 250GB.

Link to comment
Share on other sites

 Share

×
×
  • Create New...