Automount
Simple devd(8) based automounter for FreeBSD
Install / Use
/learn @vermaden/AutomountREADME
___ /\ ___
__/ /_ / \ _\ \__
____ _____/_ __/__ / _/\ ___ ___ ____ ______ __\__ _\
/ \ / / // // \ /\_/ \ / / \ / \\ \ \ / \\ \
/ / // / // // / // \ \ \ \ \ \ \ \ \ \ _ _\/ _\//_____\__\/ _\_\\
The 'automount' is a devd(8) based automounter for FreeBSD.
It supports most popular file systems: NTFS/MSDOS/exFAT/EXT2/EXT3/EXT4/UFS/XFS/HFS/MTP/ISO9660
I N S T A L L
Use provided FreeBSD Ports/packages from here:
- sysutils/automount
.. or make manual unstallation:
cp automount.conf /usr/local/etc/automount.conf
cp automount_devd.conf /usr/local/etc/devd/automount_devd.conf
cp automount /usr/local/sbin/automount
chmod +x /usr/local/sbin/automount
/etc/rc.d/devd restart
Now plugin Your USB thumb drive and have fun ;)
These ports/packages are needed for all filesystems:
- sysutils/e2fsprogs // EXT2/EXT3/EXT4 fsck(8)
- sysutils/xfsprogs // XFS fsck(8)
- sysutils/exfat-utils // exFAT exfatfsck(8)
- sysutils/fusefs-exfat // exFAT
- sysutils/fusefs-ntfs // NTFS (read write support)
- sysutils/fusefs-hfsfuse // HFS
- sysutils/fusefs-lkl // XFS/EXT2/EXT3/EXT4
- sysutils/fusefs-simple-mtpfs // MTP
All of the above are available as pkg(8) packages.
Shortcut:
pkg install -y \
sysutils/e2fsprogs \
sysutils/xfsprogs \
sysutils/exfat-utils \
sysutils/fusefs-exfat \
sysutils/fusefs-ntfs \
sysutils/fusefs-hfsfuse \
sysutils/fusefs-lkl \
sysutils/fusefs-simple-mtpfs
C H A N G E L O G
VERSION 1.7.9 (CURRENT)
Fix XORG detection. Implement proposed BLACKLIST_REGEX option. Use 'sysutils/fusefs-lkl' for all ext2/ext3/ext4 mounts. Fix exFAT detection. Fix small problem with checking the mount state. Implement better old directory cleanup.
VERSION 1.7.8
Fix harmless gpart(8) rant about ugen(4) devices.
VERSION 1.7.7
Add option to ignore system partitions like EFI or MSR. Fix removal of dirs from unmounted filesystems. Fix mount permissions for FAT filesystems. Add spaces and comments in the code.
VERSION 1.7.6
Added UZIP images support. Added another try to mount device in read only mode. Added optional ada(4) disks support. Added optional md(4) devices support. Added automatic kernel modules loading.
VERSION 1.7.5
Add REMOVEDIRS option as default. Add NICENAMES option to use labels instead of device names. Use procstat(1) for faster DISPLAY environemnt searching.
VERSION 1.7.4
Add new logo.
VERSION 1.7.3
Use 755 permissions for FAT mounts.
VERSION 1.7.2
Phase out support for sysutils/fusefs-ext4fuse port. Fix UMASK for exFAT filesystems. Fix ISO9660 mount options.
VERSION 1.7.1
Fix exFAT mount rights. Use USER option in config file. Make MTP detection and mount better.
VERSION 1.7.0
The automount has now a new co-author - Rozhuk Ivan. New options available in automount.conf config file. Filesystem detection/mounting reworked totally with file(1)/dd(1)/fstyp(8) as backends. Notifications are now possible with libnotify. Automatic detection of DISPLAY variable. New automatic wait for device appearance. New detection if device is a block device. Introduction of CD-ROM support. Automatic detection of File Manager with exo-open(1). Option REMOVEDIRS is deprecated now. Handle '-o large' option for FAT under FreeBSD 11.x and 12.x versions.
VERSION 1.6.1
Fix MBR/msdosfs partition unmount issue.
VERSION 1.6.0
Fix long boot with devd(8) because of ugen(4) devices. Add fsck.exfat to the exFAT filesystem. Set fsck.ext2 instead of e2fsck to the ext2 filesystem. Set fsck.ext3 instead of e2fsck to the ext3 filesystem. Set fsck.ext4 instead of e2fsck to the ext4 filesystem.
VERSION 1.5.9
Decrease DELAY for sleep from '1' to '0.1' for faster mounting. Remove __random_wait() at 'attach'. Implement MTP mounting. Added XFS and HFS support. Various fixes and cleanups. Remove '-o large' option for FAT (not supported on FreeBSD 12).
VERSION 1.5.8
Omit GVFS filesystem in the mount(8) listing. Improve exFAT mount options. Add mount_msdosfs(8) fallback fix. Set caja as file manager in example config. Add version argument.
VERSION 1.5.7
Fix FAT32 mount. Add extended options for EXFAT mounts. Add -version option.
VERSION 1.5.6
Implement --version option.
VERSION 1.5.5
Rework NTFS/MSDOS/FAT detection. Check for NTFS before FAT.
VERSION 1.5.4
Added notification via notify-send/libnotify and wall(1). Minor bug fix. Change 'boot sector' detection.
VERSION 1.5.3
Fix small harmless bug - variable WAIT without default value.
VERSION 1.5.2
Introduce smarter fstype() function to better determine filesystem.
VERSION 1.5.1
Add -k flag to file(1) command. Set new --version and date(1).
VERSION 1.5.0
Add new NTFS options. Add nested NTFS mount attempt. Fix devd(8) config. Improve log messages. Use random wait only on ATTACH action, not needed on DETACH action. Implement random wait to eliminate race. Implement BOOTDELAY option to wait for boot process to complete. Fix devd(8) config (LARKIND) to match all needed devices and their partitions. Fix typo in NTFS error message.
VERSION 1.4.3
Only style(9) changes. Force longnames option for msdosfs. Remove -u option for debug. Fix a bug when ATIME is enabled. Add -o remove_hiberfile to NTFS-3G mount options. Fix typo at /var/log/automount.log error message. Use /sbin/e2fsck from FreeBSD base system. Fix typo at /var/log/automount.log error message. Force longnames option for msdosfs.
VERSION 1.4.2
Implement active sleep/wait for devices that could not appear. Add more useful information to /var/log/automount.log file. Implement BLACKLIST option to ignore problematic devices.
VERSION 1.4.1
Improved checking for already mounted devices. More readable log format. Added logging of fsck(8) output. Added adding setuid also to /sbin/mount* when USERUMOUNT set to YES. Added error logging of failed mounts.
VERSION 1.4.0
Wait for smartphone to attach device, rewrite all &&-|| into if-then-else-fi syntax.
VERSION 1.3.1
Fixed the 'detach' section (s/PREFIX/MNTPREFIX/g). Fixed removing directories of manually (properly) unmounted filesystems.
VERSION 1.3
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.
VERSION 1.2.1
Added the --help page. Removed some small bugs. Added more options to configure features.
% /usr/local/sbin/automount --help AUTOMOUNT is a devd(8) based automounter for FreeBSD.
It supports following file systems: UFS/FAT/exFAT/NTFS/EXT2/EXT3/EXT4/MTP/HFS/ISO9660
Add these to mount NTFS/exFAT/EXT4/HFS/XFS/MTP respectively: o sysutils/fusefs-ntfs o sysutils/fusefs-exfat o sysutils/fusefs-ext4fuse o sysutils/fusefs-hfsfuse o sysutils/fusefs-lkl o sysutils/fusefs-simple-mtpfs
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.
MNT_PREFIX (set to /media by default)
Related Skills
node-connect
354.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
