5.7 KiB
Personal Drive / Project Drives
Depending on the configuration of your Linux systems you can find your personal drive (U) as well as all your (Windows) project drives in ~/network_drives/
!!! note
Your Windows U: drive is named home, all project drives have their original share name.
If it is missing or they got disconnected e.g. due to network changes on laptops, you can try to bring them back by running setup-network-drives in the shell or start the "Setup Network Drives" tool :
In an terminal session it does not work with su - <username> because this does not set up all the requited session elements. For this we created the become <username> command which prepares the session before calling su.
If ~/network_drives/ remains empty, or still does not exit please open a ServiceNow ticket, or contact your linux system administrator (and point him/her to configuration guide.
!!! warning Do not checkout Git repositories in your personal drive! Due to limitations of Git this is actually also not possible! Following best practices, always checkout Git repositories in your local home and use the Git server to synchronize them across machines!
Automatically Link or Copy Files in Local Home
!!! warning
- Use this feature consciously and only for files which you really need on "all" machines.
- Do not link ~/.cache, ~/.mozilla or the full ~/.config (individual files below are fine).
- Use copy or download over link to avoid problems with network connectivity (e.g. for laptops).
Shared homes create a set of problems due to the fact most (graphical) Linux software is designed and implemented. Therefore it is recommended to use local homes wherever possible. However, in certain few cases it might be useful to have particular configurations and/or settings synchronized across multiple machines.
With the "Partially Shared Home" feature you can selectively configure what files and/or directories shall be made available on all homes of the different machines. Talk to your system admin or check the admin guide to make that feature available on a specific system.
The configuration file of this feature is on your personal drive, also known as U:drive. On Linux you find it usually at ~/network_drives/home/).
It needs to be located in the base directory and has to be named linux_home_links.yaml or .linux_home_links.yaml. (i.e. ~/network_drives/home/linux_home_links.yaml or ~/network_drives/home/.linux_home_links.yaml)
Below an example with a few different cases that either link to and/or copy files from you personal drive or from a git repository.
link:
# git
'.gitconfig':
to: 'network_drives/home/linux_config/gitconfig'
# vim
'.vimrc':
to: 'network_drives/home/linux_config/vimrc'
# emacs
'.config/emacs/init.el':
to: 'network_drives/home/linux_config/emacs_init.el'
# MATLAB
'.matlab':
to: 'network_drives/home/matlab_config
# Bash
# linking does not work as the shell is started before the mount are ready
# so better use the copy feature
copy:
'.bashrc':
from: 'network_drives/home/linux_config/bashrc'
download:
# or you have something in git to download using a token
'.config/tool.config':
from: 'https://3456...3342@gitea.psi.ch/muster_t/linux_config/tool.config'
To apply changes in the file immediately or if you think they were not activated for some reason use the following command:
systemctl --user restart create-automatic-links-in-home.service
exec bash
Otherwise the changes will be applied automatically on the next login or when you connect via shell (e.g. ssh or become) to the system.
Note that if the intended symlink location already exists (e.g .ssh), then it will keep the file or directory. However an already existing symlink will be updated!
The copy and download feature will always overwrite an existing file. And you only can configure individual files with those.
The link feature has the advantage that changes are immediately reflected on all other systems. But it depends on stable network connectivity which you may not always have, e.g. with a laptop. Therefore we usually recommend to use copy instead of link.
When using the copy or download feature then network connectivity only needs to be available initially and on the first connect after the source file has been changed. However, you need to be aware of that changes on the local (destination) files do not propagate automatically to other systems and might get reset on the next login! So you need to do these changes always also on the source file on the U: drive or in the download source.
!!! note
If you connect via ssh or use become, the shell itself starts and reads its configuration before any configuration file is copied in. So if your current e.g. bash needs an updated configuration run exec bash.
Troubleshooting
If you believe something went wrong, have a look at your log:
$ journalctl -S today
...
Nov 22 14:11:44 lxdev08.psi.ch systemd[1940551]: Starting Create links in home according to U:\linux_home_links.yaml...
Nov 22 14:11:44 lxdev08.psi.ch create-automatic-links-in-home[1940731]: error processing '.bashrc': [Errno 17] File exists: 'network_drives/home/linux_config/bashrc'
Nov 22 14:11:44 lxdev08.psi.ch systemd[1940551]: Finished Create links in home according to U:\linux_home_links.yaml.
...
$
or check the status of the (user) service:
systemctl --user status create-automatic-links-in-home.service