Move OS from one drive to another

Posted on

Problem :

I have elementary OS(based on Ubuntu 14.04) installed on my Laptop. I wish to install Windows 10 on my laptop’s primary hard disk. I have another external hard disk which I want to use for elementary OS.

I don’t wish to loose any data. How would I move Elementary OS on that external hard disk. I still want to make that external drive bootable.

So I can boot from that hard drive when ever I wish to use Elementary OS and Windows

Solution :

Then you’ll have to clone the whole disk (the primary one, where you currently have elementary OS) into the external disk.

I’ve always done this with a live USB/CD, so that’s what I recommend you to use. Otherwise, the results may be unexpected (thanks @Xen2050 for the heads-up!).

NOTE: This will delete all data on your external HDD.
Also, a backup of your main disk is strongly encouraged.

  1. Identify the /dev/sdX path of both your main and external drives:

    $ sudo fdisk -l
    
  2. Do the cloning using dd:

    $ dd if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync
    

    Replacing sdX with your primary disk, and sdY with the external one. Be very sure of that you’re writing them correctly, or you could delete/overwrite important stuff!

    The additional parameters (bs and conv) are the recommended ones by Arch Linux’s wiki, you can find more information on what they mean there.

  3. Install Windows on your main drive. Feel free to delete all the stuff in it, it should be in your external disk now (though I’d insistently recommend you to check it before, by trying to boot from the external HDD before doing any deletion).

Without knowing your exact setup, I’d do the following:

  • backup any data on your external drive
  • make a clone of your internal drive to your external drive
  • remove anything you don’t want on your cloned external drive

If you’re not familiar with cloning a drive, there are a number of paid and free utilities for doing this. Some free options are:

Note: The above approach assumes your external drive is at least as large as your internal one.

Hope this helps. Good luck.

Leave a Reply

Your email address will not be published. Required fields are marked *