# Mount Sony Ericsson c902

## wamwam

Hi,

I can't moount my sony ericsson c902... I tried Mass Storaged Mode and file transfer mode but nothing is working.

lsusb gives me:

Bus 001 Device 005: ID 0fce:00d4 Sony Ericsson Mobile Communications AB

In transfert mode, klauncher return this error:

unknonw camera protocol

Can someone help me??

----------

## tliou

I have a sony ericsson w580i that is a little touchy to mount.

Right after plugging your phone in, what does the phone say, and what does typing dmesg say?  We want just the last few lines that say something about a usb device.

For example.  When I plug my phone into the USB port, it asks whether I want to have it function for File Transfer or as a Phone.  dmesg at that point says:

hub 1-0:1.0: unable to enumerate USB device on port 1

usb 2-1: new full speed USB device using uhci_hcd and address 4

usb 2-1: configuration #3 chosen from 1 choice

If I choose File Transfer on the phone, the last two lines of dmesg now say:

attempt to access beyond end of device

sdb: rw=0, want=7999488, limit=7999298

----------

## wamwam

If I choose file transfert, dmesg says:

usb 1-8: new high speed USB device using ehci_hcd and address 4

usb 1-8: configuration #4 chosen from 1 choice

If I choose Mass Storage Mode:

usb 1-8: new high speed USB device using ehci_hcd and address 5

usb 1-8: configuration #2 chosen from 1 choice

scsi5 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 5

usb-storage: waiting for device to settle before scanning

scsi 5:0:0:0: Direct-Access     Sony Eri Memory Stick        0 PQ: 0 ANSI: 0

sd 5:0:0:0: [sda] 368493 512-byte hardware sectors (189 MB)

sd 5:0:0:0: [sda] Test WP failed, assume Write Enabled

sd 5:0:0:0: [sda] Assuming drive cache: write through

sd 5:0:0:0: [sda] 368493 512-byte hardware sectors (189 MB)

sd 5:0:0:0: [sda] Test WP failed, assume Write Enabled

sd 5:0:0:0: [sda] Assuming drive cache: write through

 sda: sda1

sd 5:0:0:0: [sda] Attached SCSI removable disk

sd 5:0:0:0: Attached scsi generic sg1 type 0

usb-storage: device scan complete

----------

## tliou

Now do this:

cd /

ls

There should be a directory named media.  If so,

cd /media

mkdir sony

mount /dev/sda1 /media/sony

If this works, you should be able to change directory to /media/sony and do an ls to show you what is on your card.

----------

## wamwam

I already tried it, but I've no /dev/sda

Here what I've in /dev/s*

mount /dev/s

scd0        sequencer2  sg1         snd/        stderr      stdout

sequencer   sg0         shm/        sr0         stdin

I tried sg0 et sg1, not working.

Thanks so much for your quick answers, if you have any over idea  :Wink: 

----------

## tliou

Odd.  I've installed linux from various distributions 10-20 times but have never needed to do this (as root of course):

mknod /dev/sda  b 8 0

mknod /dev/sda1 b 8 1

mknod /dev/sda2 b 8 2

You can add as many lines as needed for the number of partitions that you have on the memory stick (up to 15 I think), and if you are planning on adding more than one device at a time, you can modify to sdb, sdc etc.

After adding /dev/sda and /dev/sda1 as a minimum, try the lines I suggested again.

You might also want to run this line before and after plugging your phone into a usb slot and see that it is being properly detected:

less /proc/bus/usb/devices

I'm holding my breath.

----------

## tliou

It occurred to me that all recent versions of Gentoo Linux don't need us to ever issue a mknod command for usb devices.  The udev system handles this.  So the question, is udev installed correctly on your system?

----------

## wamwam

Even doing the mknod, it's not working.

I've udev installed properly (well, I think)

Here the output of less /proc/bus/usb/devices :

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  6 Spd=480 MxCh= 0

D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=0fce ProdID=e0d4 Rev= 0.00

S:  Manufacturer=Sony Ericsson

S:  Product=Memory Stick

S:  SerialNumber=3537970281794750

C:* #Ifs= 1 Cfg#= 2 Atr=80 MxPwr=500mA

I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

Thanx again

----------

## tliou

summarizing the problem as it stands: 

dmesg shows that your phone is detected when you plug it in on the usb bus, and it is handled using ehci_hcd

usb-storage then assigns it to sda and notices that you have only one partition, sda1

At this point, udev is supposed to create nodes for you at /dev/sda and /dev/sda1.

You report, however, that /dev/sda and /dev/sda1 are not present and that even creating them by hand is ineffective.

This suggests a few possibilities:

1. Something is not quite right with the way that the usb device is handled

   -------question: do other devices plug in properly?  A usb memory stick of some sort or external hard drive will demonstrate this.  If other devices fail to mount properly, then

                          it may be helpful to redo the instructions in this document: http://www.gentoo.org/doc/en/usb-guide.xml .  Pay special attention to the config options for the kernel.

                          It may be reasonable to redo these instructions in any case.

   -------question: does your phone plug into any other computer and get mounted properly?  If it mounts properly for (I hate to say this) WinXP, especially on the same computer, it                    

                          rules out a defect in your phone but does raise the possibility that there is a proprietary interface with that particular model of phone.  If you have a friend with a

                          working recent installation of Gentoo Linux, plug in your phone and report back the results of dmesg.  That is likely to provide the clues needed to solve this 

                          problem.

