Strona 1 z 2

[+] Po podłączeniu telefonu nie pojawia się urządzenie w /dev

: 05 października 2013, 16:39
autor: dark_butterfly
Witam.
Mam debiana Jessie w architekturze amd64 z jądrem:

Kod: Zaznacz cały

$ uname -a
Linux qpa 3.10-3-amd64 #1 SMP Debian 3.10.11-1 (2013-09-10) x86_64 GNU/Linux
Od jakiegoś czasu mam problem z podłączeniem telefonu Samsung B2710 do komputera. Telefon jest ustawiony żeby był widoczny jako "Mass storage". Wcześniej to działało i widziałem go w systemie tak jak zwykłego pendrive'a.
Urządzenie jest rozpoznane przez system:

Kod: Zaznacz cały

$ lsusb
Bus 004 Device 004: ID 0c45:7711 Microdia 
Bus 004 Device 003: ID 046d:c312 Logitech, Inc. DeLuxe 250 Keyboard
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 007: ID 04e8:f000 Samsung Electronics Co., Ltd Intensity 3 (Mass Storage Mode)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
ale w /dev się nie pojawia i nie da się go zamontować. Po podłączeniu pojawiają się logi dmesg:

Kod: Zaznacz cały

$dmesg
(...)
[ 6153.637491] usb 1-4: new high-speed USB device number 7 using xhci_hcd
[ 6153.656834] usb 1-4: New USB device found, idVendor=04e8, idProduct=f000
[ 6153.656840] usb 1-4: New USB device strings: Mfr=3, Product=2, SerialNumber=4
[ 6153.656843] usb 1-4: Product: Qualcomm CDMA Technologies MSM
[ 6153.656854] usb 1-4: Manufacturer: Qualcomm, Incorporated
[ 6153.656856] usb 1-4: SerialNumber: 356092050868691
[ 6153.658200] usb-storage 1-4:1.0: USB Mass Storage device detected
[ 6153.658395] scsi10 : usb-storage 1-4:1.0
[ 6154.659898] scsi 10:0:0:0: Direct-Access     Samsung  GT-B2710-CARD    2.31 PQ: 0 ANSI: 2
[ 6154.660642] sd 10:0:0:0: Attached scsi generic sg2 type 0
[ 6154.661233] sd 10:0:0:0: [sdc] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[ 6154.661704] sd 10:0:0:0: [sdc] Write Protect is off
[ 6154.661710] sd 10:0:0:0: [sdc] Mode Sense: 0f 0e 00 00
[ 6154.662183] sd 10:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 6154.667066]  sdc: sdc1
[ 6154.669809] sd 10:0:0:0: [sdc] Attached SCSI removable disk
[ 6155.183224] sd 10:0:0:0: [sdc] Synchronizing SCSI cache

Kod: Zaznacz cały

$ ls /dev/sdc*
ls: nie ma dostępu do /dev/sdc*: Nie ma takiego pliku ani katalogu
Nie wiem w czym może tkwić problem...

: 05 października 2013, 18:09
autor: Rafal_F
Wklej wyniki polecenia (jako root):

Kod: Zaznacz cały

fdisk -l

: 05 października 2013, 18:13
autor: dark_butterfly

Kod: Zaznacz cały

$ sudo fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00002d6c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   234440703   117219328   83  Linux

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00046a08

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2046  3907028991  1953513473    5  Extended
Partition 1 does not start on physical sector boundary.
/dev/sdb5            2048   976562175   488280064   83  Linux
/dev/sdb6       976564224  3907028991  1465232384   83  Linux

: 05 października 2013, 18:22
autor: Rafal_F
Faktycznie nie ma. A sprawdź jeszcze końcówkę logu:

Kod: Zaznacz cały

/var/log/syslog

: 05 października 2013, 18:35
autor: dark_butterfly

Kod: Zaznacz cały

