Placing $HOME directory on nfs server
My advice won't solve all your problems, but you may find it enough. You could have only a bunch of directories in the NFS server. i.e., the Documents directory. To do so, mount your nfs server home somewhere like /media/nfs_server/home
. Then change the contents of the file ~/.config/user-dirs.dirs
There you can change the Documents default dir and set it to your NFS server home:
You should have something like:
XDG_DOCUMENTS_DIR="$HOME/Documents"
Change it to:
XDG_DOCUMENTS_DIR="/media/nfs_server/home/my_login/Documents"
Replace it to where you really mount your NFS server and your real login. You could even try something like: /media/nfs_server/$HOME/Documents
, but it depends of your server directories.
Hope this helps.
Related videos on Youtube
Peter Bell
Retired IT Consultant. British, but living in Philippines since 2007
Updated on September 18, 2022Comments
-
Peter Bell over 1 year
I have a number of client machines, all running Ubuntu, and recently upgraded to 13.04. I also have a Slackware-based server which includes an nfs service.
What I am aiming to do is to have access to all my documents from any client. I have copied my entire
$HOME
directory to the fileserver. I have usedusermod -d
to set my home directory to the appropriate area on the server. I useautofs
to mount remote directories, so the full path is/net/tower/mnt/user/UserHome/peter
.If I log in via a text console, all is fine - my files are accessible and writable. However, if I log in via desktop, I get an error:
Could not update ICEauthority file with the full path/filename for the .ICEauthority file.
I have ensured that ownership and priveledges/permissions on the file are correct. I have tried deleting the file, I have tried creating an empty file from a text console - I still get the error.
Either I have to find a way of getting past this error, or find a way to change my
$HOME
after login (from my.profile
?).Can anyone help me?
-
Rinzwind about 11 yearsYou do realize that if the NFS is not reachable your system will -not- boot? I would never consider your method and would advice to store the directory
~/Documents
on that server and not/home
itself. That way your system will always boot and the files (like .ICEauthority) will remain as they should be. -
Peter Bell about 11 yearsI don't understand why the system should not boot. Surely the $HOME directory structure is different for each user, and only comes into play when the user logs in? Each machine would retain at least one administrator account with its $HOME directory on the boot disk. Are you saying that it's not viable to keep a centralised home directory for an individual user, which will be accessed whichever client computer is used to login?
-
Rinzwind about 11 yearsNope. If /home does not get mounted from /etc/fstab it will halt. "Are you saying that it's not viable to keep a centralised home directory for an individual user, which will be accessed whichever client computer is used to login?" No, I am saying that mounting a /home from another server is not good practice. I would advice to mount ~/Documents if all you care for is a central Document folder or mount a shared directory (the latter is the normal method).
-
Peter Bell about 11 yearsWhat I am trying to do certainly works for a text console login, but fails for a gnome login. You have given me an idea, though - perhaps I need to add the remote home directory device to the fstab .. at the moment it is only being mounted by autofs.
-
-
Rinzwind about 11 yearsThis method will work and does not touch the files directly residing in /home/$USER (ie. the hidden files). Though I myself would use a shared directory (ie. a mountpoint
/share
for instance).