2. Something is not quite right with udev.  If other devices plug in and get removed without difficulty, this will argue that udev is working right.  However, even then, not all devices 

            are created equally.  You may want to check out this document:  http://www.gentoo.org/doc/en/udev-guide.xml .  Again, pay special attention to the kernel settings.

If you notice that either of the documents leads you to change a configuration in your kernel, make sure that you emerge udev after recompiling the kernel and then run revdep-rebuild.

Sorry this seems to be such a vexing problem.

----------

## tliou

Sorry to be fragmented.  But I was searching elsewhere, and someone got a Sony C902 to mount once using the module libusual.  Later posts say that it couldn't be repeated and didn't work.

Should you care to try:

Inside the kernel (cd /usr/src/linux; make menuconfig)

Device Drivers -->

     USB support -->

          The shared table of common (or usual) storage devices 

Checking this option enable libusual (* for in the kernel, so no modprobe headaches or M if you want it as a module)

You can check to see if this is already set in your kernel by doing:

grep CONFIG_USB_LIBUSUAL /usr/src/linux/.config

If you want this to work, you need the response to be

CONFIG_USB_LIBUSUAL=y

not

# CONFIG_USB_LIBUSUAL is not set

DISCLAIMER:  I don't need this for any device I own, so I have not tried this myself (nor can I without your phone). Selecting single options that are part of the standard option set in the kernel is usually harmless, but one never knows when there will be an unusual interaction leading to an unstable system; save your old kernel and make sure you protect your data!!

This will require a rebuild of the kernel and revdep-rebuild which could be quite cumbersome.

The other piece of info I found rooting around the web is that this might just be a diversion.  Apparently, some older kernels allow the phone to mount (2.6.18 ) but some recent ones (2.6.26) do not.  In that case, you are stuck trying another kernel.  What does uname -a return?

----------

## wamwam

 *Quote:*   

> 
> 
> 	1. Something is not quite right with the way that the usb device is handled
> 
> 	-------question: do other devices plug in properly? A usb memory stick of some sort or external hard drive will demonstrate this. If other devices fail to mount properly, then
> ...

 

All my over usb devices work well. I have a memory stick, an extenal hard drive, an usb mouse and an usb keyboard.

 *Quote:*   

> 
> 
> 	-------question: does your phone plug into any other computer and get mounted properly? If it mounts properly for (I hate to say this) WinXP, especially on the same computer, it
> 
> 	rules out a defect in your phone but does raise the possibility that there is a proprietary interface with that particular model of phone. If you have a friend with a
> ...

 

I have a win XP and my phone mount perfectly in it. As you suggest, I treid my phone on a friend computer with Gentoo installed.

And he's got the same problem than me. However, he has a Sony Eroicsson mobile (older than mine) which works perfectly.

 *Quote:*   

> 
> 
> 	2. Something is not quite right with udev. If other devices plug in and get removed without difficulty, this will argue that udev is working right. However, even then, not all devices
> 
> 	are created equally. You may want to check out this document: http://www.gentoo.org/doc/en/udev-guide.xml . Again, pay special attention to the kernel settings.
> ...

 

I missed the gphoto2 flag in order to use the media transfert option. Then I added it and now I have a new error when Konqueror try to mount my camera! At first it seems to work, it's writting "initialising camera", then "downloading" but after a few seconds it wrote "impossible to read the file, undefined error"

I checked the UDEV web-guide, and everything seems to be well configured for me.

I add the option you told me in my kernel, and it's not working but one of the CPU core stays at 100% until I disconnect the phone now. No change in dmesg nor udev.

I think I might need to wait for a new kernel using windows to tranfert my files.

Thanks again

----------

## tliou

I think that you are right.  It is likely to be a proprietary problem.  It may be fixable by upgrading the kernel.  What does uname -a return?

----------

## wamwam

uname -a return:

Linux localhost 2.6.27-gentoo-r7 #9 SMP Mon Jan 19 21:18:43 CET 2009 i686 Intel(R) Core(TM)2 Duo CPU E6750 @ 2.66GHz GenuineIntel GNU/Linux

----------

## tliou

I think two choices remain.

1) Try a different kernel when one comes out.  I see that you have the latest kernel, so you'll need to wait a bit.

2) A little higher risk (ie, protect your data!!).  Take a look at this site on the ubuntu forums site where someone has had the same problem as you but has had someone more clever than me to help:

http://ubuntuforums.org/showthread.php?t=861120&page=8

The fix there may or may not work.  It is an adaptation from other threads about other phones and usb devices, but the writer reported that the following solution worked.  In essence, the steps to take would be to do the following:

