Posts tagged: Gparted

Hard Drive Upgrade

By Johnny, September 23, 2007 5:46 pm

I got my Seagate 160GB laptop hard drive on Friday in the mail. Needless to say I was looking forward to bump my storage needs from a maxed out 25GB factory drive. I bought the drive refurbished from Computer Geeks online. It cost me about $100 which was alot cheaper than many of newer drives out there even in eBay. What began as a task that I was looking forward to in the week, finally ended now at Sunday evening. Copying a hard drive may seem to be a trivial task, since many people would just reformat and reinstall the operating system and all your software. I didn’t want to do that. I wanted to retain the same exact settings from my previous hard drive and did not want to go through reinstalling. I hate starting over when I don’t have to.

Back when I first worked as a System Administrator, I use to configure and build out similar laptops by first installing and setup 1 laptop with the exact software and settings required. I would then use, at the time, Norton Ghost to image the entire hard drive and saved the image on a server somewhere on our network and then use that image to duplicate on laptops with the same hardware. It was the coolest thing back then and would save alot of time versus setting up and installing manually. I did a quick Google search for “free hard drive cloning” which yielded several references to 2 free Linux-based solutions: Gparted and Partimage. They were both part of a live CD called SystemRescueCD. You use Gparted to setup your new hard drive’s partition and use Partimage to clone and restore a partition.

I could go through the excruciating tasks I had to endure but I’ll save that pain and give you a brief summary of what worked for me.

  1. Cloned all three of my partitions from my smaller hard drive to my Linux file server. I did this by booting up the live CD and issuing the following commands:

    mkdir /mnt/samba

    mount -t smbfs -o username:johnny //192.168.0.xxx/johnny /mnt/samba

    partimage -z1 /dev/hda1 /mnt/samba/location/to/image/folder/clonefilename.gz

    I had to turn on DHCP on the rescuecd start-up prompt by executing the command rescuecd dodhcp

  2. Physically installed my new hard drive.
  3. Executed the following command at the start-up prompt:
    rescuecd dodhcp dostartx This started the X-Windows with a valid network connection.
  4. I then used Gparted to partition all my partitions exactly the same as my previous hard drive. This step is important since I actually jumped the gun and partitioned the main boot drive to fill-up the disc’s maximum capacity. This rendered the partition unreadable from Windows XP. It only saw the original 25GB and not the 140GB. I also turned on the “boot” flag for the main partition that had Windows XP and turned the “hidden” flag on the other 2 partitions that wasn’t there in my original drive.
  5. I then started the x-term window and executed the command: partimage restore /dev/hda1 /mnt/samba/location/to/image/folder/clonefilename.gz.000. I did this for each 3 partitions.
  6. After all my data was restored, I rebooted the system into Windows XP.
  7. Windows XP sees the new drive and ask to reboot the system once again after it automatically installed the drive.
  8. I reboot again into SystemRescueCD and ran the previous command to start X-windows and DHCP.
  9. I opened up Gparted and chose to resize my partition from 25GB to the remaining unallocated disk space.
  10. I rebooted to XP again.
  11. XP automatically jumped into CHKDSK mode and revalidated the hard drive space.
  12. XP then boots into the operating system and finds the new hard drive. I then asked for me to reboot my system once again. I obliged.
  13. Voila! My new C: drive is now 140GB.

I probably left out alot of details but the general idea is captured here. I tried so many ways of setting this up which included an attempt to use 1 large partition, setting up a larger partition for the boot partition, etc. All this did was give me blank screens with a flashing prompt. I was never able to boot-up using the other methods. But when I finally followed the steps above, I was successful.

Just a bit of a warning. I’ve been using Linux for over 8 years now so I know my way around the operating system. Doing this requires alot of patience. Hopefully I did most of the grunt work for those who stumble upon this post to use.

My laptop is a Dell Inspiron 8600. The other 2 partitions are backup crap that Dell installs with every new laptop. I tried so hard to not include them in my new hard drive. Unfortunately, I was not able to do that. C’est la vie.

Panorama Theme by Themocracy