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 09-21-2016, 10:27 AM   #16
lq_win
Member
 
Registered: Jul 2015
Posts: 48

Original Poster
Rep: Reputation: Disabled

since currently I don't have another harddisk for Server B as sdb..
then does Rsync will automatically copy /home2 of Server A (sdb) to /home2 of Server B (sdb) once I already put harddisk in Server B as sdb?
 
Old 09-21-2016, 10:34 AM   #17
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 5,388

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
No, it will create the missing /home2 directory in Server B (sda root partition) and will copy files into it (if enough space)
 
Old 09-21-2016, 11:10 AM   #18
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 8 Jessie
Posts: 1,688
Blog Entries: 5

Rep: Reputation: 165Reputation: 165
Quote:
Originally Posted by lq_win View Post
let me explain more detail:

on Server A .. I have DHCPD, Squid, Dansguardian, DNS, Postfix, Dovecot running..
the Maildir is in /home2 (sdb)

I want to make backup of Server A to Server B .. so in case Server A crash then I can use Server B by just change its IP address to be Server A's IP address..

I plan to run rsync everyday on 11PM .. to save the config of server A (if any changes) and also the Mailboxes
I'm not familiar with all of the things on that list, but I am familiar with dhcpd and I'll give a word of warning (hopefully not required). You don't want to have more than one authoritative DHCP server running at the same time. So at the very least, you're going to want to make sure /etc/dhcp/dhcpd.conf is NOT cloned over, and you will need to edit dhcpd.conf in addition to changing the IP address.
 
Old 09-21-2016, 11:17 AM   #19
lq_win
Member
 
Registered: Jul 2015
Posts: 48

Original Poster
Rep: Reputation: Disabled
noted and thanks..
regarding to dhcpd .. in what dhcpd config file for setting to what interface the dhcpd listen to?
my current dhcpd.conf is:

subnet 10.100.100.0 netmask 255.255.255.0 {
deny client-updates;
deny unknown-clients;
range 10.100.100.51 10.100.100.250;
}

option routers 10.100.100.6;
option domain-name-servers 10.100.100.6;

host someone {
hardware ethernet a:b:c:d;
fixed-address 10.100.100.188;
}

...
...
...

and I did not find the config for listener NIC of dhcpd..
 
Old 09-21-2016, 11:23 AM   #20
lq_win
Member
 
Registered: Jul 2015
Posts: 48

Original Poster
Rep: Reputation: Disabled
since currently I don't have another harddisk for Server B as sdb..
then does Rsync will automatically copy /home2 of Server A (sdb) to /home2 of Server B (sdb) once I already put harddisk in Server B as sdb?
 
Old 09-21-2016, 12:13 PM   #21
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 5,388

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
Originally Posted by lq_win View Post
since currently I don't have another harddisk for Server B as sdb..
then does Rsync will automatically copy /home2 of Server A (sdb) to /home2 of Server B (sdb) once I already put harddisk in Server B as sdb?
Understood, server B has no sdb

But rsync will try to copy /home2 from server A on server B destination, if /home2 doesn't exist it will create home2 directory in / which is sda on server B, then it will copy files into it
 
Old 09-21-2016, 12:31 PM   #22
lq_win
Member
 
Registered: Jul 2015
Posts: 48

Original Poster
Rep: Reputation: Disabled
I meant
If server B has sdb then will rsync will automatically create /home2 into sdb of Server B?
Or rsync will just create /home2 in sda of server B no matter the server B has sdb eventhough the source of /home2 is in sdb of Server A.
Just curious..
 
Old 09-21-2016, 01:43 PM   #23
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 8 Jessie
Posts: 1,688
Blog Entries: 5

Rep: Reputation: 165Reputation: 165
rsync fundamentally copies files from one folder structure to another folder structure - whatever paths you specify. It has an option to restrict itself to one file system in the source (so it doesn't descend into mounting points to other file systems) but otherwise it doesn't care about file systems. It will simply copy over the files and/or folders you want, recursively copying over nested content within any folders.

You have complete flexibility in specifying the source and destination paths, the same as cp or mv. You may be confused because you are attempting to do a cloning into thinking that rsync can only copy from one path to the same path in another system, but there is no such restriction.

If you put a hard drive in server B, rsync will...do nothing. It doesn't care about mounting points. It will never edit your /etc/fstab. But certainly if you are cloning the /etc folder and it happens to copy over /etc/fstab, then the new /etc/fstab will try to mount the exact same partitions that the original wanted to mount. And it will gloriously fail, likely preventing you from booting unless the "noauto" option is set on the missing partitions.

It's probably a really stupid idea to try and clone over /etc/fstab. But assuming you actually do want to do that, then you need to manually make sure all of the partitions which exist in the original also exist in the backup. They do NOT actually need to all be in the same hard drive structure, so long as you use UUIDs for the /etc/fstab entries. But you do need to learn about UUIDs and learn how to manually change the UUID of a partition to match the original's.

Ugh...that's a maintenance nightmare. I think it's better to NOT clone over /etc/fstab, but rather to maintain them separately.
 
  


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
Is it possible to clone a server? abefroman Linux - Server 2 09-25-2012 07:17 PM
How to clone a user account from one server to other server ZAMO Linux - Enterprise 5 03-19-2010 02:40 AM
I need to Clone a Red Hat drive and install clone in HP server drummer54 Linux - Newbie 14 03-07-2009 05:15 PM


All times are GMT -5. The time now is 06:58 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration