Enable Automount for external data carriers

External data carriers are not automatically integrated under TwinCAT/BSD in order to increase the security of the system. The Automount function is disabled ex factory. Normally, external data carriers must be actively and manually integrated into TwinCAT/BSD, but the settings are not permanently saved and must be mounted again after a restart.

This chapter describes how to automatically and permanently mount external data carriers, such as USB sticks, optical drives, or external hard disks, with devd-mount. The data carrier must use a file system that is recognized by FreeBSD, such as EXFAT, FAT32, FAT16, NTFS, UFS, ISO 9660 (CDs), UDF (DVDs).

Useful commands:

The access authorizations can be adjusted in the configuration file /usr/local/etc/devd-mount.conf. By default, read/write and execute permissions are granted for the user root and group operator. For all other users, only read and execute is permitted.

Requirements:

Proceed as follows:

1. Install the script devd-mount on the system with doas pkg install devd-mount
2. Restart the service devd after installation with doas service devd restart.
3. Connect the external data carrier to the industrial PC.
4. By default, the data carrier is mounted under /media with its device node designation, i.e. with the name with which the data carrier is listed under /dev.
If the data carrier is removed, the mount points are retained at /media. If the data carrier is reinserted in the meantime or after a restart, it is mounted again at the same position.

If an additional data carrier is mounted in the meantime and the original data carrier is reinserted, the device node designation may change and a data carrier is mounted at /media/da1 instead of /media/da0, for example.