Solved Stopping automounter

I have automounter installed but am unable to stop it using

service automountd stop

This stops the service, if I remove a USB stick and reinsert it, it gets automounted again.

How do I get it to stop?
 
There may be hooks in devd stuff, check /etc/auto_master, /etc/devd.conf.
There may also be a service named "automount" you need to stop too.
If this is happening in a Desktop Environment, there may be settings somewhere, especially if there is a "file manager" in use.
It looks like the variable is autofs_enable so make sure to set that to no or something in /etc/rc.conf

It looks like autofs_enable is defaulted to "NO" in /etc/defaults/rc.conf, so the services should not be running by default.
 
I ran service automount stop as suggested, but it hasn't made any difference.

I'm still unable to prevent USB sticks being automounted.

It looks like the existance of automount utilities is causing me some confusion.
 
Might be some confusion here, if you installed the pkg/port "automounter", then the correct way to stop it is
service automounter stop
Notice it's "automounter", not "automountd". The package also installs hooks in local/etc/devd which make calls back to automounter, I'm not sure how these react when automounter isn't running though.

This comment only applies if you installed the pkg/port "automounter", disregard otherwise.
 
Code:
undefinedroot@X1:~ # service automounter stop                                                                                                                                                           
automounter does not exist in /etc/rc.d or the local startup                                                                                                                                   
directories (/usr/local/etc/rc.d), or is not executable

Looks like I haven't installed it, but I have installed automount, which I just tried to stop, but partitions continue to automount.

Following your suggestion, I just noticed a /usr/local/etc/devd/automount_devd.conf which I will check out, to get a better idea as to how this black magic works.
 
Did you do a pkg install of automount or installed something like DE pulled it in? Asking because I think automount is part of base (or at least is in 13.x), with config files in /etc.
But there is also an "automount" in ports/packages, at least for quarterly (my system where I know I did not install automount:
# pkg search automount automount-1.7.9 FreeBSD's devd(8) based automount solution automounter-1.5.1 Provides scripts to dynamically configure amd # pkg info | grep automount this returns nothing # which automount /usr/sbin/automount

package/port would explain something in /usr/local/etc/devd.
Do the pkg info | grep automount, see if you have it installed. If so, then see what
# pkg info -r automount
gives. If there are no dependencies, then simply do pkg delete automount.

My opinion:
And yes it is possible to completely disable automount; I find it annoying for things like USB drives. I prefer having entries in /etc/fstab and manually mounting them. Just make sure to have noauto in the options.
 
Interesting about the local automount_devd.conf you found, the default freebsd base doesn't include that file, nor does it have any sort of automount enabled. You can run
pkg which /usr/local/etc/devd/automount_devd.conf
to discover if the file was installed by a currently installed package in order to find out how this all came about. If it isn't installed by anything and it isn't doing what you want, you could move it to another location as a backup so that devd doesn't use it and see if that prevents the automounting.
 
Ahh that makes sense.
your "automount()" is what is in base, driven by files in /etc.
That port is basically a set of devd hooks to mount things.
I think you should be able to do:

pkg delete automount
service devd restart

to get rid of the automount stuff.
 
The sysutils/automount is a tool written by our honorable vermaden.
It is not a service. It does install a config file into /usr/local/etc/devd/automount_devd.conf and you're expected to edit that to your needs.

Update/correction: You're apparently not yet supposed to edit that, because vermaden should fix the makefile first ;)

Code:
--- a/sysutils/automount/Makefile
+++ b/sysutils/automount/Makefile
@@ -2,6 +2,7 @@ PORTNAME=       automount
 DISTVERSION=   1.7.9
 CATEGORIES=    sysutils
 MASTER_SITES=  https://raw.github.com/vermaden/automount/master/
+WRKSRC=                ${WRKDIR}
 
 MAINTAINER=    vermaden@interia.pl
 COMMENT=       FreeBSD's devd(8) based automount solution
@@ -9,7 +10,7 @@ WWW=           https://github.com/vermaden/automount/
 
 LICENSE=       BSD2CLAUSE
 
-PLIST_FILES=   sbin/automount etc/devd/automount_devd.conf etc/automount.conf.sample
+PLIST_FILES=   sbin/automount etc/devd/automount_devd.conf.sample etc/automount.conf.sample
 
 NO_BUILD=      yes
 NO_ARCH=       yes
@@ -29,7 +30,7 @@ EXFAT_RUN_DEPENDS=    fusefs-exfat>=0:sysutils/fusefs-exfat \
 do-install:
        ${INSTALL_SCRIPT} ${WRKDIR}/automount ${STAGEDIR}${PREFIX}/sbin
        ${INSTALL_DATA} ${WRKDIR}/automount_devd.conf \
-               ${STAGEDIR}${PREFIX}/etc/devd
+               ${STAGEDIR}${PREFIX}/etc/devd/automount_devd.conf.sample
        ${INSTALL_DATA} ${WRKDIR}/automount.conf \
                ${STAGEDIR}${PREFIX}/etc/automount.conf.sample
 
The sysutils/automount is a tool written by our honorable vermaden.
It is not a service. It does install a config file into /usr/local/etc/devd/automount_devd.conf and you're expected to edit that to your needs.

Update/correction: You're apparently not yet supposed to edit that, because vermaden should fix the makefile first ;)

The sysutils/automount is a tool written by our honorable vermaden.
It is not a service. It does install a config file into /usr/local/etc/devd/automount_devd.conf and you're expected to edit that to your needs.

Update/correction: You're apparently not yet supposed to edit that, because vermaden should fix the makefile first ;)


If it isn't a service, is there any way to temporarly disable it?

And does vermaden know the makefile needs fixing?
 
If it isn't a service, is there any way to temporarly disable it?
I don't think so. One would probably need to temporarliy remove that devd config file and somehow reload the devd.

And does vermaden know the makefile needs fixing?
It doesn't really need fixing. The piece is designed to do automounts for all kind of filesystems, apparently for desktop use, and to "just do it"(tm), in the fashion like e.g. Apple machines do work without need of configuration.
But I need it for something different: to mount my offsite backup sticks on the server. So I need to modify+configure it, to mount only a specific kind of stick, to utilize geli, to mount it onto a distinct place (inside the backup destination), and to report via syslog.
 
What I would like to be able to do, apart disabling it temporarily, is to mount ext2/3/4 partitions with mount -t ext2fs, rather than lklfusee. I don't know how to configure that.
 
If it isn't a service, is there any way to temporarly disable it?
Perhaps try using BLACKLIST or BLACKLIST_REGEX:
Code:
# /usr/local/sbin/automount -h
AUTOMOUNT is a devd(8) based automounter for FreeBSD.

It supports following file systems:
[...]
BLACKLIST (unset by default)
  The automount will ignore devices defined here.

  example: BLACKLIST='da0 da3s1a'


BLACKLIST_REGEX (unset by default)
  The boolean flag option complements the above BLACKLIST option
  if one wants regex match instead of exact match for ignoring devices.
  Below will ignore all partitions ada0p1/ada0p2/... of ada0 device.

  example: BLACKLIST='ada0'
           BLACKLIST_REGEX=true
 
It does install a config file into /usr/local/etc/devd/automount_devd.conf and you're expected to edit that to your needs.
;)
Hi,

