cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate a server

SOLVED
Go to solution
Qcheck
Super Advisor

Duplicate a server

I know we can setup the Acronis for the system and backup and recovery, I mean one of the methods I used before in my earlier project. But don't have that much time to setup Acronis(will take long time to buy and setup).

In this new project I need to duplicate a kickstart server as we only have a production, which I was inherited when I took this project. Since we don't have a backup, I am concerned if something happens to the current server, we are lost. So as a backup, I want to create a dev node as a backup. So now, I need a quick setup to replicate the kickstart, which is running linux 5.2. So how can I approach this?

On a new server, I will install linux 5.2 and then can I copy(dd) the data from prod server to the dvd and apply on the new server? Or any better ideas?

Thank you for your time.
15 REPLIES
Elko
Frequent Advisor
Solution

Re: Duplicate a server

You can use mondorescue

http://mondorescue.org/

These exist .rpm packages, and installation is very easy. Once you install it, you can make exact copy of your system and burn it to CD/DVD, copy to USBs, HD, whatever you want.

Here is documentation
http://mondorescue.org/docs.shtml

Copy of working system on ( eg ) DVDs, you save and use it in case of problem.
Recovery is simple, you can recover some files, partitions, whole system.
Do not forget to check are media written correct after making them

Hope this helps

Elko
/home/BIH/Sarajevo
J. Maestre
Honored Contributor

Re: Duplicate a server

+1 to the mondorescue suggestion.

A tar (or dd) would also work, but mondorescue is far more convenient as it even allows to restore to bare metal, automatically creating partitions and everything.
Qcheck
Super Advisor

Re: Duplicate a server

Thank you Elko. sounds good, I will install Mondo. But when I try to download I see whole bunch of the software versions at the ftp://ftp.mondorescue.org/rhel/5/ site. I am not sure what mindi version will go with mondo, and so on. Can you please let me know what versions will be suitable for the following version:

[root@server etc]# cat redhat-release
Red Hat Enterprise Linux Server release 5.2 (Tikanga)
[root@server etc]# uname -a
Linux server.local 2.6.18-92.1.10.el5 #1 SMP Wed Jul 23 03:55:54 EDT 2008 i686 i686 i386 GNU/Linux
[root@server etc]#

Thank you.
wobbe
Respected Contributor

Re: Duplicate a server

I like to use clonezilla for these kind of things. But you could also try ping or g4u.
Elko
Frequent Advisor

Re: Duplicate a server

As you have RHEL 5.2

mindi-busybox-1.7.3-1.rhel5.i386.rpm
mindi-2.0.7.2-1.rhel5.i386.rpm
mondo-2.2.9.2-1.rhel5.i386.rpm

First install mindi-busybox, then mindi and mondo.

Please read at least first 20 pages of .pdf on mondorescue. it is very clear written, In PDF document you have more information how to start mondo, how to create backup, on DVDs or as iso images. Once you start mondo, you can experiment with it and find what best suit you.

Important : Once you create backup media, please verify them. I mean, before you consider they are ok, try to recover system from them, just to be sure backup media is ok and working .
Murphy never sleep :)
/home/BIH/Sarajevo
Qcheck
Super Advisor

Re: Duplicate a server

Thank you Elko. I did install successfully in the morning. But now, I am trying to backup and failed both when I tried to dvd and cd. I guess dvd should be specific DVD+RW or DVD-RAM, and I have is DVD-R and failed. So I tried with CD-R and it failed too. Help needed badly. see the details:

[Main] libmondo-fork.c->eval_call_to_make_ISO#179: Basic call 'cdrecord -eject -v (null) fs=4m dev=/dev/cdrom
speed=8 //mondo.tmp.2vkx6w/temporary.iso' returned an error.
Press ENTER to continue.
mkisofs and/or cdrecord returned an error. CD was not created
Making an ISO (CDR #1)...failed to write
[Main] libmondo-devices.c->is_this_device_mounted#1132: Is /dev/cdrom mounted?

I really like if DVD works. Any ideas?
Thank you
Steven E. Protter
Exalted Contributor

Re: Duplicate a server

Shalom,

Depending on the model of DVD/CD-Writer you have, writing to that media can be problematic.

Much better to create iso files on an NFS Share, or even local disk, which you can copy across the network to become the building blocks of new systems.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Elko
Frequent Advisor

Re: Duplicate a server

When you run

mondoarchive

then will show up blue screen with red options
1) cd-r disks
2) dvd disks
3) tape
and so on,

