[Q] Linux - Mounting SD card over USB? - T-Mobile LG G2x

I've hooked my new G2x up to windows, installed LG drivers, and get two separate drives to access Internal memory and external SD card.
However, when I hook it up to my Gentoo box, It only seems to recognize internal memory.
Looking at dmesg, here is what seems to be the relevant output:
Code:
usb 2-1.5: new high speed USB device number 3 using ehci_hcd
usb 2-1.5: config 1 interface 3 altsetting 0 has 3 endpoint descriptors, different from the interface descriptor's value: 2
scsi6 : usb-storage 2-1.5:1.4
scsi 6:0:0:0: Direct-Access LGE P999DW 0000 PQ: 0 ANSI: 2
sd 6:0:0:0: Attached scsi generic sg3 type 0
sd 6:0:0:0: [sdc] Attached SCSI removable disk
sd 6:0:0:0: [sdc] 10942464 512-byte logical blocks: (5.60 GB/5.21 GiB)
sd 6:0:0:0: [sdc] No Caching mode page present
sd 6:0:0:0: [sdc] Assuming drive cache: write through
sd 6:0:0:0: [sdc] No Caching mode page present
sd 6:0:0:0: [sdc] Assuming drive cache: write through
sdc:
sdc: detected capacity change from 5602541568 to 0
I assuming I'm at least missing a kernel module. Any ideas as to which it would be?
(Kernel 3.0, udev+udisks)

This is just a guess but do you have "ntfs-3g" installed on your box?

Yes, I do have two partitions mounted with ntfs-3g.
Is this an issue/conflict?

Related

format sd card

I have a sd card that can't be read anymore by my Galaxy S III as the filesystem became corrupted (after inserting the card in a bricked device). Galaxy S II with aokp firmware can read it but I couldn't find an application to format it.
If I insert the sd card in my notebook card reader I can't do anything as every read attempt fails:
[ 693.705114] scsi 7:0:0:0: >Direct-Access Single Flash Reader 1.00 PQ: 0 ANSI: 0
[ 693.706661] sd 7:0:0:0: >Attached scsi generic sg2 type 0
[ 724.389041] usb 2-1.4: >reset high-speed USB device number 6 using ehci_hcd
[ 734.528360] usb 2-1.4: >reset high-speed USB device number 6 using ehci_hcd
[ 750.652880] usb 2-1.4: >reset high-speed USB device number 6 using ehci_hcd
[ 750.820471] usb 2-1.4: >reset high-speed USB device number 6 using ehci_hcd
[ 760.959655] usb 2-1.4: >reset high-speed USB device number 6 using ehci_hcd
[ 761.052599] sd 7:0:0:0: >Device offlined - not ready after error recovery
[ 761.052676] sd 7:0:0:0: >rejecting I/O to offline device
[ 761.052690] sd 7:0:0:0: >rejecting I/O to offline device
[ 761.052697] sd 7:0:0:0: >rejecting I/O to offline device
[ 761.052702] sd 7:0:0:0: >[sdb] READ CAPACITY failed
[ 761.052705] sd 7:0:0:0: >[sdb]
[ 761.052708] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[ 761.052710] sd 7:0:0:0: >[sdb] Sense not available.
[ 761.052717] sd 7:0:0:0: >rejecting I/O to offline device
[ 761.052722] sd 7:0:0:0: >[sdb] Write Protect is off
[ 761.052726] sd 7:0:0:0: >[sdb] Mode Sense: 00 00 00 00
[ 761.052731] sd 7:0:0:0: >rejecting I/O to offline device
[ 761.052735] sd 7:0:0:0: >[sdb] Asking for cache data failed
[ 761.052738] sd 7:0:0:0: >[sdb] Assuming drive cache: write through
[ 761.052923] sd 7:0:0:0: >[sdb] Attached SCSI removable disk
Click to expand...
Click to collapse
This was a linux dmesg output.
How could I do?
you can't format it in windows? right click on it, then format..
Else, i just used a programm yesterday to format my 64gig sdcard to fat32 for my cowon:
http://www.ridgecrop.demon.co.uk/index.htm?fat32format.htm
probably this will work.
D4rkSoRRoW said:
you can't format it in windows? right click on it, then format..
Else, i just used a programm yesterday to format my 64gig sdcard to fat32 for my cowon:
...link...
probably this will work.
Click to expand...
Click to collapse
Under windows I can hear the sound of the recognized device when I insert the card, but I can't format it. It says "no disk inserted".
I have had cases where I tried using the card reader on my laptop and couldn't see the card. Then I used a separate usb card reader and was able to perform the functions I needed.
Sent from my Inspire 4G using Tapatalk 2
Yeah i use a usb adapter too, so it recognizes it as usb flashdrive, and not as card.
But Linux has a formating tool for sure..

