Autofs. Share your experience

Hi abishai ,

I've never seen this problem before. I don't want to hijack the thread, but what version of dsbmd are you using? Maybe there is an unresponsive device which is polled by dsbmd. If you're using dsbmd >= 0.3, you can disable polling by setting poll_interval = 0 in /usr/local/etc/dsbmd.conf, and see if the problem persists.
I use latest version available in ports, to it is > 0.4 I suspect the problem is gvfs node for compatibility with posix applications.
Code:
/dev/fuse on /home/abishai/.gvfs (fusefs, local, nosuid, synchronous, mounted by abishai)
I think, ~/.gvfs enumeration should be disabled in dsbmd. gvfs tries to mount this folder if user has necessary rights (write access to /dev/fuse and vfs.usermount).
 
when i plug a usb stick with ntfs file system ,i cant open it in KDE4(dolphin file manager) ,i get the error :
image.jpg

(have already done the above instructions) the only way to mount it manual is with the command :
Code:
ntfs-3g /dev/da0s1 /mnt/flash
still cant see it in file manager but i can see files in /mnt/flash
any way to fix this(skip executing the command) ?

my rc.conf :
Code:
sshd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"
dbus_enable="YES"
hald_enable="YES"
kdm4_enable="YES"
ipv6_network_interfaces="none"
ipv6_activate_all_interfaces="NO"
ip6addrctl_policy="ipv4_prefer"
ip6addrctl_enable="NO"
autofs_enable="YES"
portmap_enable=YES
portmap_flags="-h 127.0.0.1"
amd_enable=YES
amd_flags="-a /.amd_mnt -c 10 -w 2 -l syslog /host /etc/amd.map"
fusefs_enable="YES"

have tryed as well with
Code:
#hald_enable="YES"
should i make it
Code:
hald_enable="NO"
?
 
ntfs is not supported. So it seems it is not possible to mount it with autofs, as far as I know (I've never tried.).
Only fat32 and devices with mtp support. So just use fat32 on your flash drives for compatibility with FreeBSD and Windows machines.
 
Last edited by a moderator:
thank you both for your comments ,i have to figure how trueOS has done it,their automount works fine with fat32 and ntfs
 
Checked /etc/autofs/special_media and found that ext2fs(5) also seems to be supported
(ext2fs.ko kernel module should be loaded). As well as "exfat" (but sysutils/fusefs-exfat should be installed).
Didn't find out it before, because I don't use Windows or GNU/Linux anywhere. Added to the first post in this topic.
 
Yes, ntfs can be mounted with autofs. /etc/autofs/special_media handles it. But sysutils/fusefs-ntfs has to be installed and fuse.ko has to be loaded.

Yes, for me, it works out of the box; my external memory storage has never failed to be mounted :), and my secondary hard drive, with a NFTS partition, is correctly automounted as well
 
found that ext2fs_load="YES" , causes my fat32 usb sticks not working with autofs
error.jpg


automounting works ,everything is mounted in the /media/daXXsXX
but i cant write on ntfs.

fusefs-ntfs is installed
fuse.ko is loaded
Code:
$ kldstat
Id Refs Address            Size     Name
 1   63 0xffffffff80200000 1f67a88  kernel
 2    1 0xffffffff82169000 4d18     coretemp.ko
 3    1 0xffffffff8216e000 1a8c8    fuse.ko

any ideas?
 
Last edited:
OK, forgive my problem that is opposite to everyone else's o_O I would like to NOT mount the ntfs volumes in my workstation because I dual-boot with windows and have no need to have these disks mounted while I am in FreeBSD. I have read the man page on auto_master() but am probably doing this wrong. Is there a configuration that prevents automounting of certain disks? It appears the "-null" parameter or flag I read about in the auto_master() documentation can do this but it is not clear how. I don't have an issue with mounting these drives but boot takes forever because it appears the drives are being checked for consistency and I do not need this to happen.

Thanks in advance.
 
I thought of that, good old occam's razor :). I didn't do it because automount is a dependency but maybe I am confusing autofs and automount. 2 separate things?

Thanks Iluxa.
 
For me autofs does not work at all. I do

#service hald stop
#service automount onestart
#service automountd onestart
#service autounmountd onestart
#cd /media
#ls

and this is what I get:

Code:
WARNING: autofs_trigger_one: request for /media/ completed with error 5
WARNING: autofs_trigger_one: request for /media/ completed with error 5
WARNING: autofs_trigger_one: request for /media/ completed with error 5
WARNING: autofs_trigger_one: request for /media/ completed with error 5
WARNING: autofs_trigger_one: request for /media/ completed with error 5

When I plug in an USB-Stick nothing happens, output looks like this:

Code:
$ mount
/dev/ada0p2 on / (ufs, local, soft-updates)
devfs on /dev (devfs, local, multilabel)
/dev/ada1p2 on /Disk2 (ufs, local, soft-updates)
fdescfs on /dev/fd (fdescfs)
procfs on /proc (procfs, local)
linprocfs on /compat/linux/proc (linprocfs, local)
tmpfs on /tmp (tmpfs, local)
map -media on /media (autofs)
/dev/fuse on /usr/home/werner/.gvfs (fusefs, local, nosuid, synchronous, mounted by werner)

My /etc/auto_master looks like this:

