Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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?
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.
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.
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?
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.