Automounting home directories

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

Automounting home directories

Postby mla » Oct 5th, '19, 13:58

Here's one for Linux wizards! :-) I would like to automount home directories on all our machines. Technically, not an issue (not any longer! -- I had severe technical problems trying it a few years back). But here's a desktop-level problem , which I am scratching my head over. Different machines have different screen sizes and resolutions, which screws up my desktop icon groupings. Plus, family likes to have different desktop backgrounds on different machines.

As far as I can see, I need .kde and .local to be machine specific. How do I achieve that?

I tried the simplistic approach of symlinking the appropriate host-named directores in .bash_profle (rm -f .kde;ln -s $HOSTNAME.kde .kde), but that does not work -- KDE gets there first. I could set them up as symbolic links to somewhere in the local /opt (havent' tried that one yet), but that seems inelegant, creating /opt user dependencies.

Is there a smart way of doing this?
mla
 
Posts: 263
Joined: Sep 16th, '11, 16:10

Re: Automounting home directories

Postby wintpe » Nov 4th, '19, 01:30

yes when you create your automount map files you can use variables in the paths to the home.
this would allow you to use something like $hostname in the automount nfs path, to home.

for example on machine xxx peter logs in and his home path is set to server:/home/$user/$hostname that resolves to server:/home/peter/xxx

inside xxx on the server you can have symbolic links to everything like docs being common across all machines.

but the . files can all be real files for that machine.

i have posted a while back how to setup automount so just search for it.

heres the clips from it, thats relevant

make an entry in /etc/autofs/auto.master of
/home /etc/autofs/auto_home.

then in /etc/autofs/auto_home place the following.

fred fileserever:/local/home/fred
joe fileserver:/local/home/joe

idealy use nis or ldap to serve the automaps from a single place , but you can do it locally until you get it right.

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1190
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: Automounting home directories

Postby mla » Nov 4th, '19, 13:32

Thanks, Peter. Autofs automounting is something I gave up on the last time I tried this (in 2014), because systemd did not play well with it. At the time, I also hit problems with systemd's own automounting via fstab, but that problem is gone now and hence I use the systemd/fstab method on the (false?) assumption that autofs is deprecated.

I'll try autofs again and see how that goes.

(BTW, replacing .local and .kde with symbolic links to files held on a local partition works fine, of course -- I just dislike the extra dependency. The autofs solution you suggest is neater.)

Mike
mla
 
Posts: 263
Joined: Sep 16th, '11, 16:10


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest