GNOME Automount needs :
HAL
Polkit
FUSE
1) First, running Polikit-gnome in root mode, you must grant authorization to users to mount removable devices. If not, so you can see drives but may not mount them. Somewhere in the menu of Gnome 3 you should access to a shortcut to set this policy.
2) Second : HAL needs suitable policies in
/usr/local/etc/hal/fdi/policy
Duplicated mount points are created by HAL daemon which detects two nodes linked to the same hardware.
Here is an example of policy file "22-ignore-mobile-drives.fdi", where I want to block auto-mounting of the first active DOS partition of some USB keys, holding each a second partition with a specific version of FreeBSD filesystem used as a "rescue key" to repair some suffering systems.
I must discard two times the DOS-AGTx partition because HAL detects the same device through two nodes :
info.product (generally the named assigned to the partition)
block.device (where we know more precisely the filesystem type with the path to /dev)
For the FreeBSD partitions named RSCxROOT, I just discard one time just to void the double mount point.
So the entry "block.device" is still visible and if I am not wrong available for automount
To list the current devices detected by HAL use the command
lshal
Code:
<?xml version="1.0" encoding="utf-8"?>
<!--
################################################################################
# # # FreeBSD 11.0 : HAL Policy File #
# -=== x ===- #
# #
# In<= /usr/local/etc/hal/fdi/policy #
# Owner= 0:0 #
# Rights= 444 #
# Repo= Parameters/FreeBSD/HAL #
# #
################################################################################
-->
<deviceinfo version="0.2">
<device>
<match key="info.product" string="DOS-AGT">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</device>
<device>
<match key="info.product" string="DOS-AGT0">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</device>
<device>
<match key="info.product" string="DOS-AGT1">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</device>
<device>
<match key="info.product" string="DOS-AGT2">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</device>
<device>
<match key="info.product" string="BACKUP">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</device>
<device>
<match key="info.product" string="FBSDSRC">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</device>
<device>
<match key="info.product" string="RSC0ROOT">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</device>
<device>
<match key="info.product" string="RSC1ROOT">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</device>
<device>
<match key="info.product" string="RSC2ROOT">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</device>
<device>
<match key="block.device" string="/dev/msdosfs/DOS-AGT">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</device>
<device>
<match key="block.device" string="/dev/msdosfs/DOS-AGT0">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</device>
<device>
<match key="block.device" string="/dev/msdosfs/DOS-AGT1">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</device>
<device>
<match key="block.device" string="/dev/msdosfs/DOS-AGT2">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</device>
<device>
<match key="block.device" string="/dev/label/FreeBSD-Backup">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</device>
</deviceinfo>
Another "more easy" example in "21-ignore-internal-drive.fdi" where I want to make invisible any internal drive from automount section, to void as much as possible users' mistakes on critical drives.
(Each fdi file begins with a number, this number defines the priority rank of process for the given rules)
According to this code, all things not designated by HAL as removable or hot pluggable are presumably "internal" and forbidden.
We don't need to specify the filesystem type.
Code:
<?xml version="1.0" encoding="utf-8"?>
<!--
################################################################################
# #
# FreeBSD 11.0 : HAL Policy File #
# -=== x ===- #
# #
# In<= /usr/local/etc/hal/fdi/policy #
# Owner= 0:0 #
# Rights= 444 #
# Repo= Parameters/FreeBSD/HAL #
# #
################################################################################
-->
<deviceinfo version="0.2">
<device>
<match key="@block.storage_device:storage.hotpluggable" bool="false">
<match key="@block.storage_device:storage.removable" bool="false">
<merge key="volume.ignore" type="bool">true</merge>
</match>
</match>
</device>
</deviceinfo>
HAL is able to automount natively UFS, FAT, FAT32 filesystem
For NTFS, I can't exactly remember, one need probably to create a fdi rules.
Thing is a little harder because if we want a read/write automount, we need to tell HAL to use fuse ntfs-3G, rather than built-in FreeBSD command :
mount -t ntfs
I have not enough "skills" for that and I have personally not spent a lot of time, because automouting NTFS is a mistake.
NTFS is a journalised filesystem, and journal is only handled by the native OS, writing through fuse could break the journal with a possible loss of data.
So we can mount a NTFS partition in Read/write mode with few risks only if the journal is empty
This will be the case if NTFS partition have been only used by *nix machines
So regarding NTFS it's better to let the user decide what to do.
The sole interesting question should be to implement a fuse exFAT automount
GVFS hardware mount point are located in
/media
3) For network shares automount, except mistakes, HAL is not used, this is handled directly by GVFS through a mountpoint located in the user's directory, something like
~/.gvfs
CONCLUSION :
In a marvelous world HAL should disappear from FreeBSD as it is a "Linuxism", to let DEVD do the job alone.
Also "dbus" should disappear, causing from time to time some stability issue.
In BSD world you will encounter a lot of issues of this type as it is a result of some adaptation of Linux mechanism, not fitting perfectly with some BSD principles.
All the FreeBSD community prays for the fast development of the young desktop, Lumina, a native BSD desktop, not a Linux adaptation, but there is still a lot to do and I am not always sure they take the good decisions.