Upgrade from Fedora 34 to 35 deleted main user (files preserved)

,

Hi,

I upgraded from Fedora 34 to Fedora 35 recently, and after rebooting, the first screen I saw was the screen to set up a new user when there is no user already. After creating a new user, I found that I couldn’t connect using the previous user’s credentials (it didn’t appear on the GDM list), it had disappeared.
However, its files were still present in /home/username

Did I miss something during the upgrade process?

Thanks.

How exactly did you upgrade? What are you using Fedora Linux / Workstation?

1 Like

this is not a screen one sees during the upgrade—so yeh, how did you upgrade?

I upgraded using the standard GUI. Fedora Workstation.

But I did see it, that is strange.

Can you please elaborate? What standard UI? The Fedora Workstation installation image?

I can’t help you figure out what caused the upgrade process to delete your old user account as I never used the GUI for that.

But the resulting problem can be solved easily:

In my solution, I assume that you do not need the new user account you just created, and I assume that your old user account was a “normal” user without manual customization (so, just like the new account you just created).

First, go to a terminal and enter:

ls -l /home/

Now have a look on the output of your old home directory: If the owner and the group of your OLD user directory is the name of your NEW account, then the user ID of both accounts is equal. If you see a 4-digit number instead of the new user name, this number is the ID of your old account, which we will restore. If it is something else, do NOT proceed to the next steps and let us know.

Next, open /etc/passwd with your preferred editor (vi, nano, emacs, …) with sudo. I assume that you will not find a line in passwd that begins with your OLD user name (so, your user name in the first column; columns are separated by “:”). Otherwise, let us know and do NOT proceed with the next steps, and put that line in your next post as something is wrong with it. Nevertheless, I assume this will not be the case.

Now, stay in the editor and go the the line of your NEW user account. Change now the name of the NEW user name to the exact name of your OLD user name: you have to do this in two columns: in the first column, and in the fifth. In both cases, you have to simply replace the NEW user name with the OLD one.

If the ID of both accounts is equal, nothing more has to be done: save & close. If the ID is different, change the second and the third column (which are the 4-digit numbers of the NEW account) to the ID of the OLD account. Save & close.

Now, use the editor to open /etc/group with sudo. In here, check whether your OLD user name is still inside. If this is the case, I assume it still has the old ID. In this case, you can delete the line of the new account. Save & close. If your OLD account was deleted in the group file, then look for the line of the NEW account and change its name to the OLD one, and also change its ID to the OLD account’s ID. Save & close.

If you reboot now, everything should be fine with your old account. Then, you can delete the NEW user’s home directory with root and done.

3 Likes

Hello @xegulon ,
What may have happened here is something similar I had happen previously with Silverblue around F29 to F30 upgrade I think. The gnome-initial-setup-done file in ~\config had either been written over to have “No” instead of “Yes” in it or edited to, by the update, so the initial setup started. I backed out of it and was able to login with my old user credential that still existed, but had to manually do basically what is being recommended by @py0xc3.

4 Likes

Thanks a lot! It work very well. It might have had something to do with zsh, which was uninstalled but still present it in the /etc/passwd file (on the OLD user line), whereas on the new user line, bash was present. Cheers!

1 Like