I asked a question previously about recovering a RAID 1 partition where the UUID's of the member partitions had all been zeroed. Having received no response in that thread, I'm now forced to reinstall CentOS on the OS partition and rebuild the system.
One of the big tasks of the rebuild will be trying to recover the user database, for which there is no recent backup. My goal is simply to recreate the user database by using a script on a list of UID's and usernames to create everyone's account with the same password which they can then change on login.
/home was on a different and still extant raid array, so in that partition I have an exhaustive list of users, and by reading the UID of each user's directory, I also have each user's old UID. What I'm struggling with is a pair of scripts. The first will iterate /home and create a file with matched pairs of UID's and username, and then the second will use that output file to create all of those accounts on the new installation, so the UID's of the home directories will then translate to a current user. It's a samba file server, so during the second script I'll also create the matching samba username.
Does anyone know of a tool or script already written to do this task, so I can avoid recreating the wheel?