Udev automounting for usb drives

I am using the howto from the wiki to setup udev rules, so that my usb drives automount to /media/.
I have run into a snag though. My ipod shuffles and one of my thumbdrives go to /dev/sdc (with no number). But, the udev rules are looking for them to have numbers. I was wondering if there was a way to alter the current rules to also automount those devices that only have the main partition.
My ruleset:
KERNEL=="sd[c-z]", NAME="%k", SYMLINK+="usb%m", GROUP="users", OPTIONS="last_rule"
ACTION=="add", KERNEL=="sd[c-z][0-9]", SYMLINK+="usb%n", GROUP="users", NAME="%k"
ACTION=="add", KERNEL=="sd[c-z][0-9]", RUN+="/bin/mkdir -p /medimediasb%n"
ACTION=="add", KERNEL=="sd[c-z][0-9]", PROGRAM=="/lib/udev/vol_id -t %N", RESULT=="vfat", RUN+="/bin/mount -t vfat -o rw,noauto,flush,quiet,nodev,nosuid,noexec,noatime,dmask=000,fmask=111 /dev/%k /media/usb%n", OPTIONS="last_rule"
ACTION=="add", KERNEL=="sd[c-z][0-9]", RUN+="/bin/mount -t auto -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/%k /media/usb%n", OPTIONS="last_rule"
ACTION=="remove", KERNEL=="sd[c-z][0-9]", RUN+="/bin/umount -l /media/usb%n"
ACTION=="remove", KERNEL=="sd[c-z][0-9]", RUN+="/bin/rmdir /media/usb%n", OPTIONS="last_rule"
Thanks!
FYI: Wiki Page

I think that device sd? without sd?1 isn't correctly partitioned, or is it? All my usb pens have sd?1 on them, I never tried making filesystem on the physical device itself. I don't know, but at least, if you want to make special rule for one particular device, try this:
I mount my usb devices using this rule:
KERNEL=="sd?1", ATTRS{vendor}=="Corsair", ATTRS{model}=="Flash Voyager", NAME="%k", SYMLINK+="voyager"
ACTION=="add", KERNEL=="sd?1", ATTRS{vendor}=="Corsair", ATTRS{model}=="Flash Voyager", RUN+="/bin/mkdir /mnt/voyager"
ACTION=="add", KERNEL=="sd?1", ATTRS{vendor}=="Corsair", ATTRS{model}=="Flash Voyager", RUN+="/bin/mount -t vfat -o sync,flush,uid=1000,gid=100 /dev/voyager /mnt/voyager"
ACTION=="remove", KERNEL=="sd?1", ENV{ID_VENDOR}=="Corsair", ENV{ID_MODEL}="Flash_Voyager", RUN+="/bin/umount /mnt/voyager"
ACTION=="remove", KERNEL=="sd?1", ENV{ID_VENDOR}=="Corsair", ENV{ID_MODEL}="Flash_Voyager", RUN+="/bin/rmdir /mnt/voyager"
KERNEL=="sd?1", ATTRS{vendor}=="WD", ATTRS{model}=="1600BEV External", NAME="%k", SYMLINK+="passport"
ACTION=="add", KERNEL=="sd?1", ATTRS{vendor}=="WD", ATTRS{model}=="1600BEV External", RUN+="/bin/mkdir /mnt/passport"
ACTION=="add", KERNEL=="sd?1", ATTRS{vendor}=="WD", ATTRS{model}=="1600BEV External", RUN+="/bin/mount -t vfat -o sync,flush,uid=1000,gid=100 /dev/passport /mnt/passport"
ACTION=="remove", KERNEL=="sd?1", ENV{ID_VENDOR}=="WD", ENV{ID_MODEL}="1600BEV_External", RUN+="/bin/umount /mnt/passport"
ACTION=="remove", KERNEL=="sd?1", ENV{ID_VENDOR}=="WD", ENV{ID_MODEL}="1600BEV_External", RUN+="/bin/rmdir /mnt/passport"
I execute these actions based on device name - ATTRS{vendor}=="Corsair", ATTRS{model}=="Flash Voyager".
I used Writing udev rules guide, which explains how can you find devices properties and what udev events are triggered by plugging in usb pens for example.
Similary, you can use this approach for the problematic device and keep old match pattern sd[c-z][0-9] for other devices.

