Can I copy a linux installation from a computer to another and expect it to work?
I had a highly customized Debian Lenny install, somehow I had programs (most specifically, MyPaint, but there might be others, I'm in a almost fresh new install in which initially I had only the commmand line) that are not available for Lenny working there, but I'm not being able to make it again in a new install in a new (better) PC. So I have what is possibly the world's most idiot idea, simply copy the root (minus /media, perhaps also /var, but I'm not sure) partition from the old PC to a partition on the new PC, edit grub accordingly, and then I'd have my cherished install back.
In my most optimistic perspective I do not expect it to work perfectly, I'll obviously have to adjust fstab, user directories, and maybe eventually reinstall some packages that may not work in the newer hardware. I'd do some of that from another install I had on the target computer, I already have a partition I can use for the "transplant", I do not need to be as suicidal as to lose my current install on the new PC. But... something like that has the faintest chance of actually working? |
Why don't you use a tool like clonezilla to clone your install and put it on the new machine?
http://clonezilla.org/ |
Providing you're UPgrading, and not DOWNgrading, in the same processor type, then sure it should work. I'm not guaranteeing, just thinking. I've done similar before. Get the 2 drives mounted, let's say on / & /mnt/tmp. Try something like
cp -a /{boot,bin,sbin,var,tmp,usr,lib,lib64,srv} /mnt/tmp && sync mkdir /mnt/tmp/{proc,sys,media,mnt} You had other plans for /home, I gather. If not, put it in the first line above. For things like /var/log, I find it handiest to shorten the files this way > /var/log/messages which makes them zero length, but leaves them there. Then scatter a few subdirs in /mnt, and you should have it copied over. The drivers will be wrong, the kernel might well be wrong, but it should throw up a console, and you can sort things from there. |
You can do that, linux don't ties itself to hardware, as windows do.
To be able to boot in a new system, after copying make chroot in a new system, then install grub. |
Thanks, I'm going to try clonezilla! :D I was already preparing to copy over the net, but I was not being able to do it via konqueror.
Quote:
Quote:
I was trying first to copy over the network with samba/konqueror, from symlinks, but it started asking the password a thousand times, never copying a single file, even though I added the samba user to the "root" group momentarily. Then I tried to first copy the main root partition folders to another disk, which was also having some troubles (maybe due to be running linux from there) and had also a 35 days for estimated time left. :doh: I hope with either clonezilla, a second mount, or something else, I can reduce this time to something viable. Thanks everybody! |
You could try the following:
1) Take the drive out of the old PC and put it in the new PC. 2) Boot the new PC from a LiveCD. 3) Mount the partitions of the old drive. 3) Format the NEW drive. (Wipe the install you already had) Make sure you don't format the wrong drive! (Mounting the old drive is listed first because Linux will refuse to format a mounted partition) 4) Mount the new drive. 5) Copy all the data from the old to the new drives, as root, using the cp command with the -a option. So something like cp -a /mnt/old_drive/ /mnt/new_drive/ (note that the presence of absence of trailing slashes in the paths can cause slight issues, like ending up with everything in a subfolder in the new drive. but that's easy to fix) 6) Attempt to boot. 7) Go back into the LiveCD and fix your settings on the new drive so it can boot. Repeat steps 6 and 7 until you have success. By pulling the old drive physically into the new machine, you avoid the hassle of networking, as well as making things faster. |
I would never recommend anyone to clone to anything but an exact system. Too many variables.
I will agree that is may work but if it doesn't is is a dickens of a time to figure out what went wrong. I tend to use G4U. |
Unfortunately I can't open my new PC, it's under guarantee. I guess I could take the new PC and the old hdd back in the shop where I bought it and ask them to install it, but it does not worth it all. That would be the easiest thing, I could just add the old hdd and leave it there, if the new PC has ide, and not only SATA, I don't even remember.
I couldn't make it with clonezilla. In the attempt I've lost grub, and I'm right now installing a ubuntu in the target partition to restore it (I couldn't install grub itself for some reason, but installs usually manage to do this right). My last attempt will be remastersys, which allegedly turns you debian or ubuntu install into a live CD or DVD, and I guess it is installable also. I don't know if it becomes a "real" install or some Knoppix-like "fake" install. Either way, that will do the job for a while. |
I recommend you look at this.
|
Thanks. The solution, or the closest thing to it ended being in fact remastersys. It worked almost perfectly, the most significant flaw was that it ignores the customized xorg.conf I had. But it will still possibly be useful to try to figure how I did the things I did in my previous linux install (RIP).
Thanks everybody. |
If of any help, I wrote a howto on that:
http://positon.org/clone-a-linux-sys...other-computer |
<deleted>
|
Quote:
Quote:
A machine specific kernel ends up with things built in for chipset, & cpu. Switching amd to intel throws that, as the drivers are different. |
check this out http://www.linuxquestions.org/questi...pc-4175499220/
|
Quote:
|
All times are GMT -5. The time now is 07:15 AM. |