How-To Clone your Hard drive using Gparted
Hello, This is my first “How-To” so go easy on me , It is also written be easily understandable to beginners, so if I'm insulting your vast technical capabilities with my simplified instructions, this “How-To” probably isn't for you : P
I decided to write this guide after deciding to replace my old 30gb Harddrive, with a new 200gb harddrive. Its is a dual-boot between Dapper & XP, but this should work regardless of OS's. Cloning or “disk imaging” is superior to re installation as you get to keep all your settings and installed apps (plus you wont need to reactivate Windows and spend 5 hours downloading security updates from Micro soft, and sitting through a dozen reboots.) Searching around the forums here, and elsewhere, I have not come across an easier more intuitive method than the one I'm going to cover here. This guide makes a few assumptions that are necessary to use this method.
1.You have access to a computer that will support multiple hardrives, and IDE cabling.
2.You are comfortable playing with BIOS harddrive detection settings, and jumper settings on the harddrive(s).
3.You will also need to download and burn an ISO of Gparted Live bootable cd, available for download here; http://sourceforge.net/project/showf...kage_id=173828
***Note; You may be able to just use the Ubuntu Live CD version of Gparted, but I have not tried it.
4.You have backed-up anything you cant afford to loose before beginning. Any time you muck around with partitions, there is always a chance that due to some unforeseen bug, or user error you can hose your install and loose everything!
5.You have a Ubuntu live CD handy, as you will most likely need to reinstall grub at the procedures end.
OK, the first step is to install the new drive as a slave drive into the appropriate bay in your box. Jumper settings vary from manufacturer to manufacturer, but make sure the drive is set to slave, and in the slave position on the IDE cabling. Always remove the power cord and ground yourself before accessing your computer innards. Next, boot into BIOS and auto-detect the new slave drive. Don't worry too much if the BIOS does not detect the correct sized slave drive. This is fairly common on older BIOS's , as long as it does detect there is a drive installed as slave you should be alright. My 200 gb drive was recognized as 137gb by the BIOS, but Gparted did not have any difficulty detecting the correct size.
Now that both drives are installed power up the box, and enter BIOS settings. Normally F12 or something like that. It varies between manufactures, so youll have to watch at power on. Now you want to auto detect the new slave drive and make sure that it is “seen” by the systems BIOS. As well as ensuring that the BIOS is enabled to bot from cd first.
Unless you have special needs or something is not detected right, you can pretty much keep hitting enter thru the various choices of gpartrd, as settings such as keyboard , screen resolution, etc are normally detected right. Soon you should arrive at the screen in which you can view your current partitioning scheme on the disk you are planning to clone.
A drop down arrow in top right hand corner should toggle between the current disk /dev/hda and your target disk /dev/hdb. Switch to /dev/hdb and ensure the size has been correctly detected and delete any existing partitions on this disk (/dev/hdb!) if it is not a new disk.
Now switch back to /dev/hda and copy first partition. Just click on selected partition and choose copy. Switch over to /dev/hdb, and paste the first partition into the unallocated space. At this point you may resize the new partition to whatever size you desire, either through dragging the edge of the partition window, or by manually entering the size in the window beneath. Repeat this step as needed until all partitions are copied over, arranged and sized to your liking. Don't forget to leave some room at the disks end for swap.
Click apply after the pasted preview of new partitions looks good, sit back and let copy process even error checks for file system errors and attempts to fix any if found, the ext3 file system is pretty robust, and I don't know that Ive ever encountered and file system errors.
Once the file system check is completed the actual copying/cloning process will begin, This make take some time depending on system resources available, and the sheer amount of data being copied.
If you click on the details arrow you can watch the new partitions being created, optimal blocksize determined, followed by the transfer of data, once the operation is complete Gparted will begin a file integrity check of the new ext2/ ext 3 File system.
Note; NTFS file systems will not be error checked, as I believe Gparted lacks the ability to "see" inside the partition an merely copies the image whole. Next time windows is booted on the new cloned drive, chkdisk will most likely start after boot in protest to such callous treatment. I have used this method several times now and I have yet to see chkdisk find any bad sectors etc from this process
All right, Nothings Blown up so far? Good : ) There may be an error about being unable to verify the contents of the NTFS partition, but we can safely ignore that. As long as all operations completed, we should be good to go. The next step is to remove the cloned drive. Make sure and set the jumper back to Master before reinstalling the new drive into the machine, or BIOS will not auto-detect it.
Run Auto-detect and you should see the new drive, as Master. If the BIOS does not properly detect the new size of the hard drive you may have to manually enter the information, Normally found on the top of the drive (if you have an older machine, you may consider jotting this info down before installing the new drive to save yourself the trouble of pulling it back out to get this information, if you suspect theres is going to be an issue with auto-detect)
OK, the moment of truth is upon us.....We boot up and ..Nothing?? All you have now is a black screen with a blinking cursor? Fear not, You have your Ubuntu Live cd, right?
The problem here is the Computer cant find grub. To fix this we just need to reinstall grub.
For this section of the tutorial I'm going to borrow (aka cut 'n paste) from an outstanding grub how-to by catlett. The thread in its entirety can be found here; http://www.ubuntuforums.org/showthread.php?t=224351
Boot the Ubuntu live CD, once you reach the desktop, open a terminal
This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands
This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)
Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)
Next enter the command to install grub to the mbr
Finally exit the grub shell
That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup, and should be able to boot into your new cloned drive! I have successfully used this method to clone drives various times, and only had it fail once, with an I/O error. I kinda think that was from not putting the side of the case back on which alters the airflow path across the CPU, and got it too hot.
I am still kind of a "gn00b" myself, and if anyone has any revisions or suggestions, I will be happy to revise this.