LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   fdisk does not detect Android: Ubuntu / OR How To find Android in dmesg ? (https://www.linuxquestions.org/questions/linux-newbie-8/fdisk-does-not-detect-android-ubuntu-or-how-to-find-android-in-dmesg-4175538062/)

Cocolate 03-27-2015 08:37 PM

fdisk does not detect Android: Ubuntu / OR How To find Android in dmesg ?
 
Anybody can give me some insight how to get my Android device to show up in fdisk? Im having some trouble.

It isnt "just" showing up, and it isnt available with usbdebugging, mounting/unmounting, etc.

ferrari 03-27-2015 08:53 PM

Start by observing dmesg output when your Android device is attached
Code:

dmesg|tail
If the device does not behave as a storage device (many don't), then it won't be reported by 'fdisk' either. Instead, it may well behave as a MTP device, and there is a lot of information about how to connect and transfer using MTP if you care to search

Just to point you at a few:

http://www.webupd8.org/2013/01/upgra...upport-in.html
http://www.webupd8.org/2012/12/how-t...-go-mtpfs.html
http://techchannel.radioshack.com/co...untu-2910.html

Cocolate 03-27-2015 08:56 PM

I did find that MTP is a newer device so it only works for newer programs so that would affect the shell?

I also found that I can find the same results I am looking for in fdisk found in dmesg which is the drive (sdb, for example) is mounted.

Ill research your links after I look into dmesg though. Thanks for the reply.

ferrari 03-27-2015 09:20 PM

Quote:

I did find that MTP is a newer device so it only works for newer programs so that would affect the shell?
MTP is just a communication protocol used for transferring files between the Android device and the PC. Various utilities exist that utilise libmtp to provide file access, and file management capabilities eg allowing Nautilus to view and manage files graphically.

https://wiki.debian.org/mtp

Quote:

I also found that I can find the same results I am looking for in fdisk found in dmesg which is the drive (sdb, for example) is mounted.
I don't quite understand you. If the device is recognised as a storage device, and /dev/sdb* is created, then it should also appear in '/sbin/fdisk -l' output, and if it is mounted, then 'mount' will show this accordingly. You should start by sharing the dmesg output, so that we can see for ourselves what is/isn't reported, otherwise we can only guess.

Cocolate 03-27-2015 09:37 PM

This is my dmesg output I am looking for my where my Android device is mounted. That is what I meant by my example: sdb

The output for dmesg was too long for the post so I linked it to pastebin here

http://pastebin.com/D8g5uqUn

------------------------------------------

Android is mounted fine. It is not listed in fdisk. That is the only issue** Thread Unsolved

michaelk 03-27-2015 11:46 PM

As stated your Android device uses MTP so it is not mounted like a regular mass storage device. It shows up as a mounted device in the nautilus file browser due to Gnome's virtual filesystem gvfs and libmtp. You can not get it to show up under fdisk.


http://en.wikipedia.org/wiki/GVFS

Cocolate 03-28-2015 12:39 AM

Honestly, it doesnt seem like my question is really that complicated but I cannot seem to find an answer scouring the Internet from every source or forum Ive searched the last several hours.


My question is: where can I find

where is my android device mounted at on my OS?

It isnt showing up in Gparted, fdisk, and Im not exactly sure where to look in dmesg

Are you talking about the GUI nautilus? Ive run

Code:

/run/user/candi/gvfs/
With output error

Code:

bash: /run/user/candi/gvfs/: No such file or directory
I have no problem mounting my Android device.

Im looking for where it is mounted such as in dev/sd* ???

Cocolate 03-28-2015 01:13 AM

I see run, user, UID, gvfs is the GUI

still does not show me where the device is mounted

ferrari 03-28-2015 03:17 AM

Well, gvfs is a file system abstraction for MTP, and AFAIU the mount it creates is under /var/run/user/<UID>/gvfs/, but this may depend on the distro version and associated gvfs libmtp versions as mentioned here

http://askubuntu.com/questions/34231...the-filesystem

Anyway, if you're trying to access the Android device via scripts or CLI then maybe you should consider installing a fuse-filesystem such as mtpfs, or go-mtpfs, then you can mount the file system where you like.

This might take some further research on your part, but just to give you an idea on the general approach

https://wiki.archlinux.org/index.php/MTP
http://manpages.ubuntu.com/manpages/.../jmtpfs.1.html
http://www.omgubuntu.co.uk/2011/12/h...or-file-access

Cocolate 03-28-2015 03:52 AM

I found the answer I was looking for it was the MTP setting the USB had to be changed to the SD Card transfer and it came up in fdisk.

ferrari 03-28-2015 04:29 AM

Quote:

I found the answer I was looking for it was the MTP setting the USB had to be changed to the SD Card transfer and it came up in fdisk.
Do you mean within the Android device itself? I know that some devices (cameras included) have settings to configure as storage devices.

michaelk 03-28-2015 04:44 AM

Ok, I forgot about the SD card...

Cocolate 03-28-2015 05:09 AM

http://www.linuxquestions.org/questi...ry-4175538086/

Honestly what I'm really still stuck on its this. It still didn't work I worked on it all day.


All times are GMT -5. The time now is 02:39 AM.