LinuxQuestions.org
Review your favorite Linux distribution.
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 08-16-2012, 02:51 PM   #1
okorkie
Member
 
Registered: Mar 2007
Posts: 31

Rep: Reputation: 0
How to copy entire contents from existing Linux server to new PC


Hello,

I'm done a few searches and I'm having difficulty figuring out which is the best way of accomplishing my goal. I'm trying to take an old stand alone linux server and copy the entire system (possibly called mirroring) to a new and separate PC which is running Windows (I am ok with completely overwriting the contents of the Windows PC with the contents from the Linux box).

The system I want to copy is currently:

# cat /proc/version
Linux version 2.6.18-92.1.18.el5 (mockbuild@builder16.centos.org) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)) #1 SMP Wed Nov 12 09:30:27 EST 2008


# fdisk -l

Disk /dev/hda: 30.7 GB, 30738677760 bytes
255 heads, 63 sectors/track, 3737 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 3640 29133877+ 83 Linux
/dev/hda3 3641 3737 779152+ 82 Linux swap / Solaris


# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 27G 1.4G 25G 6% /
/dev/hda1 99M 11M 83M 12% /boot
tmpfs 125M 0 125M 0% /dev/shm

Does anybody know the best way to go about this? Do I need to remove the Windows hard drive and install it into the Linux box (I would rather not have to do this if I can avoid this). Can this be done via cross-over ethernet cable between the 2 devices?

Thanks in advance!
 
Old 08-16-2012, 03:01 PM   #2
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,227

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
i would install the same distribution on the target system as the new systems, install the same packages as exists on the existing server, make sure both installs are up to date, create any users from the old system on the new system, then copy /var, /etc/ and /home, making sure to chown the individual home directories to the new uids on the new system. only those folders for the most part contain information that can be altered by users/administrators/software (for instance mysql is /var/lib/mysql, and apache is /var/www{/html} by default), the rest is stuff that comes from packages and isn't altered except by a software update.
 
Old 08-16-2012, 03:08 PM   #3
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 24
The word "best" can get you a hundred varied responses, but what I'd do is tar the entire thing for easier copying. You might take manual steps first to put things like crontabs in more friendly locations, but that's just preference (see above).

Next I'm assuming you mean the Windows box will take over the function of your current Linux system. If that's correct, there's no need to swap hardware. I'd wipe the Windows drive and give it a fresh Linux install--same distro is probably preferred--then copy the tarball to the new system in a backup directory, ready to cherry-pick individual files, such as httpd.conf, dhcpd.conf, et cetera. Keep in mind whether any file's ownershit is relevant to its function--serving web pages from user home directories and such.

Since the current Linux box is significantly older, you'll want to be very careful about dropping configuration files into a newer environment. Applications change, and the old config might not work anymore (Nagios comes to mind).

This is where you stand to perform more manual conversions and potentially wonder if the backup was worthwhile, or if it would've been easier to simply recreate everything from scratch. Only you can decide that, based on your familiarity with configuring whatever will run on the box. Of course served content and media archives are exempt from that part.

Good luck!
 
Old 08-16-2012, 03:12 PM   #4
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 24
Hahahah, naturally I meant "ownerSHIP," but that typo is funny enough to leave alone.
;-)

I also forgot to mention that if all you need is to back up your existing box for safekeeping, you can copy the tarball to your Windows box with PSCP.
 
Old 08-16-2012, 07:06 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
If the HW is the same, you can use http://www.mondorescue.org/ or Clonezilla or hot-swap/mirroring if you have already got the capability.
Otherwise, re-building the OS separately, then copying over the Apps/data will probably do.
Definitely take a couple of backups first.
 
Old 08-17-2012, 11:15 AM   #6
okorkie
Member
 
Registered: Mar 2007
Posts: 31

Original Poster
Rep: Reputation: 0
Thanks everyone.... It sounds like it is easiest to start from scratch and maybe update the distro while I'm at it.

Cheers
 
  


Reply


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
copy existing root fs to nfs server freeindy Debian 1 03-10-2012 03:46 PM
Copy existing root fs to nfs server freeindy Linux - General 1 03-10-2012 07:04 AM
can i copy the entire contents of a partition and use it. deathalele Linux - General 5 06-30-2008 12:31 PM
How to copy entire contents brick_46143 Linux - Newbie 15 02-27-2008 12:46 PM
How can I copy an entire CD (from WinXP) to a dir on my Linux server? hmendoza Linux - General 2 04-04-2007 07:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration