20100808 a pleasant surprise partimage and gparted to the rescue - plembo/onemoretech GitHub Wiki

title: A pleasant surprise: partimage and gparted to the rescue link: https://onemoretech.wordpress.com/2010/08/08/a-pleasant-surprise-partimage-and-gparted-to-the-rescue/ author: lembobro description: post_id: 131 created: 2010/08/08 00:38:20 created_gmt: 2010/08/08 00:38:20 comment_status: open post_name: a-pleasant-surprise-partimage-and-gparted-to-the-rescue status: publish post_type: post

A pleasant surprise: partimage and gparted to the rescue

The new Dell laptop here at home took a dive this week. Completely unresponsive to the power button, except for a very low volume whir from the cooling fan. After running the gauntlet of Dell’s support phone tree (as usual the automated system erroneously identified the our hardware as out of warranty when it still has another 9 months to go), we got hooked up with a very nice tech who quickly determined that we needed a full replacement. “Equivalent or better”, or words to that effect.

Now when it comes to laptops I’m nearly as helpless as any other non-tech consumer. Although at one point early on in my IT career I actually serviced laptops as part of the job, I never enjoyed the experience and never felt fully competent. There was also the matter of, as I put it to a colleague yesterday, my “always having screws left over.”

One thing I knew from my desktop support days was that any data on the machine’s hard disk would be gone as soon as it was on its way back to Dell. To make things as simple and safe as possible I would need to back up the disk so any data we cared about could be restored later on.

Since the machine was dead there were really only two options, both of which required temporarily yanking the hard disk from the machine so it could be hooked up to a workstation. The first option was simply to mount the NTFS file systems on the dead computer’s disk and just drag and drop all the files over to a backup drive on my workstation. The other involved using disk imaging software to preserve at least the main O/S and data partition on the disk.

The 2.5 inch SATA disk came out and was plugged into an external hard disk case easily enough. Because my CentOS 5.5 workstation runs the centosplus kernel and the fuse-ntfs-3g packages were already installed, connecting up the external case to the workstation with a USB cable resulted in all 3 partitions on it being mounted.

Over the years I’ve made extensive use of Ghost for imaging Windows systems. There have been a few Unix versions of Ghost published over the years, but to date I hadn’t found one I was really comfortable with.

For the imaging part of this exercise I decided to try partimage, a freely available, open source utility that has been around since 2000.

To run the software all I had to do was yum install the package from Dag’s repository and fire it up in a root terminal session. The instructions for taking the image contained in the basic usage section of the doc were enough to get me going. Within a little more than an hour I had a gzipped binary image of the 140 Gb NTFS partition the applications and data resided on, including the system and user configuration registry hive files.

Before buttoning the laptop back up, I prepared an extra 2.5 inch SATA disk to test restoring the disk partition from the image. I used gparted to partition and format the disk with the FAT32 file system so that it would be recognized by partimage. Once I’d mounted this clean drive, I again invoked partimage, selected the new target partition and ran the restore using the image file. After another hour and a half the imaged NTFS partition was automatically mounted after I unplugged and then replugged in the USB cable to the external drive case. A quick inspection revealed that the image had been fully restored.

While I might be able to restore the image over the hard disk that will come in the new laptop, I’ve always avoided doing that on a Windows system. In this case my current plan is to simply restore as much as I can by a manual file copy from my test external hard disk to various locations on the new disk.

Given the usual shipping times for this sort of thing, I expect that job will pretty much take all of next weekend to complete. All the more reason to try to relax and enjoy what’s left of this one.

Copyright 2004-2019 Phil Lembo