Ubuntu – Cloning dual boot drive

dddual-boot

I would like to make an exact copy of my old 250 gb HDD (not installed), and clone to a new 240 gb SSD (installed).

The old HDD is dual booted with equal partition scheme, rEFIt booting OSX Snow Leopard/Ubuntu 12.10.

Would I be better off cloning to an external drive then restoring the image from external to internal drive (requiring internal drive swap)? Or is there a way I could boot from the old HDD via usb then format and restore the installed SSD with the HDD image from within disk utility? The machine is a 2009 macbook with OSX Mavericks installed.

Any advice would be appreciated!

Best Answer

The "simplest" way to clone one drive to another in your scenario.

is to boot of an ubuntu live cd is to have both drives connected in your computer and booting of a usb stick.

Once the live cd has started In the terminal type:

cat /proc/partitions

check witch drive is the new and witch is the old one

it should be /dev/sda , /dev/sdb (you should be able to tell by checking the size reported for each drive which is wich)

sudo dd if=/dev/sda of=/dev/sdb bs=1024

where in my example sda is the original drive you want to copy FROM and sdb is the new drive you want to copy TO.

This will take a while since it will copy the ENTIRE drive, even if data isn't being used

This procedure is operating system agnostic meaning that it will always work no matter what filesystem(s) or partitions exist on the original drive.

I've used this to in the simplest possible way move my tripple boot configuration (Windows 7, OsX, Ubuntu) to a new bigger SSD disk.

In your scenario though there is ONE problem. your source drive is bigger then your destination drive. Since dd will just read everything from drive a and copy it to drive b it will fail to copy all data.

Hence you need to re size your original drives last partition to be a bit smaller than your new HD.

If it is the OSX partition that occupies the last space on your drive use diskutil in osX to shrink it.

if it is the Windows partition, you can use gparted since it has resize support for NTFS.

Id shrink it 5-10gig or so to get some margins

In another scenario (perhaps just Ubuntu / Windows) i would recommend using [clonezilla] but the OSX filesystem HFS is porly supported in Linux1.

Related Question