October 17, 2014

Mounting SD Card From Android Phone To Ubuntu Via USB Cable

For quite a few days, I wasn't able to figure out why my Ubuntu 10.04 (I know I am living in the Stone Age :( ) wasn't able to mount my SD Card on connecting my Android phone with a USB cable. Actually, it did show the storage device under Computer, but it wasn't accessible.



I tried a few mount commands, and tried to find out if fdisk and df list my storage device.

1.  varsha@varsha-laptop:~$ sudo fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x85efe600

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         995     7990272   27  Unknown
/dev/sda2   *         995        1008      102400    7  HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3            1008        8841    62914904    7  HPFS/NTFS
/dev/sda4            8841       38914   241560577    f  W95 Ext'd (LBA)
/dev/sda5            8841       28470   157673472    7  HPFS/NTFS
/dev/sda6           28470       33450    39999488   83  Linux
/dev/sda7           33450       38430    39999488   83  Linux
/dev/sda8           38430       38914     3885056   82  Linux swap / Solaris

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0057434e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1      121601   976760000    c  W95 FAT32 (LBA)

2. varsha@varsha-laptop:~$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda6             39371384   6950168  30421244  19% /
none                   1462988       344   1462644   1% /dev
none                   1467232       764   1466468   1% /dev/shm
none                   1467232       236   1466996   1% /var/run
none                   1467232         0   1467232   0% /var/lock
none                   1467232         0   1467232   0% /lib/init/rw
/dev/sda7             39371384  20018336  17353076  54% /home
/dev/sdb1            976521568 528405952 448115616  55% /media/Transcend
/dev/sda5            157673468  65527264  92146204  42% /media/84A2A2ADA2A2A362
/dev/sda2               102396     25700     76696  26% /media/System Reserved
/dev/sdb1            976521568 528405952 448115616  55% /media/sdcard

As you can see above, it is quite difficult to tell which my SD card is. I went through a lot of Ubuntu blogs and forums; yet no outcome.

Finally, thanks to myubuntu.com, I came across the package mtp-tools. I installed it using the command - 

sudo apt-get install mtp-tools

My phone was already connected. So, I unplugged the cable from the USB port, and connected it again. Then from Computer, I clicked on my phone name. Then, finally to my pleasant surprise, the browser led me into the directory with a view to all the files and folders on the SD Card. I tried copying files to and fro, and it worked like charm! Make sure it is connected as a USB storage, and copying files to/from the computer is turned on.