#cat /var/log/syslog
(...)
Oct  5 18:33:12 xxx kernel: [ 2841.463682] usb 3-4: new high-speed USB device number 3 using xhci_hcd
Oct  5 18:33:12 xxx kernel: [ 2841.483029] usb 3-4: New USB device found, idVendor=04e8, idProduct=f000
Oct  5 18:33:12 xxx kernel: [ 2841.483034] usb 3-4: New USB device strings: Mfr=3, Product=2, SerialNumber=4
Oct  5 18:33:12 xxx kernel: [ 2841.483037] usb 3-4: Product: Qualcomm CDMA Technologies MSM
Oct  5 18:33:12 xxx kernel: [ 2841.483040] usb 3-4: Manufacturer: Qualcomm, Incorporated
Oct  5 18:33:12 xxx kernel: [ 2841.483042] usb 3-4: SerialNumber: 356092050868691
Oct  5 18:33:12 xxx mtp-probe: checking bus 3, device 3: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-4"
Oct  5 18:33:12 xxx mtp-probe: bus: 3, device: 3 was not an MTP device
Oct  5 18:33:12 xxx kernel: [ 2841.484481] usb-storage 3-4:1.0: USB Mass Storage device detected
Oct  5 18:33:12 xxx kernel: [ 2841.484650] scsi7 : usb-storage 3-4:1.0
Oct  5 18:33:13 xxx kernel: [ 2842.486052] scsi 7:0:0:0: Direct-Access     Samsung  GT-B2710-CARD    2.31 PQ: 0 ANSI: 2
Oct  5 18:33:13 xxx kernel: [ 2842.486369] sd 7:0:0:0: Attached scsi generic sg2 type 0
Oct  5 18:33:13 xxx kernel: [ 2842.487332] sd 7:0:0:0: [sdc] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
Oct  5 18:33:13 xxx kernel: [ 2842.487850] sd 7:0:0:0: [sdc] Write Protect is off
Oct  5 18:33:13 xxx kernel: [ 2842.487855] sd 7:0:0:0: [sdc] Mode Sense: 0f 0e 00 00
Oct  5 18:33:13 xxx kernel: [ 2842.488338] sd 7:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Oct  5 18:33:13 xxx kernel: [ 2842.492721]  sdc: sdc1
Oct  5 18:33:13 xxx kernel: [ 2842.495820] sd 7:0:0:0: [sdc] Attached SCSI removable disk
Oct  5 18:33:13 xxx usb_modeswitch: switch device 04e8:f000 on 003/003
Oct  5 18:33:13 xxx kernel: [ 2843.009910] sd 7:0:0:0: [sdc] Synchronizing SCSI cache
A to nie jest tak, że on próbuje synchronizować cache i na tym się zawiesza (nie wiem co znaczy ta ostatnia linijka "Synchronizing SCSI cache"). Może da się jakoś wyłączyć tą synchronizację? Jak podłączam zwykłego pendrive'a to nie ma czegoś takiego...

: 05 października 2013, 18:49
autor: Rafal_F
Spróbuj może przeładować moduł:

Kod: Zaznacz cały

modprobe -r usb_storage
modprobe usb_storage

: 05 października 2013, 19:04
autor: dark_butterfly
Po kilkunastu sekundach od przeładowaniu usb_storage system wykrył telefon i mogę wejść na niego. Ale po fizycznym odłączeniu i podłączeniu problem się powtarza i znowu trzeba przeładowywać moduł żeby zadziałało.
Na moje potrzeby rozwiązanie jest wystarczające, ale nie wiem w czym tkwi problem, że nie działa to automatycznie?

: 05 października 2013, 19:11
autor: Rafal_F
Nie wiem co się dzieje, w logach nic nie ma. Zrób reboot, może się naprawi.

Edycja: wklej jeszcze raz logi, ale po tym jak zadziałało. Zarówno dmesg i syslog, porównamy.

: 05 października 2013, 19:18
autor: dark_butterfly
Po reboocie to samo.
Po przeładowaniu:

Kod: Zaznacz cały