please choose option hard disk, next step is to choose path, after that is compression, then it says
" Please enter how big you want each ISO image to be (in megabytes). This should be less..DVD's (4480) you plan to backup to. ""

choose there size ( or accept default 4480 for DVD image ) for iso image size.
After that give it a name and wait on it to finish. It will make iso image at path you choosed above.
After that you can burn image on same machine or use scp to copy it to some other machine and burn it.
That image or images are copy of your system.

When decide to recover system, boot up from first of media you made and follow steps.
I think option "nuke" will back system at state when images were made. It is also possible to recover some files/dirctories.

/home/BIH/Sarajevo
Qcheck
Super Advisor

Re: Duplicate a server

Thank you Steven. Also thank you Elko. Now, I backed to the local disk and has 7 iso images. so now how I can I burn it to the dvd? Do I need to mount the dvd and then copy to that? Or I have a ntfs USB drive but can't mount that on linux. Is there any other way, so that I don't need to have 7 DVDs? I am so excited, once this works I want to try the restore.

Restore questions: Can I restore from dvd(once I am done)on any other node or it should be hardware specific? I am planning to restore to a dell laptop.

Thank you for all your valuable time and help.
wobbe
Respected Contributor

Re: Duplicate a server

DVD as a backup? That's what you do at home.
I would never not rely on DVD's for a backup!
They degrade are easily misplaced and take forever to restore. Use your network and another server to make a backup. Of course you should also implement an offsite disaster recovery plan when the server is really important.
Qcheck
Super Advisor

Re: Duplicate a server

Wobbe,

I want to replicate an existing server to the laptop. So I thought to burn the forst iso image to the dvd. So I burned to the DVD but it is failing to restore at the partition table as /dev/hda1 is tiny.

Thanks
Qcheck
Super Advisor

Re: Duplicate a server

Help please. I am stuck at the mount point.

It says /dev/hda doesn't contain a valid partition. And asks me to edit the following:

Device Mountpoint Format Size(B)
/dev/hda2 lvm lvm 4278
/dev/VolGroup000/LogVol00 / ext3 0
/dev/hda1 /boot ext3 11
/dev/VolGroup000/LogVol01 swap 0

So asks me to edit the mount list and /dev/hda is tiny.

so what needs to change? I get the command prompt but I don't know what to change?

Thank you
Alexander Chuzhoy
Honored Contributor

Re: Duplicate a server

One of the easiest ways to literally replicate a server is to use the good old dd command in conjunction with netcat.

Download some version of Linux that runs out of CD (like Knoppix) and boot the destination server with this CD.

on source machine:

dd if=/dev/hda (or whatever devicename stands for the hard drive) | netcat targethost-IP 1234

on target machine:

netcat -l -p 1234 | dd of=/dev/hda (or whatever devicename stands for the hard drive)

http://www.linuxquestions.org/linux/answers/Applications_GUI_Multimedia/How_To_Do_Eveything_With_DD

Qcheck
Super Advisor

Re: Duplicate a server

Alexander,

Thank you for your reply. So can I follow the below steps:

targethost-IP=192.168.1.2
targethost harddisk size: 320G
Source hardisk size:
[root@server log]# pvdisplay
--- Physical volume ---
PV Name /dev/hda2
VG Name VolGroup00
PV Size 74.41 GB / not usable 31.09 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 2380
Free PE 0
Allocated PE 2380
PV UUID Ngsx2A-O85C-PDal-dGGq-9DQe-Wann-1XeHnB
[root@server log]#

1) Install the base O/S(Linux 5.2) on target machine.
2) On source machine:
dd if=/dev/hda2 | netcat 192.168.1.2 1234
3) On target machine:
netcat 192.168.1.2 1234 | dd of=/dev/sda

Will this work?
Qcheck
Super Advisor

Re: Duplicate a server

Elko,

I only able to restore until the following state:

Restoring from archives
Restoring data from the archives, please wait. This may take some time.

Restoring from fileset # 152 on CDR #1

7:47 taken 49:42 remaining
13% done 87% to go

So any idea, why it is stopping after that? I tried 4 or 5 times, still stopping at the same place at 13%. Any ideas?

Thank you