Re: device names given to USB devices on Linux

From: Vikas (vikas.dogra_at_tabs.toshiba.com)
Date: 09/08/04


Date: 8 Sep 2004 12:14:00 -0700

dmesg some times does not gives you a device name . .
for example i attached this flash drive and did'nt get the name

hub.c: new USB device 00:1f.2-2.2, assigned address 5
scsi1 : SCSI emulation for USB Mass Storage devices
  Vendor: MicroAdv Model: QuickiDrive128M Rev: 2.00
  Type: Direct-Access ANSI SCSI revision: 02
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 5

I tried deriving the name by the order in which they appear in
/proc/scsi/scsi but that also didn't work ...coz you don't know which
device is getting attached .if you attach a device which was attached
earlier then the previous entry is used.

Dances With Crows <danSPANceswitTRAPhcrows@gmail.com> wrote in message news:<slrncjsfu6.cs3.danSPANceswitTRAPhcrows@samantha.crow202.dyndns.org>...
> On 7 Sep 2004 15:52:46 -0700, Vikas staggered into the Black Sun and
> said:
> > I have an application which needs to mount the flash drives getting
> > attached to the USB port on the Linux system. These flash drives can
> > be of any model and from any vendor. To mount these flash drives i
> > need to know the device name given to the flash drives like
> > /dev/sd??.I know you can get the name by looking into the dmesg or
> > /var/log/messages but i want to do it Programmatically.
>
> So write a Program that parses the output of "dmesg | grep SCSI device
> sd" then. Don't make things harder than they should be, eh? If you're
> using devfs/udev, you can always try polling /dev/discs/ at 5-second
> intervals looking for changes, but you didn't say anything about that.
>
> > I went through lot of stuff regarding this but can't find the
> > solution. Does anybody has an answer?
>
> Where did you look, what did you find, what have you tried already?
> Parse dmesg's output; it'd be doable in one regular expression.



Relevant Pages

  • Re: Invisible Flash Drive (long)
    ... PC won't assign drive letter to flash drive ... Windows XP Home ... I plugged a flash drive (USB mass storage device) into a USB port. ... my flash drives work on other Windows XP computers, ...
    (microsoft.public.windowsxp.general)
  • USB/CD insert event trigger
    ... Does anyone know how to go about utalizing the OS to run a script ... whenever a USB mass storage device or a CD/DVD type media ... I am trying to initiate a McAfee virus scan on USB flash drives and/or ...
    (microsoft.public.windowsxp.customize)
  • USB/CD intsert event trigger
    ... Does anyone know how to go about utalizing the OS to run a script ... whenever a USB mass storage device or a CD/DVD type media ... I am trying to initiate a McAfee virus scan on USB flash drives and/or ...
    (microsoft.public.windowsxp.customize)
  • PROBLEM: (Bug report) USB Mass Storage in 2.6.0-test11 (cannot mount flash drive)
    ... I cannot mount any USB mass storage drive when using kernel 2.6.0-test11 ... Dec 6 19:28:18 mycomp modprobe: FATAL: Module usb_storage already in kernel. ... Dec 6 14:49:25 mycomp kernel: Initializing USB Mass Storage driver... ... 4000-40ff: PCI CardBus #02 ...
    (Linux-Kernel)
  • Re: Sansa MP3 player does not mount
    ... did your Sansa e260 work before you switched to the rockbox firmware?? ... My new Sansa player does not mount correctly/automatically in Ubuntu. ... Initializing USB Mass Storage driver... ...
    (Ubuntu)