How to Clone a Dying Hard Disk

      This has been a hectic week.  Lot’s of stuff seems to want to go out at the beginning of the year.  First, my clothes-dryer element burned out, after lasting only six months, then a hot water element, that lasted a little over a year, and finally, my computer’s hard drive appears to be on it’s last leg.  Fortunately the hot water element is under a six year warranty, so I was able to call and get an auth. no. from Whirlpool and toddle down to Lowe’s and get a shiny new one freeeeeeee!  The fun part was spending my Friday night draining the heater with a Shopvac® & vacuuming out all the hard well-water deposits and replacing the (bottom) element.  We still had hot water, but just not very much.  I suspect the element failed awhile back, but did not become noticeable until the water became really cold due to Winter.

Cloning my existing hard drive that has both Windows-XP and Linux partitions:

     The hard drive did not completely die, but rather my system had crashed twice within a week resulting in fsck reporting numerous errors, such as lost inodes, chains, and duplicate references even though I shut down my system properly and the file-system (ext3) is journaled.  This tells me the hard drive is starting to go bad, so I did a quick routine backup of recent stuff and purchased a new, larger one right away and cloned it onto the new one (I had figured out how and done it once before a while back).  Fortunately with Linux this is duck-soup simple to do!  I didn’t hesitate to do this, since for one thing, the “dying” drive could become unusable at any time; and, I had been secretly wanting a new, bigger hard drive for Christmas, but had not gotten myself one then, after blowing my wad on a totally awesome new Tamron 90mm macro lens for my cameras (see what it can do)! 😀

     All I needed to do was boot up with a Linux live-CD (so that the existing drive is NOT mounted), connect my new SATA hard-drive up via a hodge-podge cable kit to the USB port and run 2 Linux commands (shown below).  The only requirement is that the new drive be as big or bigger than the drive to be cloned.  NOTE: The “device-ids” will be something like “hda” (/dev/hda) or “sdb” (/dev/sdb), or something similar, just make sure you know (use gparted or qtparted on your live-CD, or something similar to make sure if in doubt!)

WARNING: MAKE *CERTAIN* YOUR EXISTING DRIVE DEVICE-ID IS THE *FIRST* ARGUMENT TO ddrescue() ELSE YOU WILL WIPE YOUR EXISTING DRIVE!  He does NOT ask you if you are SURE!!!!!

     The 2 commands (run as sudo/root in a terminal) are:  (Don’t let the terminal scare you & please don’t ask me for a GUI interface!)

cfdisk -z /dev/<your-NEW-disk-device-id>      #This makes sure an empty partition table exists, I believe.
ddrescue -v /dev/<your-OLD-disk-device-id> /dev/<your-NEW-disk-device-id>      #This clones your disk.

     The second command will take awhile, so make sure your computer is on reliable A/C power (no thunderstorms nearby), and be ready to go off and do something non-computer geek-ish – I replaced my hot water heater element, lol.  For cloning a/b 230 gig of data, the second command took me about 2 hours.

     I then created logical ext4 partitions in the extra space in preparation for a fresh Linux upgrade install (when I have time), since I will want my current, WORKING, uber-customized Linux install to exist concurrently with the new install for a while until I get everything copied over and customized into a usable state! 😉  My plan is to eventually remove the old partitions and resize the new ones to include the space now occupied by the current ones, but, no hurry there because I have plenty of space for all of them.

     My one concern was how badly Windows-XP, on the first partition, would squawk thinking it was now on a different computer, which last time required me to “re-register” it online with Micro$oft using the sixteen-digit hex product code on the sticker underneath my computer.  This time, Windows booted up without a hitch, yay, which allowed me to fix the one hiccup that did occur – my system clock (local time) on the Linux side was an hour off, but I remember from past experience that booting Windows once will rectify this and it did!

     I’m now enjoying a new, faster, bigger, quieter hard disk – ymmv!

Advertisements

One Comment

  1. Posted March 7, 2012 at 4:48 pm | Permalink | Reply

    thanks for your guide, I will now go and read a greek book so as to refresh my mind a little

Feel Free to Comment (Name/Email/Website optional):

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: