Move Hard Drive From One Computer To Another


by AndrzejL

Due to a hardware failure I had to say goodbye, (I think permanently, this time), to one of my fave machines. I have a spare one, so I am not going to cry over it. But what got me worried for a moment was whether I would be able to get my data / installation from the old machine to the new one. In the past, when I was moving from one machine to another, I was just reinstalling fresh with my latest remaster.

This time, however, I was moving an hdd from an AMD based machine to an Intel based machine. The hdd had an installation that was running on the a64 kernel. Intel will not run well with an a64 kernel, I thought. I was right. The first thing I noticed was an hdd timeout, (due to different modules/architecture). And, soon after, a kernel panic followed. Yeah, that went well, I thought.

The remaster was made with an a64 kernel, too. So, that idea was as good as… I didn’t want to lose all my data or to spend a great deal of time reinstalling from scratch. I had too many customized settings on this installation. So, I thought for a while, and I recalled a great post by a good friend of mine, Old-Polack on the PCLinuxOS forum.

With the hdd in the machine, I booted the computer with PCLinuxOS 2011.6 KDE4 LiveCD and chose Console from the grub options. Then I logged in as root using password root.

Then I issued the following commands:

mkdir /here

mount /dev/sdaX /here (In my case it was sda1)

mount -o bind /proc /here/proc

mount -o bind /sys /here/sys

chroot /here

service network start

apt-get update

apt-get install kernel-2.6.38.8-pclos1.bfs

This basically means that I changed the root point of the filesystem from the LiveCD to my hdd installation, started a network connection there and installed a BFS kernel. After this was done, I pressed the power button and allowed the machine to power-off slowly.

Then I booted the machine from the HDD installation, but I chose the BFS kernel entry from the grub boot screen, which now appeared there and was ready to be used. After a while of waiting for the modules to compile, I was able to boot the machine into the KDE4 desktop.

I redid my xserver, sound, cpufreq and grub (defaulted to BFS kernel) settings, and I was good to go. All my stuff was still there, but in a new machine, and without reinstalling…

Now you can use this method to reinstall kernel / upgrade kernel / install apps / change settings, and so on, if booting from the HDD installation fails.

Awesome trick. Thanks Old-Polack.

Now can someone please tell me how to do the same thing under Windows without the BSOD??? Not that I need it … I was just pointing out another Linux advantage.