Moved every bit of laptop's disk to a much bigger disk
My dear old Dell laptop has served me well over the years. At the time the hard drive was average, I’d guess. 30 GB total. Of course today that’s rather small and the poor thing was getting close to full, with a few too many “C: drive nearly full” messages popping up.
So what to do? The rest of it is fine.
I decided to buy a replacement hard disk. For like $77 I got a brand name 160 GB laptop IDE drive.
Rather than start again (copy all my data to a spare disk or PC, install the new disk, install Windows XP and all the drivers and updates and applications and fixes and settings and and and), I went for the uber-geek approach: clone the current hard drive, every bit of it, over to the new drive. And I did it with (legally) free software.
Technically I copied three things:
- The partition table (tiny)
- The boot record (tiny)
- The NTFS partition itself (big, the C: drive itself)
The Basic Steps
I may give the step-by-step instructions in another post, but the executive summary goes like this:
- Booted the Laptop with a Live CD of Linux. I used Knoppix, a Linux distribution, in basic Command Line mode (Mode 2). This boots a fantastic, powerful operating system, but it itself does not write to the hard drives, i.e. it totally runs in RAM. However, Knoppix can still ‘see’ the Laptop’s hardware, including the hard drive….it can even copy and write to it (!). Windows cannot copy itself to a new drive, whilst active.
- Configured Knoppix for networking on my LAN
- On my main Linux (Debian) PC configured the NFS server, enabling the Knoppix Laptop to ‘directly’ copy files to it
- Copied the above 3 items over using Knoppix commands:
- Partition Table (using sfdisk)
- Boot Record (via dd)
- The NTFS parition (using ntfsclone)
For more on these last few steps, I used this site and this one for ntfsclone.
If we stop and look now, I have a complete, bit-perfect image of the laptop’s hard drive – it only had one, the C: disk – stored on an external system, my Debian Linux PC.
Now it was time to replace the hard drive with the new one and reverse the process:
- Following the Dell Manual, I removed the Laptop’s hard drive and put in the new one and restarted the Laptop. The system found it, but – naturally – got an error saying it couldn’t boot from it.
- So I booted the Laptop via the Knoppix CD and it too found the new drive; even reporting it as 160 GB. Sweet.
- Using sfdisk, dd and ntsfclone I copied the ‘image’ files back from the Debian PC, via the LAN, to the new, empty 160 GB disk in the Laptop.
The laptop booted first time into XP with all my data and settings there just fine. Not a single error message!
Grow grow grow
As it was literally a bit copy, the Laptop happily reported a C: drive of 30 GB. And 130 GB unused. Not available as such, not as a D: drive…just sitting there empty.
Easy to fix, simply ‘grow’ the C: drive. Again some (legally) free software called Gparted to the rescue. Booted with that and via a GUI just dragged the size of the C: disk (technically the NTFS Partition) from 30 GB to 120 GB. I wanted to leave a bit free for something else later on, beyond the scope of this Post.
It took a few minutes to do this. When I rebooted, XP correctly saw the disk had changed size and ran some (quick) tests on it. Another reboot and there it is. My C: drive is now 120 GB and all my original data, programs, settings etc are still there.
Some things I learned
I didn’t know, but my Dell IDE drive had an adapter over most of the IDE connectors. This really confused me as the manual didn’t mention it. Hence the new drive and old drive had different physical plugs and the new one wouldn’t initially work; the new drive didn’t ship with said adapter. In semi desperation I just tugged at the current drive’s connectors and the adapter slipped off. Hence I learned of its existence 🙂
The first time I’ve used NFS and it was easy to use, but wasn’t very fast at all. Could be that the LAN adapters – at one or both ends – were only running at 100 MB, not 1000 MB.
I may have been able to directly copy the data from the old drive to the new drive, in situ. If I’d known about the IDE adapter thing and had a spare adapter. I have a IDE-to-USB2 adapter and it may have worked.
All in all, very happy indeed. Not something for the feint hearted, but I reckon it saved me hours, if not days of work.