[SOLVED] fdisk does not detect Android: Ubuntu / OR How To find Android in dmesg ?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Start by observing dmesg output when your Android device is attached
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
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.
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.
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.
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
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