You are not logged in.

#1 2020-07-28 14:04:47

ezacaria
Member
Registered: 2007-12-10
Posts: 113

[Solved] udevil/devmon not creating mount point (drive with exfat)

I am setting up automounting of USB drives on a small, headless server, and ran into an issue with non-existant mountpoints. To my surprise, neither devmon nor udevil attempt to create an unexisting mounting point.

The configuration file (/etc/udevil/udevil.conf) contains a valid entry: "allowed_media_dirs = /media, /run/media/$USER".

By using the "--verbose" option, it is clear that udevil instructs the mount command to use, e.g., "/media/sdc1-usb-NORELSYS_106X_01" as mounting point. If this does not exist, then it fails with "mount exit status = 1". It does not make any difference if I run the command as root.

On the other hand, if the root creates the directory beforehand, then the udevil mount command succeeds (same when devmon calls udevil). I've been looking at the documentation and sources of udevil and devmon, but could not understand if either any of them is supposed to create the mounting point before mounting.

While it is true that I could create mounting points for a combination of enclosures and USB ports, I would rather have them created automatically (like thunar-volman or other helpers do within DEs).

I looked at old posts in the forum, but I could not find anything relevant, as in my case no attempt is made by udevil or devmont to create the mountpoint. I would rather use udevil instead of, e.g., udiskie, to keep the server lean and simple.

Last edited by ezacaria (2020-07-30 12:21:10)

Offline

#2 2020-07-30 12:17:59

ezacaria
Member
Registered: 2007-12-10
Posts: 113

Re: [Solved] udevil/devmon not creating mount point (drive with exfat)

As it turns out I was wrong smile

The problem was really elsewhere. I followed a debug-enabled version of udevil, and came to the conclusion that the problem is with exfat-utils (the drive is formatted with exfat).

Ultimately, udevil failed because it creates a small file inside the mounting point ("tag mount point created by udevil", lines 4187-4190 of udevil.c), and exfat-utils does not honor the "nonempty" option (it seems to be ignored, at least with 1.3.0-2, which is currently available).

One solution is to rely on the kernel module, which requires modifying /etc/udevil/udevil.conf (as reported in this issue:

  • Remove exfat-utils. If needed for something else than udevil, consider using exfat-utils-nofuse from AUR.

  • Take out the "nonempty" option within "default_options_exfat", in /etc/udevil/udevil.conf.

  • (make sure the exfat kernel module is loaded, but mount is doing so automatically with the standard Arch Kernel)

Finally, I enabled the devmon service for the non-priviledged user, and now the exfat-formatted drive is automatically mounted. Moreover, I have so far some fair performance with the kernel driver (writes about 140 MB/s over USB3 for large files, which is enough in my case, as the data are coming over sshfs and the bottleneck is on the 1gbps ethernet link).

Offline

Board footer

Powered by FluxBB