```

   mv /etc/udev/rules.d/60-persistent-storage.rules /etc/udev/rules.d/60-persistent-storage.rules.old

   nano /etc/udev/rules.d/60-persistent-storage.rules

```

and put this code in the new file that you are making:

```

# do not edit this file, it will be overwritten on update

# persistent storage links: /dev/disk/{by-id,by-uuid,by-label,by-path}

# scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de>

ACTION!="add", GOTO="persistent_storage_end"

SUBSYSTEM!="block", GOTO="persistent_storage_end"

# skip rules for inappropriate block devices

KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-*|md*", GOTO="persistent_storage_end"

# never access non-cdrom removable ide devices, the drivers are causing event loops on open()

KERNEL=="hd*[!0-9]", ATTR{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end"

KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GOTO="persistent_storage_end"

# ignore partitions that span the entire disk

ATTR{whole_disk}=="*", GOTO="persistent_storage_end"

# /sys/class/block will export this

ENV{DEVTYPE}!="?*", ATTR{range}=="?*", ENV{DEVTYPE}="disk"

ENV{DEVTYPE}!="?*", ATTR{start}=="?*", ENV{DEVTYPE}="partition"

# for partitions import parent information

ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*"

# by-id (hardware serial number)

KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"

KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"

KERNEL=="hd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"

KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"

KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p"

KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted --fallback-to-sysfs -s %p -d $tempnode"

KERNEL=="cciss?c[0-9]d[0-9]", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted --ignore-sysfs -s %p -d $tempnode", ENV{ID_BUS}="cciss"

KERNEL=="sd*[!0-9]|sr*|cciss?c[0-9]d[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"

KERNEL=="sd*[0-9]|cciss*p[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"

# libata compat (links like hd*)

KERNEL=="sd*[!0-9]|sr*", ENV{ID_VENDOR}=="ATA", PROGRAM="ata_id $tempnode", RESULT=="?*", ENV{ID_ATA_COMPAT}="$result", SYMLINK+="disk/by-id/ata-$env{ID_ATA_COMPAT}"

KERNEL=="sd*[0-9]", ENV{ID_ATA_COMPAT}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_ATA_COMPAT}-part%n"

KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}"

KERNEL=="mmcblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n"

# by-path (shortest physical path)

ENV{DEVTYPE}=="disk", IMPORT{program}="path_id %p"

ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}"

ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"

KERNEL=="sr*", GOTO="persistent_storage_end"

KERNEL=="hd*[!0-9]", ATTR{removable}=="1", GOTO="persistent_storage_end"

# by-label/by-uuid (filesystem properties)

ENV{DEVTYPE}=="partition", IMPORT{program}="vol_id --export $tempnode"

ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"

ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"

LABEL="persistent_storage_end"

```

I don't know that this will work.  One obvious problem is that anytime udev is changed, you'll need to puzzle out what changed and if it is introducing the problem again should this work.  It is changing some of the rules for dealing with devices under udev.  The new code is shorter than the original that you have, and the risk is that other things may stop working.  You can run this code to see what you've actually changed:

```
diff /etc/udev/rules.d/60-persistent-storage.rules /etc/udev/rules.d/60-persistent-storage.rules.old
```

You can undo these changes by doing this and be back to where you are now with this line (note that the ".old" has moved):

```
  mv /etc/udev/rules.d/60-persistent-storage.rules.old /etc/udev/rules.d/60-persistent-storage.rules
```

Beyond this, I think I'm out of ideas.  :Crying or Very sad: 

----------

## wamwam

Ok thank you very much, it's now working I'v access to my phone. Unfortunatly I can't access to my phone card!

I'll try to see on the ubuntu forum.

----------

## tliou

Well, it's progress.  Just for my interest, please post here again if you get any further.  Thanks.

----------

## webfishrune

I realise this thread is quite old bit did you ever sort this out? I have the same problem - i can see the internal memory but not the second device, which is a removable memory stick. 

Thanks

----------

## tliou

I'm afraid that I never heard back and didn't do any more.  I have a w580i phone that just works for downloads to the phone, and I have not tried to make it work as a modem.  Of course, it has been nearly a year, and I notice that with updated hal and thunar (I run xfce), my phone mounts automatically these days, but I don't have the C902 phone.  I'll take another look around the web though.  It's been a while, and these things often get sorted out.

XXXX

Well, nothing very new out there.  However, the problems that were being discussed, mostly over on the Ubuntu forums, were with 2.6.24 and 2.6.25 kernels, and there was a cryptic mention of needing to patch the kernel to make it work with the Sony c902.  Typically, those types of patches get incorporated in later kernels.  I think trying the newest kernel, currently 2.6.32 might be a reasonable thing to try.  I recently updated my kernel on a couple machines to 2.6.31-r6 and can report that that is stable but 2.6.30-r8 was not.  I have no idea about 2.6.31, so back everything up before trying that option.

----------

## tliou

Ah.

A reasonable solution if you don't already own the phone.

----------

## poly_poly-man

add "scan all luns on device" in scsi settings.

If usb mass storage ever only reveals one of several devices you were expecting, there's the culprit.

----------

