Home » Questions » Computers [ Ask a new question ]

How can I duplicate my Linux environment if I am migrating to different hardware?

How can I duplicate my Linux environment if I am migrating to different hardware?

I currently have packages, modules, settings, etc. for Eclipse, MySQL, Python, Firefox, etc. set up on Kubuntu. I have also optimally configured Kubuntu for my needs. I would like to duplicate my environment on another machine that has a different processor (currently on an Intel Q9450, the new processor is an i7). As I understand, my applications are compiled for use with my specific processor, so making a straight partition copy is out of the question.

Asked by: Guest | Views: 309
Total answers/comments: 3
Guest [Entry]

"As I understand, my applications are compiled for use with my specific processor, so making a straight partition copy is out of the question.

What leads you to this conclusion? At least for x86, the packages installed by Kubuntu are compiled to run on practically all non-prehistoric CPUs. I believe they will run on anything newer than a 486, which probably does not pose a problem in your case :-).

So a straight partition copy should work just fine:

copy partitions (or just copy the files using cp -a , if your partition layout changed)
adapt /etc/fstab to new partition layout
reconfigure bootloader for new partitions, and reinstall bootloader
boot & enjoy

Problems are only to be expected for:

self-compiled packages, but even there, most will by default compile for all modern CPUs, unless you play with compiler options
device drivers

Most modern kernels autodetect hw on boot, so usually even drivers should be ok, but if things fail, you can usually boot in single-user mode and fix any driver issues."
Guest [Entry]

You can backup your home, and restore it to the other machine. This cannot fully fulfill your need, but it will restore all the configuration. You have to reinstall the packages yourself, though.
Guest [Entry]

"Hmm. If you don't mind a bit of fiddling you could plug the new HDD into your box, mount it then use dd.
For example, if your current root is set to /dev/sda3 and you mounted the new HDD to /dev/sdb2 you would use

dd if=/dev/sda3 of=/dev/sdb2

You'll need to do that as root, of course. After that you'll be wanting to install Grub, so you need to put an Ubuntu LiveCD in and use that.

Or you could take a look at this link: http://www.ehow.com/how_4924091_clone-hard-drive-linux.html - It looks like a pretty good walk through for cloning a Linux hard drive, though I haven't tested that site out myself."