LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-24-2009, 12:28 PM   #1
dzollinger
LQ Newbie
 
Registered: Dec 2007
Posts: 19

Rep: Reputation: 0
Clone Server to New Hardware


I have a older Gentoo qmail server that is dying from the rapid growth of our email requirements. We are eventually migration to a brand new Exchange Server (different story). But in the mean time (4 more months) I need to get the current system stable. We are getting lots of hard drive issues and the server is unable to handle the SPAM/AV scanning it's doing.

What I would like to do is clone the system over a new server (more RAM, faster CPU). My question is: What is the best way to handle this? I am not worried about trying to adjust partition sizes so I was planning on using dd and plug the clone into the new server and see what happens.

Is there a chance this will actually work? Or are the major hardware changes going to wreak havoc on the server?

Any suggestions would be appreciated.

Thanks,
David
 
Old 02-24-2009, 01:22 PM   #2
kentyler
Member
 
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270

Rep: Reputation: 38
That all depends on what type of hard disk you have and what hard disk controller.

I have in the past put a second hard disk into an ide machine and ran:

cat /dev/hda > /dev/hdb

This clones all partitions and makes an exact copy. You will of course need to do some modifications to the drive if you plan on using additional space in the event of a bigger drive.

With scsi disks that do not share the same controller you may need to boot to rescue and load a driver and then build a new initrd image.
 
Old 02-24-2009, 01:30 PM   #3
dzollinger
LQ Newbie
 
Registered: Dec 2007
Posts: 19

Original Poster
Rep: Reputation: 0
The current server has an IDE hard drive. The new server has a SATA hard drive. No RAID controllers involved.
 
Old 03-09-2011, 02:11 AM   #4
kitek
Member
 
Registered: Apr 2005
Posts: 252

Rep: Reputation: 15
Quote:
Originally Posted by kentyler View Post
That all depends on what type of hard disk you have and what hard disk controller.

I have in the past put a second hard disk into an ide machine and ran:

cat /dev/hda > /dev/hdb

This clones all partitions and makes an exact copy. You will of course need to do some modifications to the drive if you plan on using additional space in the event of a bigger drive.

With scsi disks that do not share the same controller you may need to boot to rescue and load a driver and then build a new initrd image.
I want to do something like it. I just want to copy To make an exact server just on different hardware. Assuming hda is the current primary drive in the system to back up right? and hdb is the slave I put into the box to copy too right? so then take out the hdb and place it in the new box and boot and it should be just like the other right just different hardware?
 
Old 03-09-2011, 10:00 PM   #5
crispinux
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Rep: Reputation: 0
if all you want is to clone the hda disk to the hdb you can use "dd", just be sure both hard drives are unmount.

dd if=/dev/hda of=/dev/hdb
 
Old 03-09-2011, 10:34 PM   #6
kitek
Member
 
Registered: Apr 2005
Posts: 252

Rep: Reputation: 15
Quote:
Originally Posted by crispinux View Post
if all you want is to clone the hda disk to the hdb you can use "dd", just be sure both hard drives are unmount.

dd if=/dev/hda of=/dev/hdb

Okay with that being said. I want to make sure I understand. I scenario I would like to work on tonight maybe you can lead me there. I have this one Centos box with only a 250GB hard drive in it. It's a low end P4. I have built a new server that doesn't have an O/S yet since I want the one I am now duplicated. If the source PC has only one drive, how do I unmount them and do the copy? It will go from the 250GB to a 500GB.
 
Old 03-10-2011, 12:02 AM   #7
crispinux
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Rep: Reputation: 0
ok, let me try to explain this a little more,

1.- you need to install both HD in the same machine.
2.- boot your machine with a live CD ( I like knoppix).
3.- open a shell session
4.- you can use the fdisk -l to see the disks
5.- ensure both drives are unmount.
6.- then use dd if=/dev/hda off=/dev/hdb

be really careful because the dd = disk destoyer
I use this only with disk to disk clone.
 
Old 03-10-2011, 12:15 AM   #8
kitek
Member
 
Registered: Apr 2005
Posts: 252

Rep: Reputation: 15
Quote:
Originally Posted by crispinux View Post
ok, let me try to explain this a little more,

1.- you need to install both HD in the same machine.
2.- boot your machine with a live CD ( I like knoppix).
3.- open a shell session
4.- you can use the fdisk -l to see the disks
5.- ensure both drives are unmount.
6.- then use dd if=/dev/hda off=/dev/hdb

be really careful because the dd = disk destoyer
I use this only with disk to disk clone.

Okay got ya. Is there any problem going from a smaller drive to a larger for any reason?
 
Old 03-10-2011, 01:43 PM   #9
crispinux
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Rep: Reputation: 0
no I do that a lot of times, but the dd is a exactly copy of the old drive so if you want to use the remain space in the disk you need to create a new partition in the unused space
 
Old 03-15-2011, 09:17 PM   #10
bryan641
Member
 
Registered: Mar 2011
Location: Ohio, USA
Distribution: Debian Stretch
Posts: 43

Rep: Reputation: 14
When I needed to move my ext3 partition and resize it I used "dd" to backup and restore the partition. Then got it to recognize the new partition size with "resize2fs". No need to create an additional partition to use the new disk size.

--Bryan
 
  


Reply



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 HD to another server nnhubbard Linux - Newbie 6 11-18-2008 02:06 PM
Clone an entire server galphanet Linux - Server 2 11-16-2008 09:37 AM
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 - Server

All times are GMT -5. The time now is 08:31 AM.

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
Open Source Consulting | Domain Registration