Manjaro Difference between revisions of "Using autofs (automount) with NFS"

Difference between revisions of "Using autofs (automount) with NFS"

From Manjaro
imported>DeMus
m (added languages and translate tags)
Line 1: Line 1:
 
<languages/>
=''' Autofs – Automount (en) '''=
__TOC__
<translate>
=Autofs – Automount (en)=


[[File:Manjaro-logo.png|left]]                       
[[File:Manjaro-logo.png|left]]                       
Line 6: Line 8:
<br clear="all"/>
<br clear="all"/>


= '''Autofs''' =
=Autofs=
Autofs is a program which makes it possible to mount external devices on demand. Other ways of mounting can be done with the use of a manual command for a temporary mount, or by using the /etc/fstab file if you want to mount a device permanently.
Autofs is a program which makes it possible to mount external devices on demand. Other ways of mounting can be done with the use of a manual command for a temporary mount, or by using the /etc/fstab file if you want to mount a device permanently.


Line 22: Line 24:
Another way of mounting on the fly is described on this wiki page: Fstab - Use SystemD automount [https://wiki.manjaro.org/index.php?title=Fstab_-_Use_SystemD_automount]
Another way of mounting on the fly is described on this wiki page: Fstab - Use SystemD automount [https://wiki.manjaro.org/index.php?title=Fstab_-_Use_SystemD_automount]


= '''Installation''' =
=Installation=
At the time of writing, the autofs version number was 5.1.3-1. It can be installed from the standard Manjaro repositories using Octopi, Pamac or Pacman.
At the time of writing, the autofs version number was 5.1.3-1. It can be installed from the standard Manjaro repositories using Octopi, Pamac or Pacman.
When you want to use autofs with nfs you need one extra package and that is nfs-utils. So, install that as well. The description calls it:
When you want to use autofs with nfs you need one extra package and that is nfs-utils. So, install that as well. The description calls it:
''support programs for the network filesystem''
''support programs for the network filesystem''


= '''Testing the mounts''' =
=Testing the mounts=
Before you will install and setup autofs it is a good thing to test if you can mount the device you want to mount.
Before you will install and setup autofs it is a good thing to test if you can mount the device you want to mount.


Line 50: Line 52:
When you see contents the mount has succeeded and we can now continue with the configuration of autofs.
When you see contents the mount has succeeded and we can now continue with the configuration of autofs.


= '''Terminal commands''' =
=Terminal commands=
Commands you can use are:
Commands you can use are:


Line 92: Line 94:
   Dec 02 08:27:27 Desktop-Jan systemd[1]: Stopped Automounts filesystems on demand.
   Dec 02 08:27:27 Desktop-Jan systemd[1]: Stopped Automounts filesystems on demand.


= '''Configuration''' =
=Configuration=
After installation we need to configure a few files specific to what we need and want. These files are placed in the folder: '''/etc/autofs'''.
After installation we need to configure a few files specific to what we need and want. These files are placed in the folder: '''/etc/autofs'''.
In fact there are 2 files needed: auto.master and auto.<any name you like>.
In fact there are 2 files needed: auto.master and auto.<any name you like>.
Line 133: Line 135:
This way I have one master file which, with one line, controls the base of the system and one file which controls all my shares. But again, this is totally up to you.
This way I have one master file which, with one line, controls the base of the system and one file which controls all my shares. But again, this is totally up to you.


= '''Explanation of auto.master''' =
=Explanation of auto.master=
This file is created when you install the autofs package. You will need to edit it to make it work for you. The complete file looks like this when created:
This file is created when you install the autofs package. You will need to edit it to make it work for you. The complete file looks like this when created:


Line 177: Line 179:
the complete path is now the sum of the path in the master file + the one in the shares file.
the complete path is now the sum of the path in the master file + the one in the shares file.


= '''Explanation of auto.shares''' =
=Explanation of auto.shares=
This file can have any extention name you like. Make it a descriptive one to easily find it, especially when you use more than one.
This file can have any extention name you like. Make it a descriptive one to easily find it, especially when you use more than one.
The line or lines in this file are all built according to this template:
The line or lines in this file are all built according to this template:
Line 210: Line 212:
This makes sure that mount stops immediately when the server is not reachable. If not, mount will keep trying for 2 minutes to reach the server and block the program which wants to reach the server.
This makes sure that mount stops immediately when the server is not reachable. If not, mount will keep trying for 2 minutes to reach the server and block the program which wants to reach the server.


= '''Remarks''' =
=Remarks=


* It is said that when you make a change in the shares file, the change will be active straight away. When changing the master file you need to restart the autofs.service like this:
* It is said that when you make a change in the shares file, the change will be active straight away. When changing the master file you need to restart the autofs.service like this:
Line 235: Line 237:
   29106 ?      00:00:00 rpc.statd
   29106 ?      00:00:00 rpc.statd


= '''The End''' =
=The End=
Much info on this page was taken from the German Manjaro wiki-page:
Much info on this page was taken from the German Manjaro wiki-page:
[https://wiki.manjaro.org/index.php?title=Fstab_-_Use_SystemD_automount_(de)] by '''Egle'''
[https://wiki.manjaro.org/index.php?title=Fstab_-_Use_SystemD_automount_(de)] by '''Egle'''


There are many webpages about autofs, with and without nfs. Just google it and you will find many different ways of setting it up. The way described here works for me and is pretty easy to setup.
There are many webpages about autofs, with and without nfs. Just google it and you will find many different ways of setting it up. The way described here works for me and is pretty easy to setup.
</translate>
[[Category:Contents Page{{#translation:}}]]
Cookies help us deliver our services. By using our services, you agree to our use of cookies.