Hotplug-diskmount is a plug-in to OpenBSD's hotplugd that automatically mounts removable disks to the filesystem. It works with any disk types (SD cards, USB mass storage devices, card readers and CD/DVD drives). This program is indended to be used in single user environment on desktop or laptop.

Before use

First of all, create directory where all mountpoints will be placed.

# /usr/local/libexec/hotplug-diskmount init

Enable hotplugd at boot time.

# echo "hotplugd_flags=" >> /etc/rc.conf.local

Add missing parts to your /etc/hotplug/attach. Remember to set executable bit to attach script if you are creating new one.



case $DEVCLASS in
        /usr/local/libexec/hotplug-diskmount attach -u _LOGIN_ -m 700 "$DEVNAME"

What you get

When you plug USB thumb drive, insert SD card into the attached card reader or insert CD/DVD into attached removable DVD drive filesystems from these devices will be automatically mounted under /vol/DRIVE_NAME. Hotplug-diskmount will mount as many partitions as disk contains.
$ mount 
/dev/sd0i on /vol/CANON_SD32 type msdos (local, nodev, nosuid)
/dev/cd0a on /vol/5.0 Install CD type cd9660 (local, nodev, ...

$ ls /vol
5.0 Install CD  CANON_SD32


Public Mercurial Repository:

$ hg clone
Ukrainian OpenBSD User Group
Get Firefox

Copyright © 2006-2016, Alexey Vatchenko. All rights reserved.
Designed by Vladimir Mostovoy.