Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Alwis

macrumors 6502
Original poster
Jan 12, 2017
448
515
Currently I am in the process of cleaning up my old iMac before migrating it (using migration assistant) to my new 2020 iMac. So I had a look at the users and played arround a bit with user management.

I have users with uids 501, 502, 503, 505, 507, the ids 504 and 506 are probably missing because I deleted users in the past. 505 is the nacports user, that is not visible in the GUI.

And here is the nystery: When adding a new user this user gets the 506 as user id, not the 504 which would be the first available id.

I checked with dscl . list /Users and there is no user with the id 504, so why is it not used, what might block it?

Thanks for your help,
Alwis
 
In my experience, macOS does not reuse deleted user IDs. I have not tried this yet but maybe you could manually reuse old deleted user IDs, System Preferences→Users & Groups→<user name>→Advanced Options..., change User ID: field to a deleted user ID (e.g. 504) and then open Terminal app and enter:
diskutil resetUserPermissions / <user id>
diskutil resetUserPermissions / 504
 
Last edited:
In my experience, macOS does not reuse deleted user IDs.

To be sure I just tried this on my mini with Catalina 10.15.6: I created 3 users, deleted them and created 3 new users. The last 3 users got the same ids as the previously deleted ones.
 
To be sure I just tried this on my mini with Catalina 10.15.6: I created 3 users, deleted them and created 3 new users. The last 3 users got the same ids as the previously deleted ones.

I think where this comes into play is if you create user 501, 502 and 503, delete 502 and create a new user.
 
I think where this comes into play is if you create user 501, 502 and 503, delete 502 and create a new user.

I take back what I just said, it appears that deleted user IDs do get recycled. I just tried adding new users 503 and 504. I deleted user 503 and added a new user. The new user got user ID 503 again.

The reason I thought the deleted user IDs were not getting recycled is just I saw a case where a deleted user ID was not getting reused. So I am not sure now why that happened.
 
The reason I thought the deleted user IDs were not getting recycled is just I saw a case where a deleted user ID was not getting reused. So I am not sure now why that happened.

Seems to be the same issue as with the id 504 on my mac, strange...
 
Taz wrote:
"In my experience, macOS does not reuse deleted user IDs."

In MY experience, it DOES.

To the OP:
I can't offer an explanation as to why your "504" user ID space remains empty.
But... that may not be a problem.

When you use setup or migration assistant, I believe it offers you the option of "unchecking" individual accounts for purposes of migration.
In other words, you can "leave accounts behind" that you DON'T want migrated.

Actually, with some VERY careful planning and execution, you could migrate from the old Mac to the new one and place each account into "the numbered space" that YOU want it to occupy.

This would probably require a cloned backup as your "migration source drive", and several passes, the first with setup assistant, and later passes with migration assistant.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.