OpenWrt Forum Archive

Topic: Automount USB for any pen drive.

The content of this topic has been archived on 8 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have a openwrt ChaosCalmer 15.05.1 on RT5350 chipset board.

I installed necessary packages required for USB storage support.

I opened the LUCI webinterface, added mountpoints for detected USB pen drives at /mnt directory. I have setup a Samba Share drive for /mnt directory which shows the USB files in the Wifi Network.

Is it possible to auto mount the pen drive without manually adding mount points for every new pendrive in the LUCI interface.?
/etc/config/fstab file is updated whenever I add a mount point in LUCI.

Thanks,

I am going through the link that was given by you.

It has asked to modify /etc/hotplug2.rules. I donot have that file in my router files.
I have already installed block-mount package(I suppose it has block-hotplug in the block-mount as well)

I have the following file though:

/etc/hotplug.d/usb/10-motion

[ "$ACTION" = "motion" ] && logger webcam motion event

The other files of hotplug in /etc are :
hotplug-preinit.json
hotplug.json

Make a new file in /etc/hotplug.d/usb and name it as 10-usb ..
Try the following script:
===========================
#!/bin/sh
case "$ACTION" in
        add)
                echo "USB mounted"
                ;;
        remove)
                 echo "USB unmounted"
                ;;
esac
===============================

Let us know if you get these echos ..

https://wiki.openwrt.org/doc/howto/writable_ntfs

I happen to refer to the above link which has custom hotplug script to automount USB pen drive.

The mount is happening now when I plug in the USB. It is mounting to /mnt/$device

Thanks for the reply.

The discussion might have continued from here.