November 09, 2010

Using GParted to clone a disc

By The Computer Doctor

So today's project, I am in VirtualBox like always and am working with an XP virtual machine that I use to test ideas (instead of bricking my machine and making my IT guys upset)...

Let me take a moment to pontificate on this last aside. You you may be able to upset your boss a few times and get away with it, you can upset your co-workers on a daily basis and get away with it, you can flip off the truck driver on the way to work and probably get away with it, but you can't continually upset the IT guy and get away with it... they have tricks... like ninjas... they'll get you.


Anyway, so my original XP virtual hard disk is 20 GB in size and I quickly find that although that is enough to get you through to SP2 and an Office install, it is going to run out of space soon with SP3 and a few useful programs. So what I want to do is expand this virtual hard drive to about 70 GB. Unfortunately, neither Sun nor Oracle have created this option to easily help us out, so I had the idea to just clone the drive from one hard drive and restore it to another.

Problems: If I use a straight up cloning software like Ghost or Clonezilla not only will I save the data, but the partition size as well and will have to manually resize the partition when finished anyway.

Solution: If I use GParted I can format and size partitions as well as copy and paste existing partitions.

Here's my step by step directions on how I proceeded.


1. Verify that your existing partition, in my case sda1, is showing up in GParted.























2. Find the second "target" partition, in my case this is sdb1, and create a new partition table























3. After you create your partition table you should see the whole disc as unallocated space as shown.























4. Now back on the source drive, my example is sda1, you want to right click on the partition and choose copy























5. Back on the target disc, my example uses sdb1, you need to paste the source partition and your screen should look as follows























6. Now click apply and be prepared to wait... a long long time























7. When the copy is done you will see a message as follows























8. Now on the new drive you want to resize it's partition to take up the rest of the unallocated space























9. Now unhook your original hard drive and make your new hard drive the master and reboot your machine.

10. The last step is to fix the MBR (master boot record). I had hoped that the original MBR would be copied, but no such luck. The easiest way to fix the MBR is to boot up to the recovery console and execute FIXMBR. I actually used the Hirens Boot CD and used mini XP and executed mbr 0 /install std to install a standard MBR to my drive.

SHOW STOPPERS
  • Forgetting to disconnect the old hard drive will cause a failure and possible data loss. Windows can not support a second windows.
  • Formatting your new hard drive to NTFS and then pasting your partition from the original may not work. For best results just paste your partition to unallocated space.
  • Not shutting down Windows correctly on the original hard drive before trying to copy will fail every time.
Other than those few hangups, you should now have your new larger hard drive booting up your operating system.
Enhanced by Zemanta

No comments:

Hex Converter

Hex To ASCII Converter

Hex:
Ascii:

 

Integer to Byte converter


This is a tool to practice converting between decimal and binary representations. After you have practiced for a while and feel that you know how to do the conversions, take the quiz.
Decimal number to convert:
Binary representation:


Binary number to convert:
Decimal representation: