BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 02-24-2007, 01:33 PM   #1
rivviepop
BlackBerry Extraordinaire
 
rivviepop's Avatar
 
Join Date: Dec 2006
Location: san francisco
Model: 8320
PIN: n/a
Carrier: t-mobile
Posts: 2,166
Default Reference: mass storage + linux

Please Login to Remove!

This isn't a HowTo -- merely a reference example of how things should look on your linux system when USB Mass Storage is working properly; if yours is not working, take a look at my syslog et. al. for a little sanity check. The exact results will vary on a distro-by-distro bases, this is a Fedora Core 6 system.

Assumptions:
- BB device with external SD card (8100, 8800, etc.)
- modern linux kernel with 'usb-storage' module compiled
- standard USB cable
- BB device set to USB Storage either 'Yes' or 'Prompt' mode

First, make sure your device at lease has Mass Storage turned on in some fashion -- Options, Advanced Options, Media Card on the handset. The settings should be pretty clear what to do.

(for reference, 'ender' is my laptop's name)

First, prepare to watch your syslog messages; gain root privileges and tail the log. I like to hit Enter a few times after running this to create some blank space on screen so it's easier to see.

Code:
[root@ender /root]
# tail -f /var/log/messages
My device will be set to 'Yes' for this example. Plug in your device and your kernel should automatically load the module "usb-storage" for you, and detect the BB sd card as a scsi device (so drives sda, or sdb, etc.).

Code:
Feb 24 10:16:08 ender kernel: usb 5-3.5: new full speed USB device using ehci_hcd and address 38
Feb 24 10:16:08 ender kernel: usb 5-3.5: config index 0 descriptor too short (expected 69, got 32)
Feb 24 10:16:08 ender kernel: usb 5-3.5: configuration #1 chosen from 1 choice
Feb 24 10:16:08 ender kernel: Initializing USB Mass Storage driver...
Feb 24 10:16:08 ender kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Feb 24 10:16:08 ender kernel: usbcore: registered new interface driver usb-storage
Feb 24 10:16:08 ender kernel: USB Mass Storage support registered.
Feb 24 10:16:13 ender kernel: scsi 2:0:0:0: Direct-Access     RIM      BlackBerrySdCard 0001 PQ: 0 ANSI: 4 CCS
Feb 24 10:16:13 ender kernel: SCSI device sdb: 3970048 512-byte hdwr sectors (2033 MB)
Feb 24 10:16:13 ender kernel: sdb: Write Protect is off
Feb 24 10:16:13 ender kernel: sdb: assuming drive cache: write through
Feb 24 10:16:13 ender kernel: SCSI device sdb: 3970048 512-byte hdwr sectors (2033 MB)
Feb 24 10:16:13 ender kernel: sdb: Write Protect is off
Feb 24 10:16:13 ender kernel: sdb: assuming drive cache: write through
Feb 24 10:16:13 ender kernel:  sdb:
Feb 24 10:16:13 ender kernel: sd 2:0:0:0: Attached scsi removable disk sdb
Feb 24 10:16:13 ender kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0
Feb 24 10:16:14 ender hald: mounted /dev/sdb on behalf of uid 500
Above you see the kernel has loaded usb-storage, which in turn detected the card and has assigned it drive "sdb" (sda is my internal disk, a SATA drive). Furthermore the Fedora Core subsystem has automatically mounted my device for me, which may or may not happen with your particular distro.

If you need to mount it by hand, here is the entry from /etc/mtab (the place where the kernel tracks mounts, don't edit this file!) on my machine that corresponds to the mount:

Code:
/dev/sdb /media/disk vfat rw,noexec,nosuid,nodev,shortname=winnt,uid=500 0 0
This line, in a slightly tidier version, can be added to your /etc/fstab file (you *can* edit this file, but make sure you know what you're doing. when in doubt make a backup first.) to automount it for you; this part is distro specific, so use the best practices as appropriate. Most modern distros have a GUI tool to set this up, so try using that first.

When you unmount the device: if you need to just yank the cable out and go (say you're in a hurry) at least be sure to type "sync" on the commandline real quick to force all writes to disk. The better way, of course, is to properly unmount the device using the 'umount' command or the Eject menu option if it shows on your desktop.

The messages with a clean unmount and cable disconnect - I will use the 'Unmount Volume' rightmouse option on my Fedora Core desktop - should look like this more or less:

Code:
Feb 24 10:24:45 ender hald: unmounted /dev/sdb from '/media/disk' on behalf of uid 500
Feb 24 10:24:54 ender kernel: usb 5-3.5: USB disconnect, address 38
If you just yank the cable out and go, it might look like this:

Code:
Feb 24 10:26:03 ender kernel: usb 5-3.5: USB disconnect, address 39
Feb 24 10:26:03 ender kernel: VFS: busy inodes on changed media.
Feb 24 10:26:03 ender kernel: scsi 3:0:0:0: rejecting I/O to dead device
Feb 24 10:26:03 ender last message repeated 3 times
Feb 24 10:26:03 ender kernel: sdb : READ CAPACITY failed.
Feb 24 10:26:03 ender kernel: sdb : status=0, message=00, host=1, driver=00 
Feb 24 10:26:03 ender kernel: sdb : sense not available. 
Feb 24 10:26:03 ender kernel: scsi 3:0:0:0: rejecting I/O to dead device
Feb 24 10:26:03 ender kernel: sdb: Write Protect is off
Feb 24 10:26:03 ender kernel: sdb: assuming drive cache: write through
Feb 24 10:26:03 ender hald[2556]: forcibly attempting to lazy unmount /dev/sdb as enclosing drive was disconnected
Feb 24 10:26:03 ender kernel: scsi 3:0:0:0: rejecting I/O to dead device
Feb 24 10:26:03 ender hald: unmounted /dev/sdb from '/media/disk' on behalf of uid 0
As you can see by the syslog spam, it's not a good thing to just yank out the cable - try and avoid that if you can and properly unmount the device. But, we live in the real world and sometimes that's not always possible.

==
NOTE: kernel "kernel-2.6.19-1.2911.fc6" was used in the above examples on a ThinkPad T43 with the Pearl 8100 plugged into an external powered USB 2.0 hub. So, you do not need to be directly plugged in to the machine on a direct USB port, hubs work fine. I would *not* recommend using a non-powered USB hub.
__________________
[ Linux & BlackBerry ] http://www.blackberryforums.com/linux-users-corner/

Last edited by rivviepop; 02-24-2007 at 01:36 PM..
Offline  
Old 02-24-2007, 01:38 PM   #2
LunkHead
BlackBerry God
 
LunkHead's Avatar
 
Join Date: Jan 2005
Location: Cardboard box
Model: 850
OS: 0.0.00001
PIN: kie swear
Carrier: USPS Priority
Posts: 11,203
Default

You Sir, ROCK!

*bows* giving the 'I am not worthy' move
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


OEM  IBM Type 5441 WheelWriter 3 1356658 1362400-02 Main Boards Tested Working picture

OEM IBM Type 5441 WheelWriter 3 1356658 1362400-02 Main Boards Tested Working

$49.99



OEM IBM Selectric II Key Tops & Parts picture

OEM IBM Selectric II Key Tops & Parts

$49.95



Lot of 2 IBM Correctable Ribbon Cassette Black 1299300 NOS Original OEM picture

Lot of 2 IBM Correctable Ribbon Cassette Black 1299300 NOS Original OEM

$12.00



New 2 Sets of 2 (4) keys total OEM 9952 IBM Keys for Cash Drawers Displays Locks picture

New 2 Sets of 2 (4) keys total OEM 9952 IBM Keys for Cash Drawers Displays Locks

$14.99



IBM Genuine OEM Printer Filler Wide Credit Card Holder 10N1259 picture

IBM Genuine OEM Printer Filler Wide Credit Card Holder 10N1259

$24.79



IBM WHEELWRITER TYPEWRITER TRANSPORT MOTOR Series II - OEM wheelwriter parts picture

IBM WHEELWRITER TYPEWRITER TRANSPORT MOTOR Series II - OEM wheelwriter parts

$28.00







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.