ZFS Set the $HOME directory

the "~" losses its function.

Code:
[tomhsiung@Toms-Server /usr/home/tomhsiung/softwares]$ echo $HOME

/home/tomhsiung

[tomhsiung@Toms-Server /usr/home/tomhsiung/softwares]$ cd ..

[tomhsiung@Toms-Server /usr/home/tomhsiung]$ cd ..

[tomhsiung@Toms-Server /usr/home]$ ls -li

total 1

8 drwxr-xr-x  3 tomhsiung  wheel  3 Jan 25 00:22 tomhsiung

[tomhsiung@Toms-Server /usr/home]$ cd ~

-bash: cd: /home/tomhsiung: No such file or directory

[tomhsiung@Toms-Server /usr/home]$
 
This has nothing to do with ZFS but more so with the way your system is configured. The filesystem has no influence on that. In this case check /etc/passwd and see what entry it lists. An easy way to solve this would be to create a link between /home and /usr/home.
 
What happens when you just type cd? It should be the same as cd ~. The problem that you are having in that your home directory is in /usr/home/tomshiung but your $HOME environment variable is /home/tomhsiung which apparently does not exist. As ShelLuser stated, create a symbolic link with the ln(1) command to link /home to /usr/home. However, it seems that the home directory in /etc/passwd is wrong as well. Use vipw(1) to change it, then no symlink is necessary.
 
Back
Top