LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-13-2024, 01:28 PM   #1
That Random Guy
Member
 
Registered: Jun 2017
Posts: 81

Rep: Reputation: Disabled
Using rsync to mirror source w/ existing permissions but target has different users?


Basically, I'm trying to understand if it makes sense at all to use rsync between two hosts on a network that are both running their own tftp and nfs servers. Ideally, I'd be able to just mirror the contents of the existing nfs export directories on the source to the target, spin up the nfs server on the target, and all would work as it is currently working on the source. Same for tftp.

We can ignore any pre-existing network clients and their configuration for this... I'm more curious about the feasible implementation of this from the server perspective and having this just work as expected. I can always update the configs on the clients when needed but this migration of sorts has me kind of confused. We can also ignore any transport issues. These hosts can talk to each other fine.

The intent is not to have some kind of redundant HA sort of deployment but rather to move the data that is currently being served or present on the source host to the target and then decommission the source host once the services are running as expected. The services being nfs and tftp.

I did a little bit of reading and after inspecting the current hosts, I think I see a problem where using rsync would not help me do what I am thinking.

Right away, I notice that while both hosts have a dedicated tftp user that is used for the tftp daemon, they do not share the same UID on their respective system. This is also observed on the files/folders being served via tftp on the source.

Additionally, there are certain users who own certain files/folders under the nfs exports that do not already exist on the target host.

My current understanding is that while rsync can retain permissions from the source when mirroring to the target, unless the same users exist on the target, this will not work.

Has anyone had something like this come up before? or maybe someone can clarify?

P.S. - both hosts are running Ubuntu 20.04

Last edited by That Random Guy; 04-13-2024 at 01:29 PM. Reason: title is misleading
 
Old 04-13-2024, 06:17 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,640

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
rsync will clone the user NUMBER and group NUMBER on the files and folders. The user NAMES are linked to those number in /etc/passwd. IF you are using traditional services you would have to keep the passwd files in sync and keep the numbers the same between the two hosts. That can be tricky and a lot of piddling work and I do not recommend it.

If you use more modern services you can define VIRTUAL users and keep THOSE the same on both hosts, and then it all LOOKS right from a client machine.

Might be easier to just clone image the original host a few times (as backups and restore source), and restore ONE of those elsewhere to make your new target. IF you rsync between them after that everything should look right until one changes.

--------
OR: you could just copy the suff all into place (using rsync makes sense) then correct the ownerships on the target. IF it is just one time that may be faster and easier.

Last edited by wpeckham; 04-13-2024 at 06:18 PM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
https://mirror.yandex.ru/ broken rsync mirror jheengut Slackware 1 07-04-2020 06:34 AM
copied files from SOURCE to TARGET but now want to rsync SOURCE to existing TARGET teddymills1 Linux - Newbie 3 10-28-2019 07:07 AM
New mirror provided by Aliyun Open Source Mirror Site cxbii Linux Deepin 0 01-10-2014 04:44 AM
Building a Debian Wheezy/Ubuntu Precise Mirror using apt-mirror bennetfox Linux - Server 16 02-23-2013 03:56 PM
Can I use rsync to create mirror two servers with different OS Deadbeat456 Linux - Server 3 06-25-2008 07:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:27 PM.

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