how can i configure FreeBSD to auto mount USB devices?
Hey everyone
I need help on mounting my USB connected external DVD burner to my FreeBSD 6.0 box. I want to set up the configuration of FreeBSD so that it will automatically recognize and mount an USB device during boot up or during the time the operating system is working. So basically i want it to run like plug and play on Windows XP. How would I go about doing that? All help will be GREATLY appreciated. |
You will need to manually edit /etc/devd.conf
Just create/edit the attach entry for the device it shows up on to do what you would do manually. I would recommend creating a shell script to do the actual mounting as your code should test for certain things and be prepared for failure. So, for example, your code would be something like: Code:
# The entry below starts moused when a mouse is plugged in. Moused Note automatic unmounting is another issue. I have never got that working perfectly. You see, the unmount should happen before the device is unplugged... and you won't get the detach signal until you unplug the device -- so you can't use the same method. |
I use kde/FreeBSD 6.1. and I had add this lines to /etc/devd.conf to mount and umount my 128 MB Jetflash usb:
### 0x6688 is jetflash id, see it with devd -dD and pluggin the jetflash ## to mount it attach 20 { device-name "umass0"; match "product" "0x6688"; action "sleep 2 ; \ sh /etc/rc.d/devfs restart ; \ /sbin/kldload msdosfs ; \ su - youruserinkde -c '/sbin/mount /dev/da0s1' ; \ su - youruserinkde -c 'konqueror /home/youruserinkde/jetflash -display :0'" ; }; ### to umount it detach 20 { device-name "umass0"; action "/sbin/umount /home/youruserinkde/jetflash ; \ /sbin/kldunload msdosfs "; }; |
All times are GMT -5. The time now is 11:28 AM. |