Re: What determines which /dev/sd* a USB device becomes?

From: Alan Chandler (alan_at_chandlerfamily.org.uk)
Date: 08/03/04

  • Next message: Zaq Rizer: "Re: unable to install anything"
    To: debian-user@lists.debian.org
    Date: Tue, 3 Aug 2004 00:03:41 +0100
    
    

    On Monday 02 August 2004 10:16, Adam Funk wrote:
    > I unplugged my USB SmartMedia card reader and plugged in a different
    > brand of the same thing. It now shows up as /dev/sdb (and /dev/sdb1)
    > but /dev/sda is still present (although useless). This is a minor
    > nuisance as I had to change /etc/fstab so I could mount it as a normal
    > user. What causes this and is there any way to control it?

    The way to solve this is to use udev. It creates the devices dynamically as
    the devices are plugged in.

    The default rules will still create the /dev/sd? and /dev/sd?1 files - but you
    can easily write special rules to detect the device which is being plugged in
    and also create something like /dev/smartmedia which is what you put
    in /etc/fstab

    There is a good write up on how to do this at

    http://www.reactivated.net/udevrules.php

    Here is part of a file I have made (I haven't properly dealt with partions on
    the "camera" devices yet - see c) below)).

    I am doing several things here

    a) defining my two ide cd roms as /dev/cdrw and /dev/dvd correctly
    b) detecting when I connect in my jumpdrive so I can mount it on /dev/flash
    (I then have a "floppy disk" device icon on my kde desktop to mount/unmount
    it when I want to use it).
    c) detecting a camera smartmedia card plugged into a reader, or one of two
    seperate digital cameras plugged in (this works and creates the /dev/camera
    files - but I think I propably have to change this in the same what as b) -
    ie detect sd?1 and sd? on two lines and only assign devices on the first)

    kanger:/home/alan# more /etc/udev/rules.d/01-akcspecial.rules
    # Created 26 Jul 2004 AKC First creation (needs other to be
    filled in)
    # Define specific devices for CDs
    BUS="ide", KERNEL="hdc", NAME="cdrw", SYMLINK="cdroms/cdrom0"
    BUS="ide", KERNEL="hdd", NAME="dvd", SYMLINK="cdroms/cdrom1"

    # Portable Flash Storage
    BUS="usb", SYSFS{manufacturer}="LEXAR MEDIA", SYSFS{product}="JUMPDRIVE
    ELITE", KERNEL="sd?1" NAME="flash"
    # Hopeing this will stop the create of and sd nodes for this device
    BUS="usb", SYSFS{manufacturer}="LEXAR MEDIA", SYSFS{product}="JUMPDRIVE
    ELITE", KERNEL="sd*" NAME=""

    # Smartmedia reader should look like a camera, but will be placed first so
    that a real
    # camera can override it
    BUS="usb", SYSFS{model}="SmartMedia", NAME="camera", SYMLINK="smartmedia"

    # Digital Camera (either the C745UZ or the C220Z)
    BUS="usb", SYSFS{idVendor}="07b4", SYSFS{idProduct}="0102", NAME="camera",
    SYMLINK="olympus_c220z"
    BUS="usb", SYSFS{idVendor}="07b4", SYSFS{idProduct}="0105", NAME="camera",
    SYMLINK="olympus_c745uz"

    -- 
    Alan Chandler
    alan@chandlerfamily.org.uk
    First they ignore you, then they laugh at you,
     then they fight you, then you win. --Gandhi
    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Zaq Rizer: "Re: unable to install anything"

    Relevant Pages

    • Re: USB card reader - disaster!
      ... My old camera uses a SmartMedia card, and I have a Dazzle usb SmartMedia-only reader that worked with Mandriva Linux with no tweaking from me. ...
      (alt.os.linux)
    • Re: well-supported SLR camera
      ... van; load it up with kids, SO, and supplies, and there is barely ... My reader fits into the same little case the camera is in. ... battery life is a concern; often there is no power where I ...
      (comp.os.linux.misc)
    • Re: Importing Pictures from Canon g9
      ... After trawling through a lot of other posts, I did go out and buy a card ... reader on new years eve, and it worked like a charm. ... driver for this camera as it's meant to "plug and play" in XP. ... The camera is not recognised by windows XP. ...
      (microsoft.public.windowsxp.photos)
    • Re: jpeg picture issues
      ... Free...Adaptec UDF Reader Driver 5.1.1.213 ... Picture It! ... while the drivers for 2000 will work on XP. ... >> copy pictures from my camera on to it. ...
      (microsoft.public.windowsxp.photos)
    • Re: MS scanner and camera wizard problem - Readers
      ... I have seen reports of problems with the card reader supplied on your sys. ... Personnally I simply use usb from my camera, ... or the wizard cannot determine the problem. ... that window comes up (as long as I don't check the box saying ...
      (microsoft.public.windowsxp.configuration_manage)