I have a new Centos installation that has an empty /home dir and there are no users...just root. I want to move the home directory from another server to the new one. At this time the old /home directory has been tarred with "-prf". That will keep permissions which could be a problem. Is there a simple way to move the /home directory? And the non-system users in the password and group files? Todd -- Ariste Software 200 D Street Ext Petaluma, CA 94952 (707) 773-4523
On 9/1/05, Todd Cary <todd at aristesoftware.com> wrote:> I have a new Centos installation that has an empty /home dir and there > are no users...just root. I want to move the home directory from > another server to the new one. At this time the old /home directory has > been tarred with "-prf". That will keep permissions which could be a > problem.I only have a few users on my machine. What I do is, use useradd or what not to create the users in the same order as the UID. Copy over the home dirs, moving the newlly created ones elsewhere. Then copy and paste the crypted password in the shadow file. You could paste the users from /etc/passwd shadow and group if you have a lot of users instead of creating the accounts.
On Thu, 2005-09-01 at 15:06 -0700, Todd Cary wrote:> I have a new Centos installation that has an empty /home dir and there > are no users...just root. I want to move the home directory from > another server to the new one. At this time the old /home directory has > been tarred with "-prf". That will keep permissions which could be a > problem. > Is there a simple way to move the /home directory? And the non-system > users in the password and group files?Yes, It's called NIS and NFS. It makes it extremely easy and painless. It may seem like I'm suggesting more work, but once you do it once your network, you will never do it again. Even if you leave NIS and NFS disabled, once you set them up, you can always start the services. With NIS, merely setup your current server as an NIS master. Reference the HOWTO (see TLDP.org). Now setup the new server as a slave. The maps get pushed and now you have a copy of all essential UNIX configuration files necessary (passwd, hosts, services, etc...). Merely cat >> the maps into the new server's files and make it the master. With NFS, just export /home from the old server with "no_root_squash" for the new server IP, and mount it on the new one. Now you can move (mv) things directly over from one /home to another. -- Bryan J. Smith b.j.smith at ieee.org http://thebs413.blogspot.com ---------------------------------------------------------------------- The best things in life are NOT free - which is why life is easiest if you save all the bills until you can share them with the perfect woman
On Thu, 2005-09-01 at 15:06 -0700, Todd Cary wrote:> I have a new Centos installation that has an empty /home dir and there > are no users...just root. I want to move the home directory from > another server to the new one. At this time the old /home directory has > been tarred with "-prf". That will keep permissions which could be a > problem.How big is this file? -z would have also compressed it. Alternately, see below.> Is there a simple way to move the /home directory? And the non-system > users in the password and group files?1. sort and extract the non-system users/groups from the respective /etc files passwd/shadow/group. scp the delta files to new system and append them to the respective files there. 2. scp/rsync /home/ (from old system) to /home (new system) see man scp/rsync. Note options for compression and sym links. 3. Ensure file/dir ownership at /home. If need be use "chown -R <userid>: on <userid>/" The above is off the cuff :) HTH, -- Arun Khan (knura at yahoo dot com) If you're going to do something tonight that you'll be sorry for tomorrow morning, sleep late. -- Henny Youngman