the only thing that you could/should edit is the /usr/local/etc/automount.conf config.

No need to edit/modify /usr/local/etc/devd/automount_devd.conf file.

Regards,
vermaden
 
Hi,

the only thing that you could/should edit is the /usr/local/etc/automount.conf config.

No need to edit/modify /usr/local/etc/devd/automount_devd.conf file.

Regards,
vermaden
Not sure what this is supposed to do...

Code:
cat /usr/local/etc/automount.conf
USERUMOUNT=YES

What happens if you set it to 'NO'?
 
I'd guess it means "allow a user to unmount the device that was automounted" so NO would be "only root can unmount"
 
To disable automount, can I simply run service devd stop? That does actually work, but are there some unforeseen consequences of doing this?
 
To disable this automount, which from your OP sounds like it's what you want, I would do the following:
pkg delete automount -y
service devd restart
 
Also if I want to use ext
To disable this automount, which from your OP sounds like it's what you want, I would do the following:
pkg delete automount -y
service devd restart
I only want to temporarily disable it. ie toggle it on and off whenever I want to have personal control over mounting.
 
What I would like to be able to do, apart disabling it temporarily, is to mount ext2/3/4 partitions with mount -t ext2fs, rather than lklfusee. I don't know how to configure that.
Can I do this by changing /usr/local/sbin/automount to include the following:-

Bash:
     (${FS_TYPE_EXT4})                                                                                                                                                                             
        FS_CHECK_PORT='sysutils/e2fsprogs'                                                                                                                                                         
        FS_CHECK_CMD='fsck.ext4'                                                                                                                                                                   
        FS_CHECK_ARGS="-y"                                                                                                                                                                         
        FS_MOUNT_CMD='mount'                                                                                                                                                                       
        FS_MOUNT_ARGS="-t ext2fs"

instead of what is currently in place?
 
Back
Top