I dual-boot my laptop due to lousy VM performance, and have a new 500GB/7200rpm drive coming in to replace the stock 320GB/5400rpm drive. I have the drive set up in three partitions: one for the Win7 system files, one for storage, and the third as the ext4 Linux file system. The system file and storage partitions are both NTFS.

What I'm planning to do is use the system image creator built in Win7, then move that over to the new drive. However, how can I migrate the Ubuntu partition, and how do I make sure that the Grub bootloader isn't overwritten by the Windows loader?


Solution 1:

Not a huge problem. All you need is a computer which has at least two SATA ports to use both HDDs at the same time. If you don't have an second computer handy, you could do it with on if these SATA to USB adapters but that is painfully slow. May you have an eSATA, USB 3.0 or FireWire port you could use to (\w the appropriate adapter).

When you (re)install your Win7 successfully on the new drive (which is not a good thing in general. Just kidding.) you have to pay attention to the partitioning. The Win7 should only use a part (eg. 180 GB) of your drive and NOT the entire HDD. (If its not possible to set this within the Windows installer you can resize/shrink the partition afterwards via gparted on a live CD/DVD.)

After you have your Win7 in place, use one of these Ubuntu live CDs/DVDs with both your old and your new drive connected to your computer.

Use gparted to set up a partition on your new drive which has exactly the same size as you old Ubuntu partition.

With a simple dd you can then move over the data to your new partition:

dd if=/dev/sda3 of=/dev/sdb3

(Of course you have to change the partition names according to your setup.)

After you did this you can resize the partition with gparted to fit your needs. (Of course you can do this with your data partition as well.)

Solution 2:

Its super simple if you just move over the entire disk to the new drive at once. (I don't know if this causes any problems on the Windows side, but it shouldn't.) Just connect both drives to your computer and run:

dd if=/dev/sda of=/dev/sdb

(Check device names!)

ATTENTION: This process can take for ever. But it works. Do NOT interrupt it. (Google to find out how to check the state of dd.)

After the move is done you can use gparted to resize the partitions to your needs.


If you use the second solution the MBR should be copied automatically. If you want to save it anyhow you can do this via:

dd if=/dev/sda of=MBR bs=446 count=1

(This saves the MBR into a file called "MBR".)

If you then run this you could 're-apply' the MBR to your new drive afterwards.

dd if=MBR of=/dev/sda bs=446 count=1

I hope this helps you somehow. It really sounds more complicated than it actually is. Hit me up if you need more help or have problems.

(Device and partition names (like '/dev/sda/') may change according to your setup.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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