Re: Renumber users and groups
Can you please file a PR with your findings? That's definitely something we need fixed as mtree is pretty important to the project. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Renumber users and groups
One last comment, for the records, 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. I also just thought of an idea I need to benchmark: running mtree with and without nscd. I bet nscd could speed it up a lot. I did try mtree on my own files, counting for 20% of the total size, and it took only seconds. I bet other users may have many more smaller files, but it's all a matter of minutes, so it is fast enough. I found out that mtree would not renumber the symbolic links, so i had to solve that urgently afterward. Best regards, Olivier ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Renumber users and groups
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 -- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Renumber users and groups
On Wed, Aug 21, 2013, at 7:36, Olivier Nicole wrote: Is there a clever/fast way to do that (other than find -exec chown)? Maybe! I haven't tried this myself yet, but next time I need to do this I think I'm going to take an mtree backup of the entire filesystem, change the UIDs and GIDs (vipw, then vi /etc/groups), and then re-apply the mtree to the entire filesystem. It should find all the files that are now orphaned and fix them to use the new UID/GID that you specified. :) What pitfall should I avoid? Not having a backup :) ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Renumber users and groups
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. Regards, Frank. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Renumber users and groups
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. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Renumber users and groups
On Wed, Aug 21, 2013, at 11:36, Mark Felder wrote: 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. I also just thought of an idea I need to benchmark: running mtree with and without nscd. I bet nscd could speed it up a lot. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Renumber users and groups
Thank you, 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. I also just thought of an idea I need to benchmark: running mtree with and without nscd. I bet nscd could speed it up a lot. I did try mtree on my own files, counting for 20% of the total size, and it took only seconds. I bet other users may have many more smaller files, but it's all a matter of minutes, so it is fast enough. Best regards, Olivier ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org