Similar Messages

  • Link for USB driver for ideaTab A1000

    Hi all,
    I am an android developer I want want to use my ideaTab A1000 for my developement. I want to download usb driver software for my ideaTab A1000 . So please provide me the correct link to download the usb driver. 
    Thanks and regards,
    Arun PS

    hi ArunPS,
    Welcome to Lenovo Community Forums! 
    If you need a driver for the tablet to communicate like a Device for software Developing then this is what you need
    http://pdanet.co/a/
    Hope this helps,
    Cheers!
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • Wmii + dbus/hal and automount of usb driver/memory card

    Laptop is UL30A. One question. Will USB be automounted when I'm in wmii, or will this just work in gnome?

    Hi!
    I have one tiny question!
    I'm about to make standalone Openbox desktop.
    For FM I will use PCmanFM and I've found out that it does automounting job.
    So the question is do I need volume manager such as skvm or udev rule or everything will work only with proper HAL policy and PCmanFM?
    Thanks in advance

  • Uses for USB drives

    I have a bunch of USB thumb drives lying around. Are there any uses for them? (I've tried searching it on google but it only gave me answers for windows users)

    Small Flashdrives are good for sharing photos and other files with friends and family.
    Larger ones 8GB+ can be used to backup small user libraries and/or make a bootable Mountain Lion install drive on.

  • Recommended format for USB drive/stick ?

    My usual project delivery is DVD or online but I've got a client who is asking to put his (8min) film onto a USB stick.  I've never done this so I would be very grateful for any advice.
    What format/settings should I export my standard resolution PAL project out to?
    I'm assuming that the USB speed bottle-neck means only a low quality version could play directly from the drive ?
    What's the normal procedure? Instruct a viewer to drag a file to their desktop and then play? or keep file playable from drive?
    Is it resonable to keep the audio CD quality and then make the compromises on video quality as that is where the intense data damands are?
    Or is there something else I should consider?  Any advice would be great as this is a very spikey client!
    Cheers
    I'm running Studio 3 so that's FCP 7.0 and compressor 3.5.

    Excellent. I've just tried that out and the video is playing smoothly straight from the USB stick. Thanks PJ.
    A couple of questions. When it opened in compressor the FCP sequence was no longer 16x9 so I saved the template as a custom version and used the 'Geometry / Padding' controls to select the 16x9 setting.  That added 21px above and below which seemed to fix the problem.  Is that the right thing to do? or is there a better solution?
    And also, within the Geometry options the frame size controls were greyed out so the mpeg was locked at 352 x 288 px.  This is not looking too shabby even at full screen, but obviously it would be good to be able to be flexible and make it a bit larger.  Any idea why I can't access these controls?
    Thanks again

  • Proper procedure for USB drive?

    Hi all...quick question from AEBS newbie.
    I have an existing 500GB Western Digital My Book external drive that I would like to hook up to the base station.
    It is already formatted HFS+ (journaled). It has about 300GB of existing data on it.
    Do I need to reformat it before hooking it up to the base station? I plugged it in last night, and while it recognized the disk/volume, it refused to mount it. In fact, the base station would reboot when I tried to mount the drive.
    Thanks!

    I have another problem with Lacie HD connected through Airport Extreme - MS Word doesn't want to save documents there stating that "drive has media problem" and as result Word crashes. No problem backing up or syncing Word documents to the drive though. Same drive was until yesterday connected directly to my iMac through USB and Word didn't have any problems with it. Drive was originally formatted with HFS+ and has about 200GB data on it.
    No problem with mounting.
    But Disk Utility doesn't see the Lacie HD attached through Airport Extreme. Same with iPartition - disk is not visible.

  • USB Drives auto-mounting at startup?

    I am new to the Mac, on little issue i have with my wonderful MAC is when i restart\start up the Mac, the USB Drives \ USB jump drives are not automatically mounted like they do in windows.
    In order for it to be found, i have to unplug and reconnect the cable, there has to be away to automount these USB drives, any ideas? thanks.

    Hi, Matt. Welcome to the Discussions.
    This may be an issue with the firmware on the USB devices you cited. The same behavior has been noted with certain FireWire drives: some must be powered on before startup to be recognized, others are not recognized unless they are powered-up after after startup.
    For your USB hard drives, check with the manufacturer to see if there is a firmware upgrade available for the enclosure. For your USB Flash Drives, there's generally no way to update the firmware: you'll have to live with the behavior and connect them after you startup your Mac.
    Note that before either disconnecting or powering off any mounted external drive — FireWire or USB, flash drive or hard drive — Eject the drive using any of the following methods:
    • Click the drive's Eject icon in the Finder Sidebar.
    • Drag the drive's desktop icon to the Trash.
    • Control-click the drive's desktop icon, then select Eject from the resulting context menu.
    • In Disk Utility, select the drive, then either:- Click Eject in the Disk Utility tool bar.
    - Select File > Eject Disk.
    - Press Command-E.Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • Persistant Block Naming for USB?

    I once seen a topic on this forum about something similar to an issue I am having, evertime I reboot and put my usb in the drive letter chages thus making my fstab line useless. How would I goo about making a udev rule for usb block naming?

    tomk wrote:
    http://wiki.archlinux.org/index.php/Udev
    That's the one I had in mind.
    Ah thanks worked the way I needed it to.

  • Has anyone used the QuickUSB module (Bitswise Systems) to interface to a USB Camera via IMAQ for USB?

    Has anyone used the QuickUSB module made by Bitwise Systems with LabVIEW for image acquisition.   I have a USB camera and I'm trying to use the IMAQ for USB controls to no avail.   Any input is appreciated. 

    Are you using the NI-IMAQ for USB functions or are you calling the QuickUSB libraries from LabVIEW?  Unless the USB camera is DirectShow compliant, then it will not work with the NI-IMAQ for USB driver.  You can use the Code Interface Node in LabVIEW to call external dll's, and it looks like from QuickUSB's website that is the best way to go.  Hope this helps.
    Jason N 

  • USB Drive Problems

    I have been having a weird problem recently. For some reason my iMac (Mountain Lion) refuses to read USB flash drives, however if I restart the computer it starts working normal again until it stops working again.
    It is getting really annoying to have to reboot the computer everytime I want to use a flash drive.
    Any ideas?

    Hello constellar,
    I am unfamiliar with what the term Factory Mode means for USB drives.
    IF you are refering to the USB drive being locked into a Read Only state (cannot write files to it), there is a program to fix that. Go to...
    http://www.pny.com.tw/index.php?cls=2&mode=download
    This fixes HP usb drives (actually made by PNY) that have the Read Only problem.
    The USB Flash Driver Format Tool (Ufix-II) is to be reported as the most successful fix of the two downloads.
    You may need to have 7-Zip installed to extract the .rar file. It is a free download.
    Your going to extract "RecoverTool_V2.00.42_M1223 8CE.exe" from the downloaded file and run.
    If this is not what you are asking for, could you give a description of what is happening?
    Also give a model number of the USB drive and what Operating System you are using.

  • [SOLVED] BIOS not detecting USB Drives after i installed Arch

    SOLVED: In BIOS under 'Advanced' disable 'Fast BIOS Mode'.
    Original post:
    Hi there!
    I'm fairly new to the arch (and linux) scene and just setup my Samsung 530U3B with a brand new installation of arch. Everything went fine and the system is running flawlessly. Almost.
    I just happend to notice that BIOS is not checking for USB drives anymore, it just somehow skips that part. If enter the boot selection, the bootable USB drive won't show up. Neither does it show up in BIOS setup. I tried to boot with the same USB drive that i used to install arch just yesterday, the live media does not boot - the drive doesn't even blink. The boot priority is set to usb drive first, the boot selection screen (hammering f10 during boot) doesn't give me any other option than to boot from the normal SSD. Also, prior to the arch installation (came with w7 installed) the BIOS screen would stay for about 2seconds and then proceed to boot - this doesn't happen anymore. When i press the power button greeted by the grub bootloader in about 1s.
    I tried 2 different usb drives, both with the arch iso (same that i used to install the currently running OS, downloaded yesterday). The drives also show up once my arch is booted (starting to blink just after i hit enter in grub). Also, both drives boot without a problem on my desktop computer.
    Anyone got any ideas?
    I don't really now what kinda of information would be helpful so i'm just dumping stuff i know:
    BIOS: Phoenix SecureCore Tiano Version 04XK
    Machine: Samsung 530U3B
    SSD: Samsung MZ7PC128HAFU-000
    ISO used to install (checksum ok): archlinux-2012.07.15-netinstall-dual.iso
    Last edited by araex (2012-07-26 16:57:47)

    DSpider wrote:
    The boot priority is set to usb drive first
    Welcome to the forum.
    If you just set the USB stick to be first in the boot order, the next option (from the list) takes its place the moment you unplug it. You need to set the BIOS to boot from your equivalent of "Removable Devices" first, "Internal Drives" second and "Optical Drives" third.
    The USB stick doesn't show up at all. I set the priority as follows:
    1. USB HDD
    2. USB FDD
    3. USB CD
    4. SATA CD
    5. SATA HDD
    6. NETWORK
    I used that same configuration to install arch. USB doesn't seem to initialize at all. Also, if i enter "usb" in the grub commandline, no devices are listed.
    Thanks!
    UPDATE:
    I just figured it out. In my BIOS under 'Advanced' the 'Fast BIOS Mode' was enabled, once i disabled it, everything went fine. I don't remember changing that option. Silly me.
    Sorry for your time
    Last edited by araex (2012-07-26 16:56:30)

  • Disable spotlight for USB thumbdrives?

    All,
    Is there a way to prevent OSX from doing a Spotlight inventory of every USB drive that I plug into my MacBook? What I mean is, every time I plug a USB thumb drive into my laptop, and then take it over to a Linux or Windows machine, I notice that OSX has written three files to the drive:
    .Spotlight-V100
    .Trashes
    ._.Trashes
    I want to disable this feature, just for USB drives.
    Hints?

    Hm. I have this problem too.
    Played with this a bit, but doesn't seem to work 100% of the time. I can alter the settings as you described, but they are only good until I eject the USB drive.
    More specifically:
    1. Plug in USB thumb drive.
    2. Go to Spotlight settings (described above) and select my drive to be excluded from Spotlight indexing.
    3. Work a bit.
    4. Eject (remove) USB thumb drive.
    5. Check Spotlight settings, and notice that USB device is no longer in the the "exclude" (or privacy) list.
    It would seem that the "privacy" settings are not persistent across sessions. Once you eject, all bets are off and you have to redo this process every time.
    If there is no built-in way to do this, perhaps scripting could take care of this ... ?
    Someone has to have had this problem before we did?

  • Usb drive automount with drive's Name

    I've read http://wiki.archlinux.org/index.php/Udev#Udev_Tricks so now usb drives are automounted as /mnt/usbhd-sda1 (or something similar). But I want them to mount as /mnt/usb-drive-name
    where usb-drive-name is auto-detected (not preentered by hand).
    Unfortunetly I didn't find drive name in information provided by udevinfo.
    Is it possible to do that?
    Also I'm using KDE and want to set it up so that automounted drive would appear in system:/media. As far as I understand in order for that to happen I need a record in fstab but I have no idea what that should be.
    Thanks in advance.
    Last edited by el_ave (2007-03-20 21:14:51)

    You have clearly not done very much research on this subject. Did you know that with hal and dbus daemons, kde will automount for you? And for that to happen, there should _not_ be an entry about that device in fstab, unless it is clearly specified as "noauto". You need also be a member of the correct groups to do this.
    After that, it's a easy as clicking the device in media:/ and renaming it...
    Please, read up on the wiki.
    esp. the "beginners guide" by chaosgeistern.

  • All USB drives mount as read only for user

    I have searched a bunch and thee results I find seem to be irrelevant to my situation. Most relate to a single USB media that is a problem and won't read or write.
    On a new Arch install on a new computer (my third base system install). Running Gnome.
    All USB mass storage devices mount as read only for the logged in user. Root has write permissions and I can mkdir no problem. It is not an issue with the USB drive itself as this occurs with multiple USB media (I've tested several SD cards on a reader and at least two drives, all the media works correctly on my existing installations)
    I'm posting the contents of my /etc/group file in case there's an obvious error there I don't see, and my dmesg output upon plugging in the drive. User name is changed in the group file posted to "archie"
    This is a single-user system.
    /ect/group
    root:x:0:root
    bin:x:1:root,bin,daemon
    daemon:x:2:root,bin,daemon
    sys:x:3:root,bin
    adm:x:4:root,daemon
    tty:x:5:
    disk:x:6:root
    lp:x:7:daemon
    mem:x:8:
    kmem:x:9:
    wheel:x:10:root,archie
    ftp:x:11:
    mail:x:12:
    uucp:x:14:archie
    log:x:19:root
    utmp:x:20:
    locate:x:21:
    rfkill:x:24:
    smmsp:x:25:
    http:x:33:
    games:x:50:
    lock:x:54:
    uuidd:x:68:
    dbus:x:81:
    network:x:90:
    video:x:91:
    audio:x:92:
    optical:x:93:
    floppy:x:94:
    storage:x:95:
    scanner:x:96:
    power:x:98:
    nobody:x:99:
    users:x:100:archie
    systemd-journal:x:190:
    archie:x:1000:
    avahi:x:84:
    polkitd:x:102:
    rtkit:x:133:
    gdm:x:120:
    brlapi:x:999:
    kvm:x:78:
    ntp:x:87:archie
    dmesg output
    [ 968.044188] usb 4-3: new high-speed USB device number 4 using ehci-pci
    [ 968.170628] usb-storage 4-3:1.0: USB Mass Storage device detected
    [ 968.171435] scsi7 : usb-storage 4-3:1.0
    [ 969.174450] scsi 7:0:0:0: Direct-Access Generic USB SD Reader 1.00 PQ: 0 ANSI: 0
    [ 969.175068] scsi 7:0:0:1: Direct-Access Generic USB MS Reader 1.03 PQ: 0 ANSI: 0
    [ 969.939417] sd 7:0:0:0: [sdb] 15572992 512-byte logical blocks: (7.97 GB/7.42 GiB)
    [ 969.941028] sd 7:0:0:0: [sdb] Write Protect is off
    [ 969.941037] sd 7:0:0:0: [sdb] Mode Sense: 03 00 00 00
    [ 969.944664] sd 7:0:0:1: [sdc] Attached SCSI removable disk
    [ 969.945509] sd 7:0:0:0: [sdb] No Caching mode page found
    [ 969.945517] sd 7:0:0:0: [sdb] Assuming drive cache: write through
    [ 969.952682] sd 7:0:0:0: [sdb] No Caching mode page found
    [ 969.952693] sd 7:0:0:0: [sdb] Assuming drive cache: write through
    [ 969.956396] sdb: sdb1
    [ 969.965003] sd 7:0:0:0: [sdb] No Caching mode page found
    [ 969.965011] sd 7:0:0:0: [sdb] Assuming drive cache: write through
    [ 969.965015] sd 7:0:0:0: [sdb] Attached SCSI removable disk
    I'm sure I'm just missing something in user management, but I can't find what.
    Last edited by hooya (2014-04-27 03:10:49)

    I am also having the same problem. Root can read and write to automounted drives, but my user cannot. I've tried with a variety of drives, I am assuming they are being automounted by root instead of the logged-in user somehow. (I am running x directly, and am not using a display manager, if that has anything to do with it).
    When I look at how it is mounted it is as follows:
    /dev/sdc1 on /run/media/myuser/drivename type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)

  • [UDev] No more uuidage for usb device ?

    Since udev update, I haven't anymore symlinks in /dev/disk/by-uuid/ for my usb devices.. and I need them
    /lib/udev/vol_id seem to have disappear too..
    Help °o°

    upgraded udev (141-5 -> 145-1)
    I have still /dev/disk/by-uuid. But I have got problem too.
    When I plug my usb external hard drive in, it took a long time to find it. And later I unplugged the drive, /dev/sdb /dev/sdb1 /deb/sdb2 /dev/sdb5 remains...
    And my usb drive can't be found as /dev/sdc1 but only /dev/sdc, and it also remains after unplugging.
    Another thing I noticed is that on boot, it took only 100ms the udev part, while it was 400+ms before.
    Something changed in udev obviously.
    Edit::
    Just come and report back. After the second reboot after upgrading, my issue has gone.
    Last edited by lolilolicon (2009-08-27 07:04:43)

Maybe you are looking for

  • Mail/ Gmail question

    I already have my personal email configured in mail (POP account). I have just set up, for business, a gmail account, which I want to be able to send and receive from Mail alongside my personal account. i.e: I want to be able to have both accounts se

  • Partial submit in a jsf fragment is not working

    Hi, i have a jsf page that is hosting a jsf fragment (using workflow), inside the jsf fragment i have a button that has partial submit = true, and an output text that has partial triggers pointing to the button. the button on the fragment page has a

  • How Do You Execute a Package

    I have a package called pRom, and in pRom there are about different procedures. I do call the package to execute all the procs, and how do I call the package to execute only one or two or three procedures.

  • Mass form in HCM Process and Forms using FPM forms methodology.

    Hi Friends, I had a requirement to mass upload employee related pay data in infotype 0008. But how to achieve this development using FPM forms is challenge to me. Can any one of you please guide me how to achieve this requirement? Thanks, Nayani.

  • Nikon Coolscan LS 2000 won't be recognized bij Classic

    When I want to work in Classic the Nikon LS 2000 scanner won't be recognized under Photoshop 6.(it has a SCSI-connection; the Umax-scanner has a USB and is recognized for sure). Is there any solution for this problem(Nikon says not, but I wont give u