Welcome to the most active Linux Forum on the web.
Go Back > Forums > Other *NIX Forums > *BSD
User Name
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.


  Search this Thread
Old 04-07-2006, 08:06 PM   #1
Registered: Mar 2005
Location: Washington DC area
Posts: 212

Rep: Reputation: 30
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.
Old 04-08-2006, 04:23 PM   #2
Senior Member
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Ubuntu, FreeBSD
Posts: 1,449

Rep: Reputation: 48
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:
# The entry below starts moused when a mouse is plugged in. Moused
# stops automatically (actually it bombs :) when the device disappears.
attach 100 {
        device-name "ums[0-9]+";
        action "/etc/rc.d/moused start $device-name";
This is the usb mouse code right here. You would replace the part after action with the shell script command to mount the device.

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.
Old 04-24-2006, 02:24 PM   #3
LQ Newbie
Registered: Apr 2006
Posts: 5

Rep: Reputation: 0
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 ";


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't mount my usb devices captain chaos Slackware 18 04-23-2006 09:35 AM
USB storage devices difficult to mount and use jaakkop Slackware 4 11-16-2005 05:03 PM
Problem mount USB devices. jonostew Linux - Hardware 4 08-20-2004 01:39 PM
Auto mounting of USB devices leecming Linux - Newbie 6 08-05-2004 02:42 PM
How do you mount usb devices on RH9 barrys Red Hat 2 10-19-2003 08:27 AM > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 09:07 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration