LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-18-2008, 12:33 PM   #1
nnhubbard
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Rep: Reputation: 0
Clone HD to another server


I have two production servers that are live, one webserver, one database. I have a bunch of upgrades that I need to do to updated Debian, and the web software we are running. But, I don't want to do an upgrade on a live machine, I need to test the upgrade first, and make sure everything goes smoothly.

So, I have two other dev machines, and what I need to do is clone the HD's of our live machines, to our dev machines, so that they are exact clones of the live machines. Then I can test the upgrade.

We are running Debian on both live machines. Is there some easy command that I can use to just copy the entire system over with nothing getting changed? What is the best way to do this?

Thanks!
 
Old 11-18-2008, 12:47 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,002

Rep: Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333
Quote:
Originally Posted by nnhubbard View Post
I have two production servers that are live, one webserver, one database. I have a bunch of upgrades that I need to do to updated Debian, and the web software we are running. But, I don't want to do an upgrade on a live machine, I need to test the upgrade first, and make sure everything goes smoothly.

So, I have two other dev machines, and what I need to do is clone the HD's of our live machines, to our dev machines, so that they are exact clones of the live machines. Then I can test the upgrade.

We are running Debian on both live machines. Is there some easy command that I can use to just copy the entire system over with nothing getting changed? What is the best way to do this?

Thanks!
If nothing gets changed, why bother running ANY commands?

Now that I've gotten my smart-a** comment out of the way, I can make a useful suggestion. There are ways of cloning drives (using DD, making a software-mirror, then breaking the mirror, etc.). But, if you're talking about cloning what you've got, then running an upgrade to the OS, then software, I'd not do that.

Since your end goal is to have a brand-new, updated system, why not do a clean install of all the latest-and-greatest stuff to your dev servers, and test your software there? Get the kinks/bugs worked out, then you can cut the production servers addresses over to the rebuilt dev boxes, essentially making them the new production servers. The current ones can get moved to dev. That would also give you a good opportunity to test your documentation and system-recovery methods, and see how good they are, in a controlled environment (and not at dark-0-30 in the morning, when production dies....).
 
Old 11-18-2008, 12:53 PM   #3
nnhubbard
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
If nothing gets changed, why bother running ANY commands?
Since your end goal is to have a brand-new, updated system, why not do a clean install of all the latest-and-greatest stuff to your dev servers, and test your software there? Get the kinks/bugs worked out, then you can cut the production servers addresses over to the rebuilt dev boxes, essentially making them the new production servers. The current ones can get moved to dev. That would also give you a good opportunity to test your documentation and system-recovery methods, and see how good they are, in a controlled environment (and not at dark-0-30 in the morning, when production dies....).
Hmm, again, being newer to Linux, I didn't want to start from scratch. Reason being, there has been alot done to the production servers in terms of setup, configuration, etc. that I did not do, and I would not know how to do all that again. That is why I need to do the upgrade from where the servers are now.

Problem with making the dev servers the new production servers, is that they are old machines that I am only testing on. They are not fast, because I don't need speed, I just need to check for any bugs in the software.

So, how hard would it be to use dd?
 
Old 11-18-2008, 01:05 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
TB0ne, I think you missed the motivation behind the request somewhat.

As much as it's nice to draw diagrams with testing, staging and production environments we can't exactly dictate how someone else runs their company and it infrastructure. taking some form of clone of a server which is in production already and has probably been somewhat organic in its creation makes plenty of sense to me.

a dd is easy... "dd if=/dev/hda of=/dev/hdb" to clone hda to hdb for example... make sure you know which is which.
 
Old 11-18-2008, 01:08 PM   #5
nnhubbard
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
a dd is easy... "dd if=/dev/hda of=/dev/hdb" to clone hda to hdb for example... make sure you know which is which.
What about remote server to remote server? How do I specify the IP?
 
Old 11-18-2008, 01:51 PM   #6
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
Clone the system.. ? I do believe you would have to take it off-line to do this..
http://clonezilla.org/

Clone the system to a virtual machine where you can test the updates..
http://www.windley.com/archives/2007..._machine.shtml


VMWare Converter Coldclone CD to convert the physical Linux Machine to virtual.

Linux conversion - http://virtualaleph.blogspot.com/200...converter.html
Linux conversion - http://www.vmware.com/community/thre...ssageID=562582
Virtualize a Linux Server with VmWare Converter 3.0.1 - http://virtualaleph.blogspot.com/200...th-vmware.html
Linux P2V - http://mark.foster.cc/wiki/index.php/Linux_P2V

Once you have Virtual Machines up you can update and experiment to your hearts content. Take snapshots first so you can revert if anything doesn't work.
 
Old 11-18-2008, 02:06 PM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,002

Rep: Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333Reputation: 4333
Quote:
Originally Posted by acid_kewpie View Post
TB0ne, I think you missed the motivation behind the request somewhat.

As much as it's nice to draw diagrams with testing, staging and production environments we can't exactly dictate how someone else runs their company and it infrastructure. taking some form of clone of a server which is in production already and has probably been somewhat organic in its creation makes plenty of sense to me.

a dd is easy... "dd if=/dev/hda of=/dev/hdb" to clone hda to hdb for example... make sure you know which is which.
No, I got the point, but if the server can't be recovered now, as the OP says:

Quote:
there has been alot done to the production servers in terms of setup, configuration, etc. that I did not do, and I would not know how to do all that again.
These things NEED to be discovered, before a critical failure of the production environments occur. Going through a fresh installation/build will force those things to come out, so they can be discovered and documented. That way, the next poor schlub who has to take over server admin tasks (for the next upgrade....), has a blueprint to work from.

I was going from the point that the end-goal was not only to upgrade the OS, but the app(s) on it too. I've run in-place upgrades before, and they've been twitchy sometimes, since you MAY have two versions of libraries out there somewhere, etc. Going clean, to me, is always the best way to go.
 
  


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
trying to clone virtual server braclayrab Linux - Newbie 1 11-19-2008 09:59 AM
Clone an entire server galphanet Linux - Server 2 11-16-2008 09:37 AM
Clone captive portal server 0.o Linux - General 0 10-13-2007 02:02 PM
Clone a LAMP server newbe45 Linux - Server 2 09-13-2007 09:29 PM
Best Way To Clone A Running Server? hurt138 Linux - Software 8 01-05-2007 02:41 AM

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

All times are GMT -5. The time now is 02:38 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