LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 04-07-2006, 07:06 PM   #1
asilentmurmur
Member
 
Registered: Mar 2005
Location: Washington DC area
Posts: 214

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, 03:23 PM   #2
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

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:
Code:
# 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, 01:24 PM   #3
curioso
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 ";
};
 
  


Reply


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 08:35 AM
USB storage devices difficult to mount and use jaakkop Slackware 4 11-16-2005 04:03 PM
Problem mount USB devices. jonostew Linux - Hardware 4 08-20-2004 12:39 PM
Auto mounting of USB devices leecming Linux - Newbie 6 08-05-2004 01:42 PM
How do you mount usb devices on RH9 barrys Red Hat 2 10-19-2003 07:27 AM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 11:17 PM.

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