From owner-freebsd-questions@FreeBSD.ORG Wed Aug 21 16:36:14 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 09B89B6B for ; Wed, 21 Aug 2013 16:36:14 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D3B482837 for ; Wed, 21 Aug 2013 16:36:13 +0000 (UTC) Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id AB03F22E6A for ; Wed, 21 Aug 2013 12:36:11 -0400 (EDT) Received: from web3 ([10.202.2.213]) by compute6.internal (MEProxy); Wed, 21 Aug 2013 12:36:11 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:mime-version :content-transfer-encoding:content-type:subject:date:in-reply-to :references; s=smtpout; bh=lZ1JY2BafNmXpSxDLsTiWNZsVD4=; b=CLZWB DF3fz6BMN9bbu7CE2xYUxpDEUAYnGmnuPxl4XpiekxYGePQ3J4TQV+DIVa7vDXVo 5EFmcviYgB8mDZieS3Hx799WicXJt7YRv1uR5NcDh6N7E/cck/s8LdldaS4jiggV PZbcCShcNHtZikgfFa9SH4y0U+TKBqx7nYTQEQ= Received: by web3.nyi.mail.srv.osa (Postfix, from userid 99) id 8BF0FB02387; Wed, 21 Aug 2013 12:36:11 -0400 (EDT) Message-Id: <1377102971.29516.12511917.7D1FFD58@webmail.messagingengine.com> X-Sasl-Enc: 2Aab9kBjaQbOOlkQLw8WnB+FdQ/6BovvEDYIeB9XTjlW 1377102971 From: Mark Felder To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-d009844e Subject: Re: Renumber users and groups Date: Wed, 21 Aug 2013 11:36:11 -0500 In-Reply-To: <5214E6EB.30102@fjl.co.uk> References: <5214E6EB.30102@fjl.co.uk> X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 16:36:14 -0000 On Wed, Aug 21, 2013, at 11:12, Frank Leonhardt wrote: > On 21/08/2013 13:36, Olivier Nicole wrote: > > Hello, > > > > On my system legacy users come with UID starting from 200 upward, and > > all users come with GID lower that 100. > > > > I know it's not a good idea, but consider that some accounts are over 20 > > years old! > > > > This is not too much a problem with FreeBSD as I can renumber the few > > FreeBSD services that have a conflicting ID. > > > > But now I want to share the user directories with Mac (10.6). On Mac, > > any id lower than 512 should be reserved for the system. > > > > I tried to renumber the conflicting services on Mac OS, but it messes up > > the system. > > > > So I should renumber my users; it's not very difficult to do, but I have > > over 1TB of user files for 200 users. > > > > Is there a clever/fast way to do that (other than find -exec chown)? > > > > What pitfall should I avoid? > > > > Best regards, > > > > Olivier > > Both tar and rsync are spectacularly clever about this. I've never > needed to renumber users, but I've noticed tar will restore a backup > across hosts and try to resolve user names correctly. tar stores users > and groups symbolically and will happily extract them to the correct > numerical ID on the new host. All you need do, therefore, is merge the > passwd and group files without conflict and "untar" everything. If > you've got to do this in-place it's not going to work, but as you'd be > wise to make a backup anyway you may as well make a copy instead, and > let it convert them on the fly. rsync seems to pull the same trick. > Those solutions sound pretty handy if I need to move the files at the same time. mtree should do this in-place with minimal fuss as it's just confirming permissions and ownership on all files.