[Resolved] [Q] Problem identifying Chinese Tablet

I have been a reader of the forum for a log time but until now need your help to identify a Chinese tablet that a friend of mine received as a gift.
The problem is that it is locked in the boot (it only displays Android on screen) and I need to reinstall it and the only information I have is what dmesg returned when connected via USB
:~$ dmesg | tail
[161396.250396] usb 2-1.1: Product: Android
[161396.250399] usb 2-1.1: Manufacturer: USB Developer
[161396.250401] usb 2-1.1: SerialNumber: 20080411d412e5d
[161401.258415] scsi10 : usb-storage 2-1.1:1.0
[161402.252904] scsi 10:0:0:0: Direct-Access USB 2.0 USB Flash Driver 0100 PQ: 0 ANSI: 2
[161402.253268] scsi 10:0:0:1: Direct-Access USB 2.0 USB Flash Driver 0100 PQ: 0 ANSI: 2
[161402.254146] sd 10:0:0:0: Attached scsi generic sg9 type 0
[161402.254372] sd 10:0:0:1: Attached scsi generic sg10 type 0
[161402.257914] sd 10:0:0:1: [sdh] Attached SCSI removable disk
[161402.260390] sd 10:0:0:0: [sdg] Attached SCSI removable disk
Click to expand...
Click to collapse
I already try to find the serial number and the manufacturer on google but can not find anything related. I took some pictures from the tablet and the box you can find them here -> imgur.com/a/I2k3Y
Thanks for any help
SOLUTION
I posted the same question in StackExchange -> android.stackexchange.com/questions/64892/help-identifying-tablet and it's working now

[Q] USB OTG Mount JNI errors