Code:
$ more /etc/auto_master
# $FreeBSD: releng/11.1/etc/auto_master 310007 2016-12-13 04:44:06Z dteske $
#
# Automounter master map, see auto_master(5) for details.
#
#/net           -hosts          -nobrowse,nosuid,intr
# When using the -media special map, make sure to edit devd.conf(5)
# to move the call to "automount -c" out of the comments section.
/media          -media          -nosuid
#/media -fstype=cd9660 :/dev/cd0
#/-             -noauto

I would like to automount optical media, too, so would the outcommented line be OK?
 
For me autofs does not work at all. I do

#service hald stop
#service automount onestart
#service automountd onestart
#service autounmountd onestart
#cd /media
#ls

All you need to do, to make it work:
1. Uncomment media line in /etc/auto_master.
2. Add autofs_enable="YES" to /etc/rc.conf.
3. Reboot.

Also it is possible to add sysutils/fusefs-simple-mtpfs support to autofs, check this.
 
The media line was already uncommented, please have another look at my original post. I also tried adding some options like suggested in the other thread to make it look like this:

Code:
$ more /etc/auto_master
# $FreeBSD: releng/11.1/etc/auto_master 310007 2016-12-13 04:44:06Z dteske $
#
# Automounter master map, see auto_master(5) for details.
#
#/net           -hosts          -nobrowse,nosuid,intr
# When using the -media special map, make sure to edit devd.conf(5)
# to move the call to "automount -c" out of the comments section.
/media     -media    -nosuid,-m=770,-L=en_US.UTF-8
#/media -fstype=cd9660 :/dev/cd0
#/-             -noauto
$

Please note that the media line is uncommented, just as above. I also added autofs_enable="YES" in my /etc/rc.conf and set hald_enable="NO", and rebooted, but this is just the same as starting the services manually. In console mode (without starting X) I also realized the following message in addition to the one originally stated above:

failed to handle special map "-media".
 
For me it works as described above,
so I don't know why it's not working for you...
Just a guess, is /media directory exist in your system?
after adding all settings, your mount output should be similar:
sGm8TNs.png


You don't need to launch something manually after adding autofs_enable="YES" to /etc/rc.conf.
 
Just a guess, is /media directory exist in your system?

Of course it does, without it HAL would not work either. I do get the same output as you when I do a $mount. But what I am saying is that when I plug in a USB-Stick or a CD, nothing happens. They should be listed in &mount, too, right? And they should appear in the media directory also, but they don't. When I do a &ls /media nothing is in there.

I can only tell you this: My system has always been updated with freebsd-update since the first fresh installation years ago with 9.0 or even 8.x, I don't remember now. But that should not be a problem, I hope. My output is:

Code:
$ uname -a
FreeBSD amd64.my.domain 11.1-RELEASE-p4 FreeBSD 11.1-RELEASE-p4 #0: Tue Nov 14 06:12:40 UTC 2017     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
 
Try this, it may help, may be you got device permissions problems.
This is what I use, create /etc/devfs.rules with
Code:
[system=10]
[b]add path 'da*'          mode 0660[/b]
add path 'mmcsd*'       mode 0660
add path 'pass*'        mode 0660
add path 'xpt*'         mode 0660
add path 'ugen*'        mode 0660
add path 'usbctl'       mode 0660
add path 'usb/*'        mode 0660
add path 'fd/*'         mode 0660
inside

And add
Code:
devfs_system_ruleset="system"
to /etc/rc.conf.

("add path 'da*' mode 0660" is your USB flash drives permissions)

Your user should be in operator and wheel group.
Execute
# pw groupmod wheel -m yourusername
and
# pw groupmod operator -m yourusername

Then relogin and execute # service devfs restart.
 
Last edited by a moderator:
This is what I use, create /etc/devfs.rules with
Code:
[system=10]
add path 'da*'          mode 0660

ILUXA actually adding add path 'da*s*' ( add path 'da*p*' for flash drives containing a BSD slice) sort many issues out in my case, whereas bare 'da*' had failed granting me write permissions on automounted devices.


All things considered I have to say I'm satisfied with autofs. With FUSE I automount mount EXT4 -ro, exFAT USB stick and NTFS external drive -rw without issue. I can also mount HFS using sysutils/hfsutils, when I boot in someone's Mac through a USB stick. Only my XFS Linux-home partition l ends up being umountable on desktop, but really, no harm done.


However, despite having thoroughly looked auto_master(5) over, I still don't know whether I managed to understand or not how it works for real (mountpoints, direct/indirect/special maps). For example, does specifying a custom mountpoint in /etc/auto_master require a custom map? I specified -media as special map since it seemed the most obvious choice, but then apparently no change was applied and /media remained always as automount point even when the corresponding entry in auto_master was commented.

I ended up giving ownership for /media to my standard user and creating a simlink on desktop pointing to it.

It a long time now (years), I'm doing this that way, and I'm fine as lonh as it works, but I was looking for a more proper solution...do if anyone is so kind to enlight me on that I would definitely appreciate it :)
 
There is no need to add 'da*s*', it should work OK with 'da*' with all USB flash drives.
Well then, guess it was some wrong permission set the first time I tried. It was a long ago, and I was a beginner, I've never tried to see whether simple da* would have worked ir not from that moment on.
By the way, have you ever tried setting a custom mount point, preferably inside /usr/home/user?
 
Back
Top