Simple devd(8) based automounter for FreeBSD
Shell Makefile
Failed to load latest commit information.
sysutils Add shar(1) file for 1.4.3 release. Mar 13, 2013
README 1.3.1 Mar 19, 2012
automount-1.3.1.tar.gz 1.3.1 Mar 19, 2012
automount-1.4.3.tar.gz Rest of 1.4.3 version. Mar 13, 2013
automount-1.5.1.tar.gz Upload automount 1.5.1 tarball. Jan 26, 2015
automount-1.5.2.tar.gz Introduce smarter fstype() function to better determine filesystem. N… Jan 26, 2015
automount-1.5.3.tar.gz Add automount-1.5.3.tar.gz tarball. Feb 5, 2015
automount-1.5.5.tar.gz Add automount-1.5.5.tar.gz tarball. Jul 28, 2015
automount_devd_DEBUG.conf Implement BOOTDELAY option to wait for boot process to complete. Fix … Apr 3, 2013


automount is a devd(8) based automounter for FreeBSD.

It supports most popular file systems:


# cp        /usr/local/sbin/
# cp automount.conf      /usr/local/etc/automount.conf
# cp automount_devd.conf /usr/local/etc/devd/automount_devd.conf
# /etc/rc.d/devd restart

Now plugin Your USB thumb drive ;)



Fixed the 'detach' section (s/PREFIX/MNTPREFIX/g).
Fixed removing directories of manually (properly) unmounted filesystems.



Fixed inproper exFAT detection, now mounts fine.
Fixed creating mount dirs for attached devices no matter if needed or not.
Revised 'detach' section, now removes only directory that is unmounted.
Simplified FAT/NTFS sections, removed additional checks as they break
  some MP3 players automount.



Added the --help page.
Removed some small bugs.
Added more options to configure features.

% automount --help
AUTOMOUNT is a devd(8) based automounter for FreeBSD.

It supports following file systems:

It needs these ports to mount NTFS/exFAT/EXT4 respectively:
 o sysutils/fusefs-ntfs
 o sysutils/fusefs-exfat
 o sysutils/fusefs-ext4fuse

By default it mounts/unmounts all removable media but
it is possible to set some additional options at the
/usr/local/etc/automount.conf config file.

Below is a list of possible options with description.

MNTPREFIX (set to /media by default)
  With this options You can alter the default root
  for mounting the removable media, for example to
  the /mnt directory.

  example: MNTPREFIX="/media"

ENCODING (set to en_US.ISO8859-1 by default)
  Only used with FAT32 mounts, specifies which
  encoding to use at the mount.

  example: ENCODING="pl_PL.ISO8859-2"

CODEPAGE (set to cp437 by default)
  Only used with FAT32 mounts, specifies which
  code page to use at the mount.

  example: CODEPAGE="cp852"

USER (unset by default)
  If set to some username, the mount command will
  chown(1) the mount directory with the user and
  its primary user group. If used with FM option
  allows to launch the specified file manager after
  a successful mount.

  example: USER="vermaden"

FM (unset by default)
  If set to file manager command, the mount will
  launch the specified command after successful
  mount. Works only if USER parameter is also set.

  example: FM="nautilus --browser --no-desktop"

USERUMOUNT (set to NO by default)
  When set to YES it will 'chmod +s /sbin/umount'
  which would allow an USER to unmount the file
  system with their selected file manager.

  example: USERUMOUNT="YES"

ATIME (set to YES by default)
  When set to NO it will mount filesystems with
  noatime options when possible.

  example: ATIME="NO"

REMOVEDIRS (set to NO by default)
  When set to YES it will remove empty directories
  under the used  after device detach.

  example: REMOVEDIRS="YES"



FAT/NTFS detection improvements.
The 'chown' now uses sets user's group.
MSDOS filesystem is now mounted with -m 644 -M 755 options by default.
Removed POPUP=YES option, just use USER + FM for simplicity.
NTFS filesystem, when mounted by mount_ntfs(8) uses -u and -g options.
Even more simplified 'detach' section.



I removed the state_lock and stat_unlock mechanisms as they appeared to be
not needed, I have shufled with 3 drives all the time and the 'integrity'
has not been lost, at it was a lot faster, because the lock always had to
wait for the 'slowest' drive (in term of initializing the device, like USB
hard drive).

I simplified the 'attach' section a lot, now each filesystem contains only
check/fsck (if possible), mount and log info.

I also simplified and improved the 'detach' section a little.

I added an option to automatically launch the set-up in config file manager.

These are options that I currently successfully use for NAUTILUS file
manager. You need to set-up all three of them to make it work.

| FM="nautilus --browser --no-desktop"
| USER=vermaden

My whole config looks like that now:

| FM="nautilus --browser --no-desktop"
| USER=vermaden
| ENCODING=pl_PL.ISO8859-2
| CODEPAGE=cp852

All latest updates are available at GITHUB repository:



AUTOMOUNT is devd(8) based flexible yet very simple automounter for FreeBSD.

Currently it supports these file systems:
 -- NTFS requires sysutils/fusefs-ntfs for R/W
 -- FAT/FAT32
 -- exFAT requires sysutils/fusefs-exfat
 -- EXT2
 -- EXT3
 -- EXT4 requires sysutils/fusefs-ext4fuse
 -- UFS

It keeps state of the mounted devices at /var/run/automount.state and logs
all activities to /var/log/automount.log file.

The place for the script is at /usr/local/sbin/ executable.

The only additional configuration it requires is to add these lines as
/usr/local/etc/devd/automount_devd.conf file, which would allow it to work.

Remember to restart /etc/rc.d/devd daemon after adding
/usr/local/etc/devd/automount_devd.conf file.

Have Fun ;)