LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 02-12-2010, 09:20 AM   #1
the dsc
Member
 
Registered: May 2009
Distribution: Debian
Posts: 136
Blog Entries: 74

Rep: Reputation: 33
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?

Last edited by the dsc; 02-12-2010 at 09:22 AM.
 
Old 02-12-2010, 09:38 AM   #2
reed9
Member
 
Registered: Jan 2009
Location: Boston, MA
Distribution: Arch Linux
Posts: 653

Rep: Reputation: 142Reputation: 142
Why don't you use a tool like clonezilla to clone your install and put it on the new machine?
http://clonezilla.org/
 
1 members found this post helpful.
Old 02-12-2010, 09:53 AM   #3
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,612

Rep: Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584
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.
 
1 members found this post helpful.
Old 02-12-2010, 10:08 AM   #4
Samotnik
Member
 
Registered: Jun 2006
Location: Belarus
Distribution: Debian GNU/Linux testing/unstable
Posts: 471

Rep: Reputation: 40
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.
 
1 members found this post helpful.
Old 02-12-2010, 10:31 AM   #5
the dsc
Member
 
Registered: May 2009
Distribution: Debian
Posts: 136
Blog Entries: 74

Original Poster
Rep: Reputation: 33
Thanks, I'm going to try clonezilla! I was already preparing to copy over the net, but I was not being able to do it via konqueror.


Quote:
Originally Posted by business_kid View Post
Providing you're UPgrading, and not DOWNgrading, in the same processor type, then sure it should work.
By "same processor type" you mean, something where I would use a i386 base install, rather than power pc or some other thing?


Quote:
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.
Home is already backed up. I didn't thought of making a second mount of root, I guess it will, (or would, since I'm going to try clonezilla) help a lot.

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.

I hope with either clonezilla, a second mount, or something else, I can reduce this time to something viable.

Thanks everybody!

Last edited by the dsc; 02-12-2010 at 10:32 AM. Reason: tag
 
Old 02-12-2010, 03:02 PM   #6
cantab
Member
 
Registered: Oct 2009
Location: England
Distribution: *buntu, Vector
Posts: 499

Rep: Reputation: 102Reputation: 102
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.
 
1 members found this post helpful.
Old 02-12-2010, 04:07 PM   #7
jefro
Guru
 
Registered: Mar 2008
Posts: 12,078

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
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.
 
1 members found this post helpful.
Old 02-12-2010, 05:31 PM   #8
the dsc
Member
 
Registered: May 2009
Distribution: Debian
Posts: 136
Blog Entries: 74

Original Poster
Rep: Reputation: 33
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.
 
Old 02-12-2010, 06:38 PM   #9
Bratmon
Member
 
Registered: Jul 2009
Location: 75.126.162.205:80
Distribution: Arch / Mint 17
Posts: 297
Blog Entries: 3

Rep: Reputation: 50
I recommend you look at this.
 
1 members found this post helpful.
Old 02-13-2010, 09:07 PM   #10
the dsc
Member
 
Registered: May 2009
Distribution: Debian
Posts: 136
Blog Entries: 74

Original Poster
Rep: Reputation: 33
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.
 
Old 04-06-2014, 01:26 PM   #11
dooblem2
LQ Newbie
 
Registered: Apr 2014
Posts: 5

Rep: Reputation: Disabled
If of any help, I wrote a howto on that:
http://positon.org/clone-a-linux-sys...other-computer
 
Old 04-06-2014, 07:02 PM   #12
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 314

Rep: Reputation: 23
<deleted>
 
Old 04-07-2014, 03:39 AM   #13
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,612

Rep: Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584
Quote:
Originally Posted by Business_Kid
Providing you're UPgrading, and not DOWNgrading, in the same processor type, then sure it should work.
Quote:
By "same processor type" you mean, something where I would use a i386 base install, rather than power pc or some other thing?
Never spotted that: I meant same as in ppc to ppc, intel to intel, or amd to amd.

A machine specific kernel ends up with things built in for chipset, & cpu. Switching amd to intel throws that, as the drivers are different.
 
Old 04-07-2014, 03:57 AM   #14
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 2,658
Blog Entries: 3

Rep: Reputation: 224Reputation: 224Reputation: 224
check this out http://www.linuxquestions.org/questi...pc-4175499220/
 
Old 04-07-2014, 07:51 AM   #15
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,581

Rep: Reputation: 480Reputation: 480Reputation: 480Reputation: 480Reputation: 480
Quote:
Originally Posted by the dsc View Post
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.
unless this is a work computer or some kind of laptop, ive never heard of a warranty being violated by the OWNER, that would be you correct, opening their OWN HARDWARE.
 
  


Reply

Tags
copy, ghost, install


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux installation using image copy laginagesh Linux - Software 1 09-01-2009 07:33 AM
Copy of Linux for old computer jppennin Linux - Newbie 7 06-15-2008 02:03 AM
Can I just copy an executable libray to Linux and expect it to work? john3 Linux - Software 3 03-26-2006 11:41 AM
Can't copy files from an SCO Unix System V computer to a Linux computer gnppapas Linux - General 2 11-27-2004 02:39 PM
can I copy data from windows on one computer to linux on another ??? havitush99 General 3 04-01-2002 08:34 PM


All times are GMT -5. The time now is 04:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration