Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a USB flash drive with Ubuntu 11.10 installed that I would like to use for the following task:

I have a hard drive with 4 partitions. The second one is formatted with NTFS and contains a fully functional Windows installation. I would like to copy that second partition to another physical hard drive (which is empty).

There's a catch however - I cannot have both hard drives physically connected to the computer at the same time. I have a third external hard drive however that will remain connected throughout the entire operation and has more than double the space of both of the other hard drives.

I realize there are a lot of things to consider here:

  • The process will obviously involve making some sort of "image" of the second partition, storing it on the external drive, and then copying the image to the new drive.

  • The partition that I am copying is bootable and should also be bootable when copied to the new drive. I can probably fix the MBR on the partition afterward if need be.

  • The old and new drives are not identical in make, model, or size. However, there is ample room for the second partition on the new drive.

Any advice on how to proceed or warnings for possible pitfalls would be greatly appreciated. Also, if I missed an important detail, please don't hesitate to ask for it.

share|improve this question
    
Added some sort of guide bellow, let me know if I read your requests wrong ;) gl –  Bruno Pereira Apr 7 '12 at 19:57
add comment

2 Answers 2

up vote 5 down vote accepted

(No extra software required, use the tools you have)


dd if=/dev/sda of=foo_file.img will create an exact replica of sda to a .img file that you specify.

Save it to an external device and restore it with dd if=foo_file.img of=/dev/sda.

Step by step

  1. Boot from the Ubuntu LiveCD and open the disk management tool (or use sudo fdisk -l from the terminal) to find out which disk you will be copying.

  2. Mount the external device you will save the .img file to, do not mount the disk you want to make the image from!

  3. Use dd if=/dev/sda of=foo_file.img, replace /dev/sda with the actual disk you want to copy and foo_image.img with a file located in the external disk you previously mounted.

  4. Reboot your PC removing the disk you made the image from and install the new disk in your PC. Boot the computer with the Ubuntu LiveCD.

  5. Mount the external disk that contains the .img file and open the disk tool to make sure about the device where we are going to write it to. (Probably will be using the same device path as the one you just removed). Don't even try to mount the new disk, there should be nothing to mount anyways!

  6. Use dd if=foo_file.img of=/dev/sda to write the image you created and stored in to the external device in to the new disk you just installed.

  7. Run gparted and resize your newly created partitions to accommodate the extra space in your new disk.

  8. Reboot and boot using your new disk.

After this is done you can keep the .img file as a backup till you make sure that everything is running.

I have used this method oh so many times now and not an issue, but you never know. Keep a backup around for some time.

share|improve this answer
    
Yeah, I can always revert to the original drive if something goes wrong. –  Nathan Osman Apr 7 '12 at 20:46
    
That also, I'm just a freak when handling data. Ignore anything that you do find absolutely necessary ;) –  Bruno Pereira Apr 7 '12 at 20:51
add comment

Clonezilla - clonezilla.org

A free software disaster recovery, disk cloning and deployment solution. Allows a user to clone an individual machine or many computers ...

share|improve this answer
2  
But how do I use Clonezilla to accomplish the above goals? Also, Clonezilla doesn't appear to be included in the archive, so installation instructions would be helpful too :) –  Nathan Osman Apr 7 '12 at 19:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.