1

I recently moved my home directory to a different disk and now have it mounted on /home - which seems to have worked.

However one puzzling thing is any terminal emulator I open (regardless of program, alacritty, rxvt, xterm etc) defaults to opening the / directory rather than my home directory /home/daniel

I'm not sure what to do to resolve it, I could set --working-directory but that seems like a band-aid as my terminals always opened in $HOME before I did the move...

/|▶ echo $HOME
/home/daniel
/|▶ finger daniel
Login: daniel               Name: Daniel
Directory: /home/daniel         Shell: /bin/zsh
On since Sun Sep 13 12:49 (BST) on :0 from :0 (messages off)
/|▶ whoami
daniel
/|▶ cd ~
~|▶ 
~|▶ sudo mount | grep home
/dev/sda3 on /home type ext4 (rw,relatime,seclabel)
/|▶ getent passwd $USER
daniel:x:1000:1000:Daniel:/home/daniel:/bin/zsh
/|▶ ls -lZ $HOME
total 68
drwxr-xr-x.  2 daniel daniel unconfined_u:object_r:unlabeled_t:s0  4096 May 25 18:59 Desktop
drwxr-xr-x.  2 daniel daniel unconfined_u:object_r:unlabeled_t:s0  4096 Aug  5 20:36 Documents
drwxr-xr-x.  2 daniel daniel unconfined_u:object_r:unlabeled_t:s0  4096 Sep  5 11:35 Downloads
drwx------. 15 daniel daniel unconfined_u:object_r:unlabeled_t:s0  4096 Sep 13 13:37 Dropbox
drwxr-xr-x.  2 daniel daniel unconfined_u:object_r:unlabeled_t:s0  4096 May 25 18:59 Music
drwxr-xr-x.  2 daniel daniel system_u:object_r:fusefs_t:s0            0 Jan  1  1970 notes
drwxrwxr-x.  4 daniel daniel unconfined_u:object_r:unlabeled_t:s0  4096 Sep 13 14:39 org
-rw-rw-r--.  1 daniel daniel unconfined_u:object_r:unlabeled_t:s0 17311 Sep 13 13:10 out.out
drwxr-xr-x.  3 daniel daniel unconfined_u:object_r:unlabeled_t:s0  4096 Sep  1 17:58 Pictures
drwxr-xr-x.  2 daniel daniel unconfined_u:object_r:unlabeled_t:s0  4096 May 25 18:59 Public
drwxr-xr-x.  2 daniel daniel unconfined_u:object_r:unlabeled_t:s0  4096 May 25 18:59 Templates
drwxrwxr-x.  2 daniel daniel unconfined_u:object_r:unlabeled_t:s0  4096 Aug 29 21:03 tmp
drwxr-xr-x.  2 daniel daniel unconfined_u:object_r:unlabeled_t:s0  4096 Aug 29 18:40 Videos

I'm running Fedora Linux 32

Anyone help would be appreciated!

5
  • Ctrl + Alt + F2 -> login -> what does pwd return? Sep 13, 2020 at 13:24
  • What is the output of ls -lZ $HOME?
    – jsbillings
    Sep 13, 2020 at 13:33
  • @jsbillings I've updated my post with the output of ls -lZ
    – djhworld
    Sep 13, 2020 at 14:10
  • 1
    It could be setlinux (the quick check to see if this is so is sudo setenforce 0, which would cancel that until a reboot or reset with setenforce). If that's the case (not mentioned in the question), it could be failing due to being NFS-mounted (or permissions, etc). For permissions, restorecon is the place to start reading. Sep 13, 2020 at 14:18
  • 1
    Right, I figured as much. This should fix the labels: restorecon -rv /home
    – jsbillings
    Sep 13, 2020 at 16:34

1 Answer 1

4

It looks like when you created your new /home directory, it wasn’t labeled as a home directory, so when you log in, selinux prohibits your session from accessing it. Once you are logged in, you can cd into it, but it’s mislabeled.

Run a restorecon as root to fix this:

# restorecon -r -v /home

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.