$ dmesg
(...)
[ 1295.990933] usbcore: deregistering interface driver usb-storage
[ 1302.330268] usb-storage 1-4:1.0: USB Mass Storage device detected
[ 1302.330569] scsi12 : usb-storage 1-4:1.0
[ 1302.330666] usbcore: registered new interface driver usb-storage
[ 1325.007797] usb 1-4: reset high-speed USB device number 5 using xhci_hcd
[ 1325.025489] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff88040b042840
[ 1325.025495] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff88040b042880
[ 1325.028102] scsi 12:0:0:0: Direct-Access     Samsung  GT-B2710-CARD    2.31 PQ: 0 ANSI: 2
[ 1325.028465] sd 12:0:0:0: Attached scsi generic sg2 type 0
[ 1325.029196] sd 12:0:0:0: [sdd] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[ 1325.029696] sd 12:0:0:0: [sdd] Write Protect is off
[ 1325.029700] sd 12:0:0:0: [sdd] Mode Sense: 0f 0e 00 00
[ 1325.030131] sd 12:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1325.034710]  sdd: sdd1
[ 1325.037776] sd 12:0:0:0: [sdd] Attached SCSI removable disk

Kod: Zaznacz cały

# cat /var/log/syslog
(...)
Oct  5 19:15:31 xxx kernel: [ 1295.990933] usbcore: deregistering interface driver usb-storage
Oct  5 19:15:37 xxx kernel: [ 1302.330268] usb-storage 1-4:1.0: USB Mass Storage device detected
Oct  5 19:15:37 xxx kernel: [ 1302.330569] scsi12 : usb-storage 1-4:1.0
Oct  5 19:15:37 xxx kernel: [ 1302.330666] usbcore: registered new interface driver usb-storage
Oct  5 19:16:00 xxx kernel: [ 1325.007797] usb 1-4: reset high-speed USB device number 5 using xhci_hcd
Oct  5 19:16:00 xxx kernel: [ 1325.025489] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff88040b042840
Oct  5 19:16:00 xxx kernel: [ 1325.025495] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff88040b042880
Oct  5 19:16:00 xxx kernel: [ 1325.028102] scsi 12:0:0:0: Direct-Access     Samsung  GT-B2710-CARD    2.31 PQ: 0 ANSI: 2
Oct  5 19:16:00 xxx kernel: [ 1325.028465] sd 12:0:0:0: Attached scsi generic sg2 type 0
Oct  5 19:16:00 xxx kernel: [ 1325.029196] sd 12:0:0:0: [sdd] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
Oct  5 19:16:00 xxx kernel: [ 1325.029696] sd 12:0:0:0: [sdd] Write Protect is off
Oct  5 19:16:00 xxx kernel: [ 1325.029700] sd 12:0:0:0: [sdd] Mode Sense: 0f 0e 00 00
Oct  5 19:16:00 xxx kernel: [ 1325.030131] sd 12:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Oct  5 19:16:00 xxx kernel: [ 1325.034710]  sdd: sdd1
Oct  5 19:16:00 xxx kernel: [ 1325.037776] sd 12:0:0:0: [sdd] Attached SCSI removable disk

: 05 października 2013, 19:31
autor: Rafal_F
Możliwe, że usb_modeswitch coś miesza:

Kod: Zaznacz cały

Oct  5 18:33:13 xxx usb_modeswitch: switch device 04e8:f000 on 003/003
I próbuje przełączyć telefon w trym modemu.

Edycja: nie wiem jak to teraz w debianie działa, ale jeżeli nie korzystasz z usb_modeswitch celowo możesz spróbować tak:
1. Zainstaluj pakiet: usb-modeswitch
2. Edytuj plik /etc/usb_modeswitch.conf i zmień/dodaj linie:

Kod: Zaznacz cały

DisableSwitching=1
Jeżeli korzystasz z usb_modeswitch musisz odpowiednio zmodyfikować reguły.