How do I cd into mounted Samsung phone through bash

You actually can go to that folder with cd. Though mount or df commands can't list it, but it's available under a gvfsd-fuse mounted folder, in my case it's /run/user/1000/gvfs , find out that with

mount | grep  'gvfsd-fuse'

The mounted MTP device's filesystems are available under that folder with some crappy name.

Use cd and Tab key for easier navigation. enter image description here

Some systems don't have gvfsd-fuse running by default. Make sure that you have it installed (on Debian and derivatives, it's in the gvfs-fuse package).


Short answer: You can’t cd to this directory.

Media Transfer Protocol (MTP)

Media Transfer Protocol (MTP) uses a special API that to provide limited access to files on a device. As I understand it, it was originally designed by Microsoft for use with proprietary software compatible with its digital restriction system.

The protocol became an official USB device class in 2008 and it provides a standard means of transferring media and metadata between a computer and an external device. It is not tied to DRM and the ever-innovative FOSS community developed the libmtp library to support MTP devices.

The mtp://[usb:001,007] URL is a GNOME Virtual file system which uses libmtp as its backend. Since MTP abstracts away the filesystem, it’s not mounted in the same way as a regular storage device so it will not be listed by the mount or df commands.

The MTP Wikipedia article has a good description of the protocol and lists the advantages to using MTP for accessing files on an external device.

The comprehensive MTP article on the Arch Linux Wiki has tonnes of useful information on using MTP with GNU/Linux (most of the information is not distribution-specific).

Mass Storage Class (MSC)

If you want to treat the files on the Samsung device as a regular filesystem that can be mounted like any other storage device (and use cd), you would need to configure the device to present itself as a Mass Storage Class (MSC) (aka UMS) device. Some devices can be configured to use either method. I have a Sony Android phone that allows either method but I’ve always connected to its SD card using USB Mass Storage (even though it means the Android OS has to unmount the SD card, to allow the GNU/Linux OS to mount it).

Tags:

Bash

Usb

Samsung