Re: [gentoo-user] autofs for a symlink - howto

2019-02-25 Thread Helmut Jarausch

On 02/24/2019 06:26:51 PM, Helmut Jarausch wrote:

Hi,

I have a lot of symlinks in my home directory like

$HOME/Python  -> /Src/Python

Now, I'd like to not mount /Src on default.

How can I set up my system (using autofs ?) to automatically mount  
/Src if such a symlink is accessed

like   cd$HOME/Python



Since I didn't find a similar configuration on the net, I've come up  
with the following solution (after some trial and error)


First, I've replaced all symlinks by empty directories of the same name.

My /etc/autofs/auto.master  contains (the only uncommented line)

/-/etc/autofs/auto.local

and /etc/autofs/auto.local contains, e.g.

/Src  -fstype=ext4,exec,suid,noatime  :/dev/sdc3

/home/jarausch/Python  -fstype=bind,exec,suid,noatime
:/Src/Src/Python



I hope this helps others,
Helmut


Re: [gentoo-user] autofs for a symlink - howto

2019-02-24 Thread Grant Taylor

On 2/24/19 10:26 AM, Helmut Jarausch wrote:
How can I set up my system (using autofs ?) to automatically mount /Src 
if such a symlink is accessed

like   cd    $HOME/Python

Many thanks for a hint,


Review some of the automount tutorials.  They will be geared towards 
NFS, but the same methodology should work for what I think you're 
wanting to do.


From memory (I don't have a system handy that I can check) autofs / 
automount (it goes by different names) has it's base config file, and a 
few files that are included for various examples.  You'll likely want to 
add another included file that specifies the paths that you want to 
automount.


As a bonus, automount will unmount the paths after a period of inactivity.



[gentoo-user] autofs for a symlink - howto

2019-02-24 Thread Helmut Jarausch

Hi,

I have a lot of symlinks in my home directory like

$HOME/Python  -> /Src/Python

Now, I'd like to not mount /Src on default.

How can I set up my system (using autofs ?) to automatically mount /Src  
if such a symlink is accessed

like   cd$HOME/Python

Many thanks for a hint,
Helmut