Ok not your usual thread. Have the USB OTG Y cable, drive is getting power, tried using a usb hub as well for testing to see if that made a difference (a forum topic seemed to indicated it did) got the same results.. The drive is recognized by the device in dmesg logs, however on the android logcat it is not. It throws a JNI error. I have logs for both.
Motorola Atrix 2 - Of course
Running Slim-Edison-4.4.2.build.4-UNOFFICIAL-20140330-1804
Build Number: slim_edison-userdebug 4.4.2 KVT49L
JBX Kernel
3.0.31-JBX-3.0-Hybrid-Atrix2-4.4
Dmesg
Code:
<6>[ 1445.076751,1] usb 1-1: new high speed USB device number 8 using musb-hdrc
<3>[ 1445.226043,1] usb 1-1: device v0781 p5406 is not supported
<6>[ 1445.226379,1] usb 1-1: New USB device found, idVendor=0781, idProduct=5406
<6>[ 1445.226959,1] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
<6>[ 1445.227508,1] usb 1-1: Product: U3 Cruzer Micro
<6>[ 1445.227813,1] usb 1-1: Manufacturer: SanDisk
<6>[ 1445.228088,1] usb 1-1: SerialNumber: 00009970B101148C
<6>[ 1445.237518,0] scsi6 : usb-storage 1-1:1.0
<5>[ 1446.241394,0] scsi 6:0:0:0: Direct-Access SanDisk U3 Cruzer Micro 6.51 PQ: 0 ANSI: 0 CCS
<5>[ 1446.243743,0] sd 6:0:0:0: Attached scsi generic sg0 type 0
<5>[ 1446.245269,0] sd 6:0:0:0: [sda] 2014079 512-byte logical blocks: (1.03 GB/983 MiB)
<5>[ 1446.245819,0] sd 6:0:0:0: [sda] Write Protect is off
<7>[ 1446.246002,0] sd 6:0:0:0: [sda] Mode Sense: 45 00 00 08
<3>[ 1446.246398,0] sd 6:0:0:0: [sda] No Caching mode page present
<3>[ 1446.246582,0] sd 6:0:0:0: [sda] Assuming drive cache: write through
<3>[ 1446.249450,0] sd 6:0:0:0: [sda] No Caching mode page present
<3>[ 1446.250000,0] sd 6:0:0:0: [sda] Assuming drive cache: write through
<6>[ 1446.252593,0] sda: sda1
<3>[ 1446.260620,1] sd 6:0:0:0: [sda] No Caching mode page present
<3>[ 1446.261169,1] sd 6:0:0:0: [sda] Assuming drive cache: write through
<5>[ 1446.261444,1] sd 6:0:0:0: [sda] Attached SCSI removable disk
Logcat
Code:
04-02 13:24:44.954 659 921 E UsbHostManagerJNI: usb_device_open failed
from Services/JNI/com_android_server_UsbHostManager.cpp
Code:
static int usb_device_added(const char *devname, void* client_data) {
struct usb_descriptor_header* desc;
struct usb_descriptor_iter iter;
struct usb_device *device = usb_device_open(devname);
if (!device) {
ALOGE("usb_device_open failed\n");
return 0;
}
Through various USB programs the most common error seems to say the kernel recognizes it, the linux system has the pointers and classes but the Android side does not recognize it. Therefore it can only be mounted.
This also appears for regular plugged in usb devices as well mice, cameras etc.
Test was duplicated on original 4.0.4 rooted, PacMan Rom, and LiquidSmooth. Respective kernels that came with those roms as well.
I've attempted to do alot of research into getting this to work. Any help would be appreciate thanks!
More info, connected ADB and dumped logs.
dumpsys
Code:
DUMP OF SERVICE usb:
USB Manager State:
USB Device State:
Current Functions: mtp,adb
Default Functions: mtp,adb
mConnected: false
mConfigured: false
mCurrentAccessory: null
Kernel state: DISCONNECTED
Kernel function list: mtp,adb
IOException: java.io.FileNotFoundException: /sys/class/android_usb/android0/f_mass_storage/lun/file: open failed: ENOENT (No such file or directory)
Could this be Kernel related? Running 3.0.8, Cyanogenmod 11 Unofficial Edison 2014-03-27
Kernel : 3.0.8g-2763615-dirty
At this point im thinking maybe it wont work on 4.4.2 possibly? May need to go with 4.3 or lower? Or do I just need to go searching for a different kernel? I mean ive tried two so far and no luck. BTW Pacman rom listed previously was 4.3
Rebelj12a said:
More info, connected ADB and dumped logs.
dumpsys
Code:
DUMP OF SERVICE usb:
USB Manager State:
USB Device State:
Current Functions: mtp,adb
Default Functions: mtp,adb
mConnected: false
mConfigured: false
mCurrentAccessory: null
Kernel state: DISCONNECTED
Kernel function list: mtp,adb
IOException: java.io.FileNotFoundException: /sys/class/android_usb/android0/f_mass_storage/lun/file: open failed: ENOENT (No such file or directory)
Could this be Kernel related? Running 3.0.8, Cyanogenmod 11 Unofficial Edison 2014-03-27
Kernel : 3.0.8g-2763615-dirty
At this point im thinking maybe it wont work on 4.4.2 possibly? May need to go with 4.3 or lower? Or do I just need to go searching for a different kernel? I mean ive tried two so far and no luck. BTW Pacman rom listed previously was 4.3
Click to expand...
Click to collapse
Now on Paranoid Android 4.2 [4.4.2] Beta3
PA_Edison-userdebug 4.4.2 KVT49L
Anyone have anything? Firmwares that have worked kernels that have worked for them? Anything?
I mean ive even tried 3 different ways of hooking it up.
-Powered usb hub.
-OTG Y cable
-OTG Cable with Manual 5v power to the cable itself.
Ok so nobody has anything? Is this something that just does not work at all with the Atrix 2?
Current trying Mokee 4.3 August 26th build. No dice, JBX kernel install is next.
Again if anyone has any experience with this I'd appreciate it if only to send me off in the right direction or just to confirm it doesnt so I can stop trying. Thanks
OK nevermind then.
Thanks to some great support from Chainfire who created USB Host Diagnostics app for android. I was able to search for successful OTG test instances on the Atrix 2. Looks like the only successes documented in the database were for the stock 4.0.4 Atrix firmware and lower. No support or success for anyone who submitted on custom roms.
Good basepoint, ill be going from there in figuring out how to get it to work.
In case anyone new is wondering. Atrix 2 does NOT have USB OTG working for any custom at all. Even with powered usb otg host cable. No configuration will work at all. Must be something that never made it to the custom roms at least from 4.3 onwards.
For now you will have to have stock firmware and custom kernel for said stock firmware.
Thats all for now. Hopefully those searching will find this useful at least.
Rebelj12a said:
OK nevermind then.
Thanks to some great support from Chainfire who created USB Host Diagnostics app for android. I was able to search for successful OTG test instances on the Atrix 2. Looks like the only successes documented in the database were for the stock 4.0.4 Atrix firmware and lower. No support or success for anyone who submitted on custom roms.
Good basepoint, ill be going from there in figuring out how to get it to work.
In case anyone new is wondering. Atrix 2 does NOT have USB OTG working for any custom at all. Even with powered usb otg host cable. No configuration will work at all. Must be something that never made it to the custom roms at least from 4.3 onwards.
For now you will have to have stock firmware and custom kernel for said stock firmware.
Thats all for now. Hopefully those searching will find this useful at least.
Click to expand...
Click to collapse
UPDATE - Solved see this thread.

DVD-R burned with vanilla Android 4.1.1

I have just burned a DVD-R connected to my Padfone 2 under vanilla Android 4.1.1. Here are the steps:
(0) install version 9 of gentooandroid.sourceforge.net on a device on which step (4) below can be done (root rights will do).
(1) Connect the DVD writer with an OTG cable, a V cable if you can http://www.ebay.fr/itm/Micro-USB-Ho..._MobilePhoneDataCables_JN&hash=item417d1627de or use a powered USB HUB.
(2) /dev/sg0 should appear
(3) dmesg (if run as root) should show
Code:
[15:35:07.998763](CPU:0-pid:29826:scsi_scan_0) scsi 0:0:0:0: Attached scsi generic sg0 type 5
and take note of the 0:0:0:, which will be refered to as dev=0,0,0 below.
(4) Setup /dev/sg0 so that it will be accessible from Terminal IDE:
Code:
chgrp-moved 10105 /dev/sg0 ; chmod 660 /dev/sg0
where 10105 is the gid of terminal IDE (or, in my case, terminal emulator)
(5) install cdrecord with
Code:
FEATURES=-sandbox PORTAGE_BINHOST=http://sourceforge.net/projects/gentooandroid/files/packages/packages emerge --autounmask-write -gbav --binpkg-respect-use=y cdrtools
(6) insert a blank DVD-R media and close the drive
(7)
Code:
cdrecord dev=0,0,0 driveropts=help -checkdrive
which shows:
Cdrecord-ProDVD-ProBD-Clone 3.00 (--) Copyright (C) 1995-2010 Jo:rg Schilling
scsidev: '0,0,0'
scsibus: 0 target: 0 lun: 0
Linux sg driver version: 3.5.34
Using libscg version 'schily-0.9'.
Device type : Removable CD-ROM
Version : 0
Response Format: 2
Capabilities :
Vendor_info : 'TSSTcorp'
Identifikation : 'CDDVDW SE-218CN '
Revision : 'MF00'
Device seems to be: Generic mmc2 DVD-R/DVD-RW/DVD-RAM.
Driver options:
burnfree Prepare writer to use BURN-Free technology
noburnfree Disable using BURN-Free technology
layerbreak Write DVD-R/DL media in automatic layer jump mode
layerbreak=val Set jayer jump address for DVD+-R/DL media
(8) Burn NOW the content of directory/ on the DVD-R:
Code:
mkisofs -V DVDName directory/ | cdrecord -v -dao -tsize `mkisofs -V DVDName -print-size directory/`s fs=6m speed=2 dev=0,0,0 -
(9) eject manually, and test media on another computer.
I may post a video of (8) if asked for that, showing the DVD-R writer in action.
i will try it and tell you.....good work
digyvijaykumar123 said:
i will try it and tell you.....good work
Click to expand...
Click to collapse
If you have any problem installing gentooandroid, I can help you. You can use this thread for example.
I have a lot of messages in dmesg :
Code:
[14:55:47.055035](CPU:0-pid:7033:cdrecord) usb-storage: queuecommand_lck called
[14:55:47.055127](CPU:0-pid:6499:usb-storage) usb-storage: *** thread awakened.
[14:55:47.055188](CPU:0-pid:6499:usb-storage) usb-storage: Command WRITE_10 (10 bytes)
[14:55:47.055249](CPU:0-pid:6499:usb-storage) usb-storage: 2a 00 00 00 ba 00 00 00 10 00
[14:55:47.055401](CPU:0-pid:6499:usb-storage) usb-storage: Bulk Command S 0x43425355 T 0xf9b L 32768 F 0 Trg 0 LUN 0 CL 12
[14:55:47.055493](CPU:0-pid:6499:usb-storage) usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
[14:55:47.055707](CPU:0-pid:6499:usb-storage) usb-storage: Status code 0; transferred 31/31
[14:55:47.055798](CPU:0-pid:6499:usb-storage) usb-storage: -- transfer complete
[14:55:47.055859](CPU:0-pid:6499:usb-storage) usb-storage: Bulk command transfer result=0
[14:55:47.055920](CPU:0-pid:6499:usb-storage) usb-storage: usb_stor_bulk_transfer_sglist: xfer 32768 bytes, 1 entries
[14:55:47.057721](CPU:0-pid:6499:usb-storage) usb-storage: Status code 0; transferred 32768/32768
[14:55:47.057813](CPU:0-pid:6499:usb-storage) usb-storage: -- transfer complete
[14:55:47.057874](CPU:0-pid:6499:usb-storage) usb-storage: Bulk data transfer result 0x0
[14:55:47.057935](CPU:0-pid:6499:usb-storage) usb-storage: Attempting to get CSW...
[14:55:47.057996](CPU:0-pid:6499:usb-storage) usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
[14:55:47.058209](CPU:0-pid:6499:usb-storage) usb-storage: Status code 0; transferred 13/13
[14:55:47.058270](CPU:0-pid:6499:usb-storage) usb-storage: -- transfer complete
[14:55:47.058331](CPU:0-pid:6499:usb-storage) usb-storage: Bulk status result = 0
[14:55:47.058392](CPU:0-pid:6499:usb-storage) usb-storage: Bulk Status S 0x53425355 T 0xf9b R 0 Stat 0x0
[14:55:47.058484](CPU:0-pid:6499:usb-storage) usb-storage: scsi cmd done, result=0x0
[14:55:47.058545](CPU:0-pid:6499:usb-storage) usb-storage: *** thread sleeping.
for each write of 32768 bytes. I wonder if Android stores all the dmesg somewhere or not.

SD Card access

I've made this mistake before, and it drives me nuts. I changed phones and put my old phones sd card in my new phone (Nokia 8.3). I was just going to see if it could read it. It couldn't and asked me if I wanted to format. I selected no, and removed the card. I put the card in my linux computer and I can't mount it. I did get a replacement for my old phone through warranty (teracube) and tried putting it in that, and it wouldn't read it either. I've had this problem before. I think even having the sdcard in a phone does something to it even if you don't format it. I think I formatted the card initially as ext2 but I could be mistaken.
Any help would be appreciated. I really want to recover the data.
mount:
Code:
[3630 21-01-23 7:06][email protected]/home/larry%sudo mount /dev/sda2 /mnt/tmp
NTFS signature is missing.
Failed to mount '/dev/sda2': Invalid argument
The device '/dev/sda2' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
[3630 21-01-23 7:06][email protected]/home/larry%sudo mount -tvfat /dev/sda2 /mnt/tmp
mount: /mnt/tmp: wrong fs type, bad option, bad superblock on /dev/sda2, missing codepage or helper program, or other error.
fdisk:
Code:
[3630 21-01-23 7:06][email protected]/home/larry%sudo fdisk /dev/sda
Command (m for help): p
Disk /dev/sda: 119.1 GiB, 127865454592 bytes, 249737216 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
Disklabel type: gpt
Disk identifier: C8FBA780-1A1F-4B71-8D9D-D623A671C61D
Device Start End Sectors Size Type
/dev/sda1 2048 34815 32768 16M unknown
/dev/sda2 34816 249737182 249702367 119.1G unknown
An SD-card ( from Android's point of view it's a portable USB-device ) usually is FAT32 formatted, AFAIK, but I may err as always ...

Categories

Resources