I upgraded my Ubuntu 21.04 to 21.10 yesterday and am running into serious problems after rebooting.
Troubles with graphical drivers (solved)
This is solved, but maybe I broke something by solving this problem ? Ubuntu stuck during boot and the desktop was never showing. I restarted in rescue mode, updated grub to add "nomodeset" and did some reinstallations + reconfigurations :
apt install --reinstall xserver-xorg-video-amdgpu
dpkg-reconfigure gdm3 ubuntu-session xserver-xorg-video-amdgpu
dpkg-reconfigure ubuntu-session xserver-xorg-video-amdgpu
apt reinstall gdm3 gnome-shell yaru-theme-gnome-shell
I then updated grub2 after reboot to make the "nomodeset" permanent.
Identity problem
After finally reaching my desktop, everything first seemed reset to default and my files disappeared from Desktop... until I opened a terminal and saw errors related to filesystem rights on /root/ (?!). After digging a little I came to understand that in bash my HOME environment variable is set to /root, that my LOGNAME is "root"... basically bash thinks that I'm root while system/C programs still recognize me correctly as my actual user. The desktop shown is /root/Desktop and not my user desktop, and so on. My files are still present on disk.
Testing some bash variables :
amael@laptop:~$ echo $LOGNAME
root
amael@laptop:~$ echo $USER
root
amael@laptop:~$ echo $HOME
/root
amael@laptop:~$ echo ~
/root
amael@laptop:~ echo $MAIL
/var/mail/root
Note that the prompt shows the correct username whereas the default folder when opening the terminal is the wrong : $HOME = /root.
Non-shell commands show the correct username :
amael@laptop:~$ whoami
amael
amael@laptop:~$ logname
amael
amael@laptop:~$ id
uid=1000(amael) gid=136(vboxusers) groupes=136(vboxusers),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),120(lpadmin),131(lxd),132(sambashare),998(docker)
My /etc/passwd file seems unchanged and correct :
amael@laptop:~$ egrep "^root|amael" /etc/passwd
root:x:0:0:root:/root:/bin/bash
amael:x:1000:136:Amael,,,:/home/amael:/bin/bash
amael@laptop:~$
My disks appear mounted in rw mode :
amael@laptop:~$ ls -al /home
total 32
drwxr-xr-x 5 systemd-coredump systemd-coredump 4096 juil. 30 2020 .
drwxr-xr-x 20 root root 4096 juil. 30 2020 ..
drwxr-xr-x 59 amael vboxusers 4096 nov. 21 10:15 amael
drwx------ 2 root root 16384 juil. 30 2020 lost+found
amael@laptop:~$ mount | grep mapper
/dev/mapper/vgubuntu-root on / type ext4 (rw,relatime,errors=remount-ro)
/dev/mapper/vgubuntu-home on /home type ext4 (rw,relatime,errors=remount-ro)
What can explain this ? I guess a full reinstallation can solve this but it would be nice not to have to do this.
Thanks for your feedback !