Issue when moving a user home directory on an external SSD (eSata)

Hi,

I might have missed something or done a (stupid) mistake somewhere… Any idea of what I am doing wrong ?

Here is what I have done :

  • First I have flashed the Jetson TK1 board with the latest image Linux for Tegra TK1 (with the latest Jetpack L4T provided by Nvidia)

  • I have updated the ubuntu linux packages

  • I have added an SSD via the eSata connector. The partition is mounted via the /etc/fstab configuration file, that I have edited manually like this :

ubuntu@tegra-ubuntu:~$ cat /etc/fstab
# UNCONFIGURED FSTAB FOR BASE SYSTEM
UUID=41470744-5503-4e23-940b-0674fec1ae92 /media/TK1-SSD auto nosuid,nodev,nofail,comment=x-gvfs-show 0 0

and I can access normally the SSD disk and navigate the directories and files ,etc (via the unix command line or the File explorer. The “TK1-SSD” drive is also dispalyed in the GUI launcher bar)

  • I have created a new user named “jetson” and try to locate its home directory on the SSD (note : it has the same group ID than the default user “ubuntu”, so it is in the group “ubuntu” and I made sure that the path to the new home directory on the SSD has rwx rights for the group
sudo useradd jetson --gid 1000 --create-home --home /media/TK1-SSD/home/jetson
sudo usermod -a -G sudo jetson
sudo passwd jetson  # To define the user's password

When I try to close the “ubuntu” session and open a session for user “jetson” (with lightdm GUI), it fails with a black screen. In order to recover I have to connect from another computer to the jetson board through ssh with user ubuntu, and execute “sudo restart lightdm” and proceed to login with the “ubuntu” user (home directory still located in /home )

Here are what he directories and their rights look like :

ubuntu@tegra-ubuntu:~$ ll /home/
total 12
drwxr-xr-x  3 root   root   4096 Jun 16 14:46 ./
drwxr-xr-x 21 root   root   4096 Apr 15 17:16 ../
drwxr-xr-x 20 ubuntu ubuntu 4096 Jun 21 11:29 ubuntu/
ubuntu@tegra-ubuntu:~$ ll /media
total 12
drwxr-xr-x  3 root   root   4096 Jun 15 13:36 ./
drwxr-xr-x 21 root   root   4096 Apr 15 17:16 ../
<b>drwxrwx---  8 ubuntu ubuntu 4096 Jun 16 13:11 TK1-SSD/</b>
ubuntu@tegra-ubuntu:~$ ll /media/TK1-SSD/
total 56
drwxrwx--- 8 ubuntu ubuntu  4096 Jun 16 13:11 ./
drwxr-xr-x 3 root   root    4096 Jun 15 13:36 ../
<b>drwxrwxr-x 4 ubuntu ubuntu  4096 Jun 16 14:46 home/</b>

ubuntu@tegra-ubuntu:~$ ll /media/TK1-SSD/home/
total 16
drwxrwxr-x  4 ubuntu ubuntu 4096 Jun 16 14:46 ./
drwxrwx---  8 ubuntu ubuntu 4096 Jun 16 13:11 ../
<b>drwxr-xr-x  2 jetson ubuntu 4096 Jun 16 14:35 jetson/</b>

I have tried several variant :

  • If I start by creating the user jetson (same method) but define the home directory in /home/jetson, there is no issue to open a session with that user in lightdm
  • After this, if I move this user home directory into /media/TK1-SSD/home/jetson with the command "sudo usermod -m -d /media/TK1-SSD/home/jetson " ) , the problem occurs
  • with the “jetson” user home directory located on the SSD drive, I have no issue to open a user session for the jetson user via ssh.

So the problem looks to be related with lightgm, certainly an access right issue

When I look into the logs, especially lightdm logs, I don’t spot any obvious error in /var/log/lightdm/lightdm.log,

I also checked that there is no default user in the conf file of lightdm :

ubuntu@tegra-ubuntu:~$ sudo cat  /etc/lightdm/lightdm.conf 
[SeatDefaults]
autologin-user=
ubuntu@tegra-ubuntu:~$

Any idea what could cause the error and how I could correct it ?

(update) I have solved part of the problem :

  • in the home directory of the jetson user (located on the SSD), after a fail attempt at opening a GUI session, i found an error in the file ~/.xsession-errors : something like “can’t access /dev/nvhost-ctrl

when looking at this device in more details :

ubuntu@tegra-ubuntu:/media/TK1-SSD$ ll /dev/nvhost-ctrl
crw-rw---- 1 root <b>video</b> 251, 0 Jun 21 15:13 /dev/nvhost-ctrl

So first problem : I did not added group ‘video’ to the user jetson when I created it

when looking at the other groups of user “ubuntu”, other rights might be missing too… so we can update this

ubuntu@tegra-ubuntu:/media/TK1-SSD$ id
uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),20(dialout),27(sudo),29(audio),44(video)

jetson@tegra-ubuntu:~$ id
uid=1001(jetson) gid=1000(ubuntu) groups=1000(ubuntu)

ubuntu@tegra-ubuntu:/media/TK1-SSD$ sudo usermod -a -G adm,dialout,audio,video jetson
ubuntu@tegra-ubuntu:/media/TK1-SSD$ su jetson
jetson@tegra-ubuntu:~$ id
uid=1001(jetson) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),20(dialout),27(sudo),29(audio),44(video)
jetson@tegra-ubuntu:~$

After a second try to open a GUI session for user jetson, it fails again but with another error :

jetson@tegra-ubuntu:~$ cat .xsession-errors
Script for ibus started at run_im.
Script for auto started at run_im.
Script for default started at run_im.
init: unity-settings-daemon main process (11260) terminated with status 1
init: gnome-session (Unity) main process (11281) terminated with status 1
init: unity-panel-service main process (11292) terminated with status 1
init: hud main process (11269) terminated with status 1
init: indicator-printers main process (11357) terminated with status 1
init: logrotate main process (11186) killed by TERM signal
init: indicator-bluetooth main process (11342) killed by TERM signal
init: indicator-power main process (11344) killed by TERM signal
init: indicator-datetime main process (11347) killed by TERM signal
init: indicator-session main process (11365) killed by TERM signal
init: indicator-application main process (11366) killed by TERM signal
init: Disconnected from notified D-Bus bus
jetson@tegra-ubuntu:~$

after a little search on the web, this problem could have been solved by reseting/deleting some configuration file :

rm ~/.config/dconf/user

The last remaining problem :

  • if I let the ubuntu session opened and and try to switch to a jetson session with the GUI of lightDM, I get the black screen with a blinking cursor. I must then restart lightdm via a ssh connexion from another computer to recover from the error (same problem if I switch from jetson user to ubuntu user). (I have to explore the logs again now)

  • but if I close the user session (logout) before opening the other one with the lightdm GUI… there is no problem…

if anyone have an idea… you’re welcome !

If you login via ssh (or perhaps multiple ssh sessions to do more things at once) as well as local with user ubuntu, then the ssh sessions can monitor logs as you use the local session to cause an error…you will see logs in real time. I suggest ssh monitor (via “sudo tail -f filename”) “/var/log/auth.log”, dmesg, kern.log, syslog, and Xorg.0.log. You may find something indirectly related to the issue, e.g., each session also configures multimedia, like audio, which in turn uses the pseudo realtime extensions (see user rtkit) over messagebus group…implying it may not be an issue of user “jetson”, it may instead be an issue of some other triggered dependency (the membership in group “video” would be a GPU dependency example, there may be others with similar requirements). See if you can spot something even indirectly related to user jetson.