- in Deutsch | - in English |
- Automounter 1 4 – Automatically Mount Network Shares Traded
- Mac Os Automatically Mount Network Drive
- Automounter 1 4 – Automatically Mount Network Shares Buy Or Sell
In This tutorial we will show you How to automatically mount/unmount a SMB/CIFS Windows share on a CentOS/Fedora/RHEL server. AutoMounter 1.4 – Automatically mount network shares. February 12, 2017 AutoMounter is a sleek and powerful menu item for automatically mounting your network shares. Just a heads up, I am moving away from autofs. I recently migrated to a Synology NAS and adapted all this to mount my NAS volumes. Recently after the MacOS 10.15.4 update, the automount process is running frequently, and leaving hundreds of mounts open (and breaking current mounts while re-mounting) making the autofs solution impossible to use.
The Automounter is a service (consisting of automount/autofs), to mount file systems automatically. Mounting is performed when accessing the configured directories. Unmounting is performed by default after 5 sec. of inactivity (depending on the used image). On Dreamboxes the service is used to access network shares. The shares can be accessed over cifs and/or nfs.
After mounting the share it's possible to play supported movies, music and images. The network shares can be on Dreamboxes, Linux computers, Macs, NAS and Windows computers.
Advantage of the automounter: no scripts, editing of the fstab or boot settings are required.
- 4Configuring the Automounter
- 4.1Configuration via Automount Editor
- 4.1.1Example CIFS Mount
- 4.1.2Example NFS Mount
- 4.2Configuration via configuration file
- 4.2.1Example CIFS mount
- 4.2.2Example NFS mount
- 4.1Configuration via Automount Editor
- 5Interesting shell commands for the automounter
- 5.1Examples for an Enigma2 based Dreambox up to OE 2.0
- 5.2Examples for an Enigma2 based Dreambox since OE 2.2
Functionality Automounter
For the preamble Automount Mounter, two files are important, autofs and automount. Autofs defines the mount points using the auto.master file. Afterwards the mounting is performed by automount.
Goal of the article
- Learn the configuration of the Auto Mounter
Prerequisites
- Knowing the Blue Panel (Automount - Editor) and the remote control
- Editing the configuration file with an unix compatible editor
Configuring the Automounter
There are 3 ways to configure the automounter.
- The Automount Editor of the BluePanel
- Or editing the configuration file
- With the GP3 Plugin and the installed Netscan Plugin, Samba and NFS shares can be found and passed to the Automount Editor.
Configuration via Automount Editor
The Automount Editor is available in Enigma since Gemini Project 1.9 and in Enigma2 since Gemini Project 3.2 in the Blue Panel.
- With Enigma (since version 4.5) the Automount-Editor can be found in the Blue Panel under Extras / Settings => Automount
- With Enigma2 (since version 4.1) under Settings => Automount Editor
- With the installed GP3 Plugin under Blue Panel => Settings => Automount Editor
After configuring the mount point, the box or the autofs Daemon needs to be restarted. When using the Automount Editor of the GP3 Plugin, this is no longer required. After closing the editor, autofs is restarted automatically. |
Example CIFS Mount
Example of a cifs mount.
The settings need to be changed according to your situation.
The settings need to be changed according to your situation.
Automount Editor GP3 Plugin | Automount Editor GP2 | Automount Editor GP |
description of the settings
Name
Enter the name of the device (e.g. sound). The autofs daemon creates a directory with the selected name.
The path of the directory is saved in the file auto.master.
Read: Accessing the mount point.
Enter the name of the device (e.g. sound). The autofs daemon creates a directory with the selected name.
The path of the directory is saved in the file auto.master.
Read: Accessing the mount point.
Attention: if using multiple mounts, the name (mount point) should always be different.
Typ
selection of the protocol CIFS.
selection of the protocol CIFS.
Parameter
Options for the mount.
Options for the mount.
Server
IP address of the source device.
IP address of the source device.
Share
Enter the name of the shared directory.
Attention, with Enigma2 there shouldn't be a / (Slash) entered at the beginning!
Enter the name of the shared directory.
Attention, with Enigma2 there shouldn't be a / (Slash) entered at the beginning!
read / write buffer
The options rsize and wsize define the size of the data packages, which are exchanged by the client and server.
The options rsize and wsize define the size of the data packages, which are exchanged by the client and server.
User
Enter the user name of for the access on the source device.
Enter the user name of for the access on the source device.
Password
Enter the password for the access on the source device.
Enter the password for the access on the source device.
Charset (utf8)
Sets the character encoding onto utf8, useful for special characters.
Sets the character encoding onto utf8, useful for special characters.
Example NFS Mount
Example of a nfs mount.
The settings need to be changed according to your situation.
The settings need to be changed according to your situation.
Automount Editor GP3 Plugin | Automount Editor GP2 | Automount Editor GP |
description of the settings
Name
Enter the name of the device (e.g. sound). The autofs daemon creates a directory with the selected name.
The path of the directory is saved in the file auto.master.
Read: Accessing the mount point.
Enter the name of the device (e.g. sound). The autofs daemon creates a directory with the selected name.
The path of the directory is saved in the file auto.master.
Read: Accessing the mount point.
Attention: if using multiple mounts, the name (mount point) should always be different.
Typ
selection of the protocol NFS.
selection of the protocol NFS.
Parameter
Options for the mount.
Options for the mount.
Server
IP address of the source device.
IP address of the source device.
Share
Enter the name of the shared directory.
Attention, with Enigma2 there shouldn't be a / (Slash) entered at the beginning!
Enter the name of the shared directory.
Attention, with Enigma2 there shouldn't be a / (Slash) entered at the beginning!
read / write buffer
The options rsize and wsize define the size of the data packages, which are exchanged by the client and server.
The options rsize and wsize define the size of the data packages, which are exchanged by the client and server.
Accessing the mount point
The access of the created mount point depends on the Gemini version. The easiest way is to use the File Mode (Enigma), or the File Manager (Enigma2).
- For Enigma boxes the mount point can be found in the directory /automount.
- For Enigma2 up to GP version 3.8 the mount point is in /automount. From version 3.9 till 4.1 it can be found in /autofs. And from GP2 4.2 until GP3.2 in /media/net.
- Since Gemini Project 3.3 for OE 2.2 the mount points are in /media/network.
Configuration via configuration file
The configuration file of the automounter for CVS Boxes can be found in /var/etc and for OE Boxes in /etc (CVS/OE Boxes see here). Here you can find also the different files depending on the image version. The syntax remained the same.
- With Enigma the file name is automount.conf. The configuration is possible since Gemini Project 3.1.
- With Enigma2 the file name is automount.conf for Gemini Project 1.8 - 3.8. Since version 3.9 - 4.1 the file name is auto.hotplug. And from version 4.2 until GP 3.2the name is auto.network.
- Since Gemini Project 3.3 for OE 2.2 the file name is auto.gemini.
The permissions with OE 2.0 / OE 2.2 images should be 644. The file shouldn't be executable! You can change the permission with the command chmod 644 /etc/auto.network. |
After the creation of a mount point, the Box or the autofs daemon should be restarted. |
Automounter 1 4 – Automatically Mount Network Shares Traded
Example CIFS mount
Example of a cifs mount.
The settings need to be changed according to your situation.
The settings need to be changed according to your situation.
description of the settings
Name
Enter the name of the device (e.g. sound). The autofs daemon creates a directory with the selected name.
The path of the directory is saved in the file auto.master.
Read: Accessing the mount point.
Enter the name of the device (e.g. sound). The autofs daemon creates a directory with the selected name.
The path of the directory is saved in the file auto.master.
Read: Accessing the mount point.
Attention: if using multiple mounts, the name (mount point) should always be different.
-fstype=
selection of the protocol CIFS.
selection of the protocol CIFS.
rw,soft
Options for the mount.
Options for the mount.
user=user_name
Enter the user name of for the access on the source device.
Enter the user name of for the access on the source device.
pass=password
Enter the password for the access on the source device.
Enter the password for the access on the source device.
rsize=8192,wsize=8192
The options rsize and wsize define the size of the data packages, which are exchanged by the client and server.
The options rsize and wsize define the size of the data packages, which are exchanged by the client and server.
iocharset=utf8
Sets the character encoding onto utf8, useful for special characters.
Sets the character encoding onto utf8, useful for special characters.
://192.168.1.10
IP address of the source device.
IP address of the source device.
/sound
Enter the name of the shared directory.
Attention, with Enigma2 there shouldn't be a / (Slash) entered at the beginning!
Enter the name of the shared directory.
Attention, with Enigma2 there shouldn't be a / (Slash) entered at the beginning!
Example NFS mount
Example of a nfs mount.
The settings need to be changed according to your situation.
The settings need to be changed according to your situation.
description of the settings
Name
Enter the name of the device (e.g. sound). The autofs daemon creates a directory with the selected name.
The path of the directory is saved in the file auto.master.
Read: Accessing the mount point.
Enter the name of the device (e.g. sound). The autofs daemon creates a directory with the selected name.
The path of the directory is saved in the file auto.master.
Read: Accessing the mount point.
Attention: if using multiple mounts, the name (mount point) should always be different.
-fstype=
selection of the protocol NFS.
selection of the protocol NFS.
rw,soft,tcp,nolock
Options for the mount.
Options for the mount.
rsize=8192,wsize=8192
The options rsize and wsize define the size of the data packages, which are exchanged by the client and server.
The options rsize and wsize define the size of the data packages, which are exchanged by the client and server.
192.168.1.15:
IP address of the source device.
IP address of the source device.
/video
Enter the name of the shared directory.
Attention, with Enigma2 there shouldn't be a / (Slash) entered at the beginning!
Enter the name of the shared directory.
Attention, with Enigma2 there shouldn't be a / (Slash) entered at the beginning!
Accessing the mount point
The access of the created mount point depends on the Gemini version. The easiest way is to use the File Mode (Enigma), or the File Manager (Enigma2).
- For Enigma boxes the mount point can be found in the directory /automount.
- For Enigma2 up to GP version 3.8 the mount point is in /automount. From version 3.9 till 4.1 it can be found in /autofs. And from 4.2 until GP 3.2 in /media/net.
- Since GP3 3.3 for OE 2.2 in /media/network.
Interesting shell commands for the automounter
With Enigma the automounter offers the options {start|stop|restart}. The script has the name autofs_script.sh |
Examples for an Enigma2 based Dreambox up to OE 2.0
Stop autofs
Start autofs
Restart autofs
Load the changed config file
Status query
Examples for an Enigma2 based Dreambox since OE 2.2
Stop autofs
Start autofs
Show status of autofs
Abgerufen von „http://wiki.blue-panel.com/index.php?title=Automount_(en)&oldid=18163“
English • 日本語
AutoFS is a program that uses the Linux kernel automounter to automatically mount filesystems on demand. It works with USB flash drives and external hard drives, network shares, CD-ROM/DVD/Blu-ray, and so on.
AutoFS works by monitoring directories on the local filesystem. Whenever a program tries to access one of those directories, AutoFS will mount something on that directory. The directories to monitor, as well as what to mount on them, are specified in the AutoFS configuration files such as /etc/autofs/autofs.master. Examples of how to configure AutoFS mounts are given down the page, under #Usage.
- 1Installation
- 2Configuration
- 2.1Service
- 2.2Files
- 3Usage
Installation
AutoFS requires a kernel module and a userspace program.
Note
To mount a filesystem (whether with AutoFS, or manually), the corresponding mount helper needs to be installed at the time of mounting. For example, sys-fs/ntfs3g or something equivalent is required to mount an NTFS filesystem. Some filesystems may also require changes to the kernel configuration. Check the wiki page for the specific filesystem to see what software and configuration will be required.
To mount a filesystem (whether with AutoFS, or manually), the corresponding mount helper needs to be installed at the time of mounting. For example, sys-fs/ntfs3g or something equivalent is required to mount an NTFS filesystem. Some filesystems may also require changes to the kernel configuration. Check the wiki page for the specific filesystem to see what software and configuration will be required.
Kernel configuration
The following kernel option activates the kernel functionality required for automounting.
Note
If the option is set to M, the partition that contains the module file must already be mounted before AutoFS can work.
If the option is set to M, the partition that contains the module file must already be mounted before AutoFS can work.
Userspace program
As with most Linux filesystems, in addition to the relevant option being enabled in the kernel, the userspace package must be installed to actually handle the mounting.
USE flags fornet-fs/autofsKernel based automounter
ldap | Install LDAP module |
libtirpc | Use TiRPC library instead of SunRPC |
mount-locking | Enable locking to prevent corruption of /etc/mtab in the presence of concurrent auto-mounting. If enabled, recursive auto-mounting (eg. using autofs to bind or loop mount a filesystem which is itself auto-mounted) is not possible. |
sasl | Enable SASL support in the LDAP module |
systemd | Enable use of systemd-specific libraries and features like socket activation or session tracking |
Data provided by the Gentoo Package Database · Last update: 2020-09-29 11:39 More information about USE flags
Install it with the following command:
Configuration
Service
The AutoFS daemon needs to be running for automounting to work.
OpenRC
Add AutoFS to the default runlevel:
1doc 1 1 2. To begin using the automounter before rebooting, start it manually:
Of course it is advisable to edit the configuration files first, as described below. If AutoFS is already running when the configuration is edited, run
to make it reload the configuration.
Files
The default installation of AutoFS provides the following four configuration files:
Mac Os Automatically Mount Network Drive
File | Description |
---|---|
/etc/conf.d/autofs | This file can be used to pass command-line options to the automount program. Most users will not need to edit this file. |
/etc/autofs/autofs.conf | This file defines some default parameters for AutoFS, such as the location of the master map file and the default timeout that causes an inactive mount to be disconnected. Most users will not need to edit this file. |
/etc/autofs/auto.master | This is the 'master map', effectively an index to the 'map files' and other resources that tell AutoFS what to mount and where. Most users will need to edit this file. |
/etc/autofs/auto.misc | This is an example of a 'map file' which is referenced by the master map. It specifies what to mount and where to mount it. Most users will need to edit this file. |
/etc/conf.d/autofs
/etc/conf.d/autofs is the configuration file that corresponds to the initscript /etc/init.d/autofs. For basic AutoFS usage, there is no need to modify this file.
The file defines two variables:
- USE_MISC_DEVICE: If this is set to
'yes'
, the initscript will create the device file /dev/autofs. - OPTIONS: This contains command-line arguments to be passed to
automount
. Runman 8 automount
to view the manual page which lists all the allowed options.
Note
automount
may be given one non-option argument, the filename of the master map, but for most users the default value (auto.master
) is fine. If you do want to change the master map filename, setting the master_map_name configuration variable in /etc/autofs/autofs.conf is probably a better way to do it. The rest of this page assumes the master map filename has been left at the default value./etc/autofs/autofs.conf
/etc/autofs/autofs.conf is AutoFS's own configuration file. The default installation is well commented, and the options that can be specified in this file are also documented in the manual page, which can be viewed by running
For basic AutoFS usage, there is no need to modify this file.
/etc/autofs/auto.master
/etc/autofs/auto.master is the (default) 'master map'. Each line describes an AutoFS mount.
Important
AutoFS does not use the terms 'mount' and 'mount point' in quite the same way as
AutoFS does not use the terms 'mount' and 'mount point' in quite the same way as
/bin/mount
or /etc/fstab.Typically, the lines in this file take the following format:
In brief,
mount-point
specifies a directory for AutoFS to watch, and map
that tells AutoFS what to mount there. For details, see #Usage below, or view the manual page by running man 5 auto.master
. Neither of these fields may contain spaces.After handling the first two (whitespace-separated) fields as
mount-point
and map
respectively, anything else on the line is treated as an option to be passed to either AutoFS's automount (if it starts with a dash), or mount (if it does not). Options passed to mount will follow the -o
switch. See #Usage for an example. Note
The comments in
The comments in
auto.master
say the format is key [ -mount-options-separated-by-comma ] location
. As of version 5.1.2, that is wrong. That format applies to entries in map files, such as /etc/autofs/auto.misc./etc/autofs/auto.misc
/etc/autofs/auto.misc is an example of a 'map file'. Only those map files actually referenced in the master map file are actually used by AutoFS, so it is safe to rename or delete this file as long as you edit /etc/autofs/auto.master to match. You can also create additional map files following the same syntax. By convention, map files are named with the pattern /etc/autofs/auto.*.
Lines in this file take the following format:
Here
key
specifies a unique key associated with the AutoFS mount, which forms part or all of the path at which the filesystem will be mounted. location
tells AutoFS what filesystem to mount there. -options
is a comma-separated list of options to pass to mount, except for some special options which are handled by AutoFS (such as fstype
). For details, see #Usage below, or view the manual page by runningUsage
AutoFS mounts are specified by lines in /etc/autofs/auto.master. As a reminder, lines in this file take the format
FILE
/etc/autofs/auto.master
Normally,
map
is the full path to a map file, such as /etc/autofs/auto.misc, which contains lines of the formatHere the
location
field takes the format host:path
. The host
component may be left empty to refer to a path on the local machine. Otherwise, the named path from the named remote host will be mounted using NFS.-master-options
and -map-options
are parsed as described above:-master-options
is a space-separated list of options to pass to either automount (if they begin with a dash) or mount (if not)-map-options
is a comma-separated list of options, most of which are passed to mount
There are two kinds of AutoFS mounts, direct and indirect.
Direct AutoFS mounts
For a direct AutoFS mount, the
mount-point
is /-
, and key
in the map file is the full path at which the filesystem will be mounted. For example, the manual pages for AutoFS include an example like this:FILE
/etc/autofs/auto.master
These lines tell AutoFS to watch the directory /tst/sbin. If a program tries to access anything in that directory, AutoFS will mount the directory
/usr/sbin
from the remote host bogus
on the local directory /tst/sbin
. In other words, it will effectively execute the commandAn example of mounting a local device might look like this:
FILE
/etc/autofs/auto.master
This will effectively execute the command
Indirect AutoFS mounts
For an indirect AutoFS mount, the
mount-point
is a directory path, and map
is the full path to a file which describes rules for mounting devices inside that directory. For example, the default installation includes the following line (though it is commented out):FILE
/etc/autofs/auto.master
This line would tell AutoFS to watch files and directories under /misc for filesystem accesses. When a program tries to access something under /misc, AutoFS will use the configuration in /etc/autofs/auto.misc to determine whether to automatically mount something. Each (non-comment, non-empty) line in that file corresponds to something that AutoFS will be able to mount under /misc. For example, the line
tells AutoFS to watch /misc/cd. When a program tries to access this directory, AutoFS will effectively run the command
root #
mount -t iso9660 -o ro,nosuid,nodev /dev/cdrom /misc/cd
Here are some other examples:
Indirect mounts allow AutoFS to use wildcards. For example, if users' home directories are stored on a different machine and mounted over NFS, AutoFS could be configured as follows:
FILE
/etc/autofs/auto.master
This way, when a user
foo
logs in and accesses some files in their home directory, AutoFS will effectively run the commandroot #
mount -t nfs neighborhood:/export/home/foo /home/foo
Useful options
These options can be given in the master map file.
--timeout=<seconds>
specifies the number of seconds that an automounted filesystem can go unused before AutoFS unmounts it.--ghost
orbrowse
(no dash in the latter form) can be useful for indirect mounts. It causes AutoFS to create the directory on which something would be mounted when the automount daemon starts up, rather than only when the directory is accessed.
For a full description of options, run
Non-file maps
In /etc/autofs/auto.master, instead of merely specifying
map
, the second column can take a more complicated form such as map-type:map
, which allows the map to be something other than a file. For instance, it can be an executable which prints out map specifications (the lines that would be included in a map file), or any of various types of databases. For a full description of recognized types, runSimple Windows-like Samba share mounting
Here is a way to automatically mount network Samba shares, as Windows does. This configuration allows automounting a share by issuing the following command in a shell:
or navigatint to /net/10.50.40.32/share in a filesystem browser or dialog. The files inside will appear as if they were located on the local machine.
Important
For this to work, Samba must be installed and configured prior to mounting.
For this to work, Samba must be installed and configured prior to mounting.
FILE
/etc/autofs/auto.smbm
External resources
Automounter 1 4 – Automatically Mount Network Shares Buy Or Sell
- Automount mini-Howto on The Linux Documentation Project website
- AutoFS page on the Ubuntu Community Help Wiki
Retrieved from 'https://wiki.gentoo.org/index.php?title=AutoFS/en&oldid=754276'