

How to detect, then mount & umount your USB Flash Drive in SMS

If you open a Terminal window (Console) and type:
[code]
lsusb
[/code]
you should see something like the following:
larry@debian:~$ lsusb
Bus 002 Device 003: ID 046d:c408 Logitech, Inc. Marble Mouse (4-button)
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 13d3:5130 IMC Networks 
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
larry@debian:~$

Now, plug in your USB Flash Drive, and wait 30 seconds then repeat the above command.
[code]
lsusb
[/code]
larry@debian:~$ lsusb
Bus 002 Device 005: ID 4381:0165  
Bus 002 Device 003: ID 046d:c408 Logitech, Inc. Marble Mouse (4-button)
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 13d3:5130 IMC Networks 
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
larry@debian:~$ 

Notice a device with an ID of 4381:0165 has been detected.  You can also do:
[code]
dmesg | tail
lsusb
[/code]
to try and get more information.

Now try the following:
[code]
lsusb -v -d 4381:0165
[/code]
Which gives more detailed information as shown:
larry@debian:~$ lsusb -v -d 4381:0165
Bus 002 Device 005: ID 4381:0165  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x4381 
  idProduct          0x0165 
  bcdDevice            1.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 3 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower               98mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk (Zip)
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               8
can't get device qualifier: Operation not permitted
can't get debug descriptor: Operation not permitted
cannot read device status, Operation not permitted (1)
larry@debian:~$

Now, you can use blkid to locate the final bit of information you need to get your USB Flash Drive mounted.
[code]
sudo blkid
[/code]
Which shows:
larry@debian:~$ sudo blkid
[sudo] password for larry: 
/dev/sda1: UUID="3146c670-3d45-47bf-b4b8-f89b7e0c9398" TYPE="ext3" 
/dev/sda5: UUID="2d6939e4-3542-4721-a6b0-e50e6c81ae88" TYPE="swap" 
/dev/sda6: UUID="b926c410-0302-4ffa-8ca6-bd714a1d6238" TYPE="ext3" 
/dev/sdb1: UUID="4C05-7851" TYPE="vfat" 
larry@debian:~$

The only other thing needed is a subdirectory, or folder created to allow mounting the USB Flash Drive.
I chose to use /media and I created a subdirectory named usbflash.....ie. /media/usbflash

The final command that allows you access to the USB Flash Drive is:
[code]
sudo mount -o rw /dev/sdab1 /media/usbflash
[/code]

When you are finished copying your files be sure to umount the USB Flash Drive before removing it with:
[code]
sudo umount /media/usbflash
[/code]


  




