Professional Web Applications Themes

automount usb flash drive? - FreeBSD

I was trying to figure out how to have a usb flash drive automount when I plug it in. I currently have the following line in /etc/fstab /dev/da0s1 /mnt/usbkey msdos rw,-m700,noauto 0 0 and the following in /etc/devfs.conf perm da0s1 0666 when I do the following command line command the usb flash drive mount fine # mount /mnt/usbkey But, when I'm in KDE viewing media:/ Removable Device (da0s1) is shown is unmounted. At the user level command line and in KDE, I receive /dev/da0s1: Operation not permitted. I'm not sure if part of the issue is permissions or if I'm ...

  1. #1

    Default automount usb flash drive?

    I was trying to figure out how to have a usb flash drive automount
    when I plug it in. I currently have the following line in /etc/fstab

    /dev/da0s1 /mnt/usbkey msdos rw,-m700,noauto 0 0

    and the following in /etc/devfs.conf

    perm da0s1 0666

    when I do the following command line command the usb flash drive mount fine

    # mount /mnt/usbkey

    But, when I'm in KDE viewing media:/ Removable Device (da0s1) is
    shown is unmounted.

    At the user level command line and in KDE, I receive /dev/da0s1:
    Operation not permitted.

    I'm not sure if part of the issue is permissions or if I'm missing a
    piece for the auto-mounting to happen.

    Any thoughts?

    Thanks
    Todd Guest

  2. #2

    Default Re: automount usb flash drive?

    On Wed, Apr 06, 2005 at 03:32:14PM -0400, Todd Shirk wrote: 

    devfs.conf only works for devices available at boot time. For devices
    you can plug in at runtime you should use /etc/devfs.rules:

    [foobar=10]
    add path 'da*s*' mode 0666

    And you should have the following in /etc/rc.conf:

    devfs_system_ruleset="foobar"

    The contents of devfs.rules are fed to devfs(8), so see it's manual page.
     

    For a user to be able to use a filesystem, there are a couple of things
    that need to be done:
    - The sysctl variable vfs.usermount must be set to 1 (in /etc/sysctl.conf).
    - The user in question must own the mount point.
     

    I think the latter. Normally usbd(8) is notified of USB events, but in
    this case it seems to get events for the umass* device, not the da*s*
    device that you'll want to use. There have been people who've used a
    shell-script called by usbd to figure out the connection between
    umass<->da from dmesg output and then mount the filesystem, but that
    doesn't do umounts. It's also complicated if you want it to work for
    multiple users, unless you give it 777 permissions. You could also give
    amd(8) a try.

    I found that making a one-line shell script to do the mounting is much
    less hassle.

    Roland
    --
    R.F. Smith /"\ ASCII Ribbon Campaign
    r s m i t h x s 4 a l l . n l \ / No HTML/RTF in e-mail
    http://www.xs4all.nl/~rsmith/ X No Word docs in e-mail
    public key: http://www.keyserver.net / \ Respect for open standards

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.0 (FreeBSD)

    iD8DBQFCVEAKEnfvsMMhpyURAry9AJ9k65BXKTHKDJQmUKmY1J w/ETOLoACgsR9R
    fvr183T7neNLH+fn3c6q9m4=
    =xw+u
    -----END PGP SIGNATURE-----

    Roland Guest

  3. #3

    Default Re: automount usb flash drive?

    Seems like the only thing that will work for me is to make a one-line
    shell script. I tried the various things you mentioned. I have yet
    to look at how to use amd(8). Setting vfs.usermount=1 and changing
    the ownership to the user name in question allows me to mount the
    usbkey without su'ing. I still can't get the usbd.conf to run an
    attach command on the umass* action. Thanks for your help.

    On Apr 6, 2005 4:01 PM, Roland Smith <nl> wrote: 
    >
    > devfs.conf only works for devices available at boot time. For devices
    > you can plug in at runtime you should use /etc/devfs.rules:
    >
    > [foobar=10]
    > add path 'da*s*' mode 0666
    >
    > And you should have the following in /etc/rc.conf:
    >
    > devfs_system_ruleset="foobar"
    >
    > The contents of devfs.rules are fed to devfs(8), so see it's manual page.

    >
    > For a user to be able to use a filesystem, there are a couple of things
    > that need to be done:
    > - The sysctl variable vfs.usermount must be set to 1 (in /etc/sysctl.conf).
    > - The user in question must own the mount point.

    >
    > I think the latter. Normally usbd(8) is notified of USB events, but in
    > this case it seems to get events for the umass* device, not the da*s*
    > device that you'll want to use. There have been people who've used a
    > shell-script called by usbd to figure out the connection between
    > umass<->da from dmesg output and then mount the filesystem, but that
    > doesn't do umounts. It's also complicated if you want it to work for
    > multiple users, unless you give it 777 permissions. You could also give
    > amd(8) a try.
    >
    > I found that making a one-line shell script to do the mounting is much
    > less hassle.
    >
    > Roland
    > --
    > R.F. Smith /"\ ASCII Ribbon Campaign
    > r s m i t h x s 4 a l l . n l \ / No HTML/RTF in e-mail
    > http://www.xs4all.nl/~rsmith/ X No Word docs in e-mail
    > public key: http://www.keyserver.net / \ Respect for open standards
    >
    >
    >[/ref]
    Todd Guest

Similar Threads

  1. automount and NIS issue
    By Binner in forum Linux Setup, Configuration & Administration
    Replies: 14
    Last Post: August 1st, 04:00 PM
  2. Automount
    By JZidar in forum Debian
    Replies: 5
    Last Post: July 4th, 05:20 PM
  3. automount on AIX 4.3.3
    By Steve Nottingham in forum AIX
    Replies: 0
    Last Post: June 26th, 10:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139