LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-06-2019, 01:34 PM   #1
torino
LQ Newbie
 
Registered: Aug 2019
Posts: 5

Rep: Reputation: Disabled
Question regarding cloning Centos 6.8 Server using Rsync


I have never cloned a Linux Server before and need to find a free way to do it. I read an article about using rsync to accomplish this. Thhe server being cloned is a Dell PowerEdge T410 server and the destination server is a HP DL 380P G8 Server. My question is, that when using rsync to clone the server, will I run into issues with storage drivers since the servers are from different hardware vendors? Are there certain folders I need to exclude in order to successfully use rsync to clone a server with dissimilar hardware?

Thanks to anyone who responds!
 
Old 08-07-2019, 01:15 AM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
I think the initrd in /boot is different.
So it would be difficult to clone the running one.

If the clone process is complete, then you could boot with the fallback initrd.
 
Old 08-07-2019, 06:14 AM   #3
torino
LQ Newbie
 
Registered: Aug 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
What if I ignore /boot in the rsync statement? Would I then be able to boot from the original cloned installation?

Thanks.
 
Old 08-07-2019, 06:37 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
If you don't copy /boot, you will not boot. Period.
In all likelihood, if you copy the entire system properly you should be fine. By "properly" I mean with the system quiesced - basically that means shut the system down and do the rsync from a liveCD. If the initrd doesn't have the necessary support, you can simply chroot in and fix it.
rsync isn't a cloning tool - so that means you will be allocating partitions in advance, and the filesystem UUIDs will likely differ. So fstab will need fixing.
 
Old 08-07-2019, 06:43 AM   #5
torino
LQ Newbie
 
Registered: Aug 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
These are the folders I had planned on excluding in the rsync command.
The the lvm data folders are identical on both servers. The purpose of the clone
is to copy over a Progress Database and associated ERP system. If I exclude the folders
below, is there a chance this will work?

/boot
/dev
/tmp
/sys
/proc
/backup
/etc/fstab
/etc/mtab
/etc/mdadm.conf
/etc/sysconfig/network*
 
Old 08-07-2019, 06:46 AM   #6
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Why not do this properly? Fresh install OS then use rsync to copy data?
Yes, it is perhaps more work, but will be a LOT cleaner.
 
Old 08-07-2019, 07:27 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
Post #5 indicates that the target system does in fact already exist. So the thread is at best misleading. I don't know Progress, so I'll exit stage left.
 
Old 08-07-2019, 07:58 AM   #8
torino
LQ Newbie
 
Registered: Aug 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
I do have a clean install setup of Centos 6.8 setup on the new destination server. I am just trying to verify if that the folders I plan to exclude with give me the results I am looking for. I have never used rsync before and am a little leery.
 
Old 08-07-2019, 10:20 AM   #9
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,733

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Better, IMO, would be to figure out what you need to include. To do that, you need to know where the files relevant to the functionality you want to transfer are located.

For example, If I want to replicate a web server, I know to take the content (e.g. /var/www/) and the configurations (e.g. /etc/httpd/), but after I've done a fresh install of apache on the new systems.

That said, if you're working with a fresh install on the target, just try it. If it doesn't work, you can recover by doing another fresh install.
 
Old 08-19-2019, 10:44 AM   #10
torino
LQ Newbie
 
Registered: Aug 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
Rsync creates a folder with no label and copies all directories and files to it

I attempted to clone a linux system using rsync and received some odd results.
The command I used was this:
rsync -vPa -e 'ssh -o StrictHostKeyChecking=no' --exclude-from=/root/exclude-files.txt / DESTINATIONIP:/

It appears that the rsync command created all the folders, but when listing there contents found they were all empty.
After looking more closely, it looks like the rsync command created a new folder with no label or name and then copied
all my folders and files to it.

What am I missing here? I was prompted for the root password on the destination machine and provided it. It appeared that
that everything was copying over fine.

Thanks for your help.
 
  


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
rsync with --link-dest: Question about interrupted rsync session bvz Linux - Server 9 09-10-2016 11:31 AM
a question on cloning using clonezilla or similar beopen Linux - General 6 06-07-2014 03:22 PM
Cloning CentOS 6.2 Server to another ESX 4.1 host baldur2630 Linux - Virtualization and Cloud 1 03-19-2012 04:28 PM
[NEWBIE] Question regarding postfix / dovecot regarding usernames MarkoSan Linux - Server 1 11-02-2011 08:15 AM
Rsync server vs rsync over ssh humbletech99 Linux - Networking 1 10-18-2006 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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