Using dd from Knoppix to Upgrade a Laptop Hard Disk



Upgrading a Laptop Hard Drive is a special case. One needs to work with a laptop and its lack of IDE/SATA channels that would normally be used to mirror a drive. Things are usually easier when you're working with a big desktop, but quite workable with a laptop if you're patient.

Now, I'll outline how I was able to upgrade my hard drive from a 4200RPM unit to a 7200RPM unit, while keeping all my data, OS and programs. My drives were the same size, but the same steps should be usable for upgrading to a larger/bigger drive with one extra step.

This guide is really for the lightly to moderately-experienced linux/unix user.

I kept my old hard drive in the laptop's hard drive bay and put my new (to me) drive in an external USB enclosure (a firewire enclosure could be used as well). I used knoppix to load another operating system, so that the laptop's on-board hard drive could be used as a source drive. Other bootable linux distributions with dd could be used (which should be most of them) Keep in mind that you can't mirror a drive you are booting from, so using some kind of other bootable OS was necessary.

Once Knoppix booted and auto-configured all my hardware, as well as located my USB drive, I opened up a shell. I was sure to NOT mount any drives. Knoppix will detect them, but it will only mount them once you double-click on them, so don't do that :). In the console, use "su" to get into superuser.

Remember, you want to copy the entire drive at a low level (which dd excels at), not the individual partitions, but everything we can including the MBR and such. Therefore, we'll refer to the devices (eg: /dev/hda), rather than partitions (eg: /dev/hda1).

The command I used was:

dd if=/dev/hda of=/dev/sda bs=32768 conv=noerror,sync

The conv=noerror command/switch means that dd will ignore any read errors from the source drive. I knew my source drive had a few bad sectors, so this was a necessary command. I'd recommend using it, so as to not have your cloning process get interrupted in the middle of the night.

The conv=sync command/switch will ensure that when the source has a bad sector, that everything will still be synchronized on the destination. I believe dd fills the bad data with 0s.

bs=32768 sets the block size to 32768 bytes. If this isn't set, dd will default to 512 bytes, which will take a heck of a lot longer. Feel free to set the block size even higher if you like (dd accepts kB for 1024, K for 1000, MB for 1000000 bytes).

BE ABSOLUTELY SURE THAT YOU HAVE SELECTED THE CORRECT "if=____" (Input/Source) and "of=______" (Output/Destination) !!! Once you press enter, dd will start, it does NOT ask any "Are you sure you want to _____?" questions. Be careful!!!

The dd in Knoppix 4.2 (yes, I know, an old version) isn't particularly verbose. It only reports the speed at which its working when the process ends/finishes. You could interrupt the process after a few minutes using ctrl-c to see what the speed is, tweak it, and then start over again to get an idea of the speed. If you used the conv=noerror switch, everytime it hits an error, it will report how many blocks it just transferred and the rate. Rumour has it new versions report more information as it goes along.

My speed was around 1 megabyte per second, which indicated to me that my USB drive was running at USB1.x speeds. Chances are a more recent update of Knoppix would run at the appropriate speed. I was prepared to be a bit patient, 40gigs at 1meg/sec would take a while, but at least I could just leave it to run.

If you are upgrading to a higher-capacity drive, then you could use a program such as Partition Magic for Windows, or Qtparted, which is included with many knoppix distributions to make the partition size bigger.

It should go without saying, but it is a good idea to backup your data before you try to do anything that involves it, and all commands are run at your own risk. I mitigated all my risk by copying all my data to another external drive first, so if I did hose everything, I'd just have to reinstall my OS and my programs.

bigger harddrive

What is the "one extra step" to increase the harddrive size?

OK, looks like I seem to not

OK, looks like I seem to not be having too much success with my own guide, but I think its just because my source drive is increasingly broken. This is despite that it should be working according to everything I've read and been recommended. I imagine that one of the drives is having issues.

Why must my Asus M6Ne have troubles with working with USB2.0 and stay stuck in USB1.x mode? And why must the Asus M6Ne seem to be sold in every country except English speaking ones? Its mostly a very good product really.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <p> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options