Missing user [solved]

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
User avatar
Van_Vinkle
Donor
Posts: 157
Joined: 25. Oct 2012, 17:39

Missing user [solved]

Post by Van_Vinkle »

My desktop had two HD, the first one containing the "/" folder and the second one having "/home".

Last week the first HD died, and I replaced it with a SSD HD. The root and all the folders hanging of it were lost. Because that, I was forced to install Salix 14.2 64 bit in the new SSD. All the process was smoothly, and I indicated to the installer that /home should be installed in the old disk/partition. The installer did so, but it did not asked for an user (I installed twice, and I am sure of this). The installation finished with no problems.

But the problem arised when I tried to reboot and start again. As usual, it asked for the username and password. I answered with the old user and password, but the system does not recognize it and I am not able to use the new installation.

Any clue will be very appreciated.
Last edited by Van_Vinkle on 25. Oct 2017, 15:12, edited 1 time in total.
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: Missing user

Post by gapan »

The user information is stored in your /etc, so by losing the first HD you lost the user information too. Only the user files are stored in /home. You currently have no users in your system. You can chroot from the installation medium to your installation and create the users you want to have. They can have the same usernames as before, but be careful about UIDs, as they need to match too. The first user you will create will get UID 1000, the 2nd 1001 and so on. You can see the UIDs that you used previously by mounting the /home partition from the installation medium and running "ls -l" on it.

In order to chroot and create the users, you can mount the partition, chroot to it, and run usersetup (for example, if it is sda1):

Code: Select all

mkdir /hd
mount /dev/sda1/ /hd
chroot /hd
usersetup
Provided the UIDs match too, you should be able to log in. If the UIDs don't match, the easier thing to do would be to change the UID of the user with the usermod command.
Image
Image
User avatar
Van_Vinkle
Donor
Posts: 157
Joined: 25. Oct 2012, 17:39

Re: Missing user

Post by Van_Vinkle »

After the fast Gapan's answer (and thank you very much for it) I've remembered that I have an (a little old) backup of /etc. I think it will be easier to copy the files containing the users information to the new /etc. But, what are these files?
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: Missing user

Post by gapan »

/etc/shadow, /etc/passwd and /etc/group
Image
Image
User avatar
Van_Vinkle
Donor
Posts: 157
Joined: 25. Oct 2012, 17:39

Re: Missing user

Post by Van_Vinkle »

Problem solved. I'm again into Salix! :D

Thanks for the very good support.
Post Reply