[GUIDE] MTP and PTP (Media Transfer Protocol) vs UMC (Mass Storage Class)

Search This thread

scandiun

Senior Member
Jul 12, 2010
1,903
983
If you want UMS on devices that don't have it, you can use DriveDroid from market (there's both free and paid). With it, create a blank file that will be used as "partition". Then you can connect your phone to your computer and put there the songs you want. Then do the same in the car. For example, in my Nexus 7 I've created a 2 GB file which serve for that purpose (takes a while when is big).
 

Attachments

  • Screenshot_2013-03-16-11-59-40.jpg
    Screenshot_2013-03-16-11-59-40.jpg
    19.4 KB · Views: 339
  • Screenshot_2013-03-16-12-00-23.jpg
    Screenshot_2013-03-16-12-00-23.jpg
    13 KB · Views: 324
  • Screenshot_2013-03-16-12-05-23.jpg
    Screenshot_2013-03-16-12-05-23.jpg
    16 KB · Views: 320
Last edited:
  • Like
Reactions: TKPL
MTP, FUSE Filesystems, and other mounts

Hello,

I use the app "Cryptonite" to mount a EncFS volume (stored on my local SD card and synchronized with BoxSync) at /sdcard/csh.cryptonite/mnt.

This folder is visible to both Android and Windows(over MTP); however, the contents of "mnt" is visible in Android only (Windows shows a blank folder).

Is there any way to cause the MTP driver to follow symlinks (the FUSE Mountpoint)? I'd love to be able to read/write this mnt folder over MTP.

I saw another thread about editing vol.fstab (http://xdaforums.com/showthread.php?t=1625238), and it seemed to suggest that anything in vol.fstab will be presented over MTP, but I'm not sure exactly how that works. If that is the case,however, I do not want to use that option as this is a password protected, user mounted file system. I do not want to place this info in a clear-text file to be executed at boot.

Any ideas?

Thanks!
 
Last edited:

scandiun

Senior Member
Jul 12, 2010
1,903
983
Hello,

I use the app "Cryptonite" to mount a EncFS volume (stored on my local SD card and synchronized with BoxSync) at /sdcard/csh.cryptonite/mnt.

This folder is visible to both Android and Windows(over MTP); however, the contents of "mnt" is visible in Android only (Windows shows a blank folder).
This may be because is not mounted properly or because you connected the phone to the computer before mounting the volume. MTP does not refresh automatically when you make changes on the phone, so disconnect the phone from the computer and reconnect again with the volume mounted.

For me is working to read from the phone, however fails when copying to the phone. Try copying something to /sdcard/csh.cryptonite/mnt:
Cannot copy file.mkv
The device has either stopped responding or has been disconnected.

Is possible that the On The Fly encryption does not work well with MTP, you should ask the developer
 
  • Like
Reactions: grafikartizt

Top Liked Posts

  • There are no posts matching your filters.
  • 16
    Here I will post the advantages and disadvantages of the two.

    Advantages of UMC
    • UMC works at block level. It means that you access the partition from the operating system like if were local, and you have complete control of it.
    • For the previous reason, UMC keeps timestamps for files and folders. This is specially important for pictures, photos or videos that don't have EXIF, where you rely on file creation or modification time to arrange them and to know when were taken. MTP sets for all transferred files current system time, thus overwritting the real creation or modification time and ruining your gallery.
    • UMC allows the use of recovery software (Recuva) or partition software (Easeus Partition Master) and even format with a different filesystem. Without UMC you have to use android side software that usually is less powerful, needs a rooted phone, etc.
    • As you have total access to the partition, you can access all files there, even hidden, system, etc. With MTP you only have access to the files that the controlling operating system (android) wants. For example, with MTP, files starting with dot (.file) are not accessible. Some file formats are not allowed.
    • UMC is compatible with any operating system that allows connecting a FAT32 / exFAT pendrive, while MTP requires specific support. Linux and OS X may have built-in support or not.
    • With UMC you directly access the files, so modification is instant, and viewing. On the other side, with MTP you download it, modify it and re-upload the edited version, but you never do it directly. Even to play files you need to completely download it first. Imagine downloading a 5 GB MKV.
    • UMC is always the same, while for MTP there are several implementations: MTP, MTPZ (Microsoft Zune), Sony SonicStage, Apple DMAP.
    • UMC is faster than MTP because requires less time to initialize transfer, but isn't that big difference for an average user. The higher the number of files to be transferred and the lower the size of each file, the higher the ratio MTP/UMC.

    Advantages of MTP or PTP
    • In MTP mode, the android device controls the input/output to the filesystem, so there is no risk of data loss because of cold disconnecting the device from USB. You work on a layer over the filesystem. With UMC you must be careful.
    • MTP allows you to use the sdcard from both the android phone and the computer at the same time, even to any desired number of them. On the other side, with UMC you only can do it from a device at a time, meaning that you have to unmount the sdcard from the android to view it on the computer, stopping apps, etc. Of course there are software that can force viewing UMC from both sides, but is a highway to corruption.
    • MTP does not show the native filesystem to the computer (it uses a hierarchery simulated by the MTP driver), so it will always be compatible. For example, on devices with the same partition for data and sdcard (like Galaxy Nexus, Galaxy S3) you are writing from the computer to an ext4 partition and you don't need windows to support it. The same if the device partition were in any imaginable filesystem, the MTP will show you it in a standard hierarchy. On the other side, with UMC your local operating system (windows, linux, mac) must support natively the filesystem of the partition or download some software that allows you to do it.
    • With MTP you use all capabilities and disadvantages of the device filesystem. If the filesystem is in ext4 you can copy files over 4GB to the device, that you couldn't in UMC mode because usually it will come formatted in FAT32, that is the most compatible fs for all operating systems.
    • MTP enables Windows Media DRM, UMC doesn't.
    • MTP allows the use of password for accessing the files (on compatible devices). On the other side, with UMC, of course you could use powerful tools like TrueCrypt, but you need the corresponding software on android that reads it.


    How to preserve timestamps

    - Use File Timestamp app. Root is required, and works recursively too.
    - Use Mass Storage Mode when possible.
    - zip or tar the files when sending them to the phone or receiving from.
    - If the device has external sd, you can use it as a man in the middle.
    - samba (smb protocol) allows preservation of timestamps, however applications for android don't support it.
    - FTP allows preservation of timestamps, however applications for android don't support it.
    - NFS allows preservation of timestamps, however couldn't get any application for android working properly (Servers Ultimate Pro).
    - Rsync allows preservation of timestamps, however couldn't get any application for android working properly (Servers Ultimate Pro).
    - adb push and pull does not preserve timestamps. Furthermore doesn't work recursively with folders.
    - MTP does not preserve timestamps.
    - Cloud services like Google Drive, Dropbox, etc. usually never preserve timestamps.


    Questions and answers

    Is possible to implement MTP on "put here your device"?​
    Possibly yes, if has USB. MTP works on software side, so updating your rom or installing a new one will do the job


    Is possible to implement UMC on "put here your device"?​
    That depends on hardware mainly. If the internal sdcard and the data folders belong to the same partition, you can't. The reason is that you can't enable access to a part of a partition at block level, the whole or nothing. This is the case for Galaxy Nexus and Galaxy S3, in order to take advantage of all space, and discard the case where you have filled a partition and the other plenty of space.

    Dan Morill said:
    It isn't physically possible to support UMS on devices that don't have a dedicated partition for storage (like a removable SD card, or a separate partition like Nexus S.) This is because UMS is a block-level protocol that gives the host PC direct access to the physical blocks on the storage, so that Android cannot have it mounted at the same time.

    With the unified storage model we introduced in Honeycomb, we share your full 32GB (or 16GB or whatever) between app data and media data. That is, no more staring sadly at your 5GB free on Nexus S when your internal app data partition has filled up -- it's all one big happy volume.

    However the cost is that Android can no longer ever yield up the storage for the host PC to molest directly over USB. Instead we use MTP. On Windows (which the majority of users use), it has built-in MTP support in Explorer that makes it look exactly like a disk. On Linux and Mac it's sadly not as easy, but I have confidence that we'll see some work to make this better.


    Sources:
    Easy UMS, USB Mass Storage and Media Transfer Protocol – XDA Developer TV
    DifferenceBetween: Difference Between MTP and MSC
    Directions on Microsoft: What is MTP?
    CrackBerry: On startup - Media Transfer Protocol
    Ice Cream Sandwich supports USB mass storage after all, Galaxy Nexus does not

    Issues and questions:
    [Q] Hidden folders through Android MTP
    Nexus 4 not showing files via MTP
    [Q][MTP] Certain files/directories hidden to windows file manager?
    Connecting to PC files are different!
    MTP and hidden files
    [Q] Hidden files and MTP/Windows
    [Q] Do the S3 still using 2gb partition for data and 12 as virtual sd?
    Just got meself a Nexus 7... But!
    Upload to dropbox: file timestamps should be preserved
    Android File Transfer - For Mac users only
    1
    Sorry, I don't have it rooted. I have been asking around if rooting / unlocking the TF300T would give me the option for UMC, but pretty much everyone told me chances are zip. :(

    Rooting can't change that because it's hardware implemented. You can't do anything about it. Probably the Eee pad transformer doesn't have a dedicated partition for sdcard.

    A quick way to check it is see if the free space for the sdcard and the userdata is exactly the same, and is always like that no matter on which of the two partitions you write.

    About the issue anyway, modern phones like Galaxy S3, Galaxy Nexus, Galaxy Note and probably newer like Nexus 2 and Note 2 won't have it anymore, it's just the way to go because takes all the advantage of the free space on the device. It will be the standard from now on.

    EDITED:

    If you want UMS on devices that don't have it, you can use DriveDroid from market (there's both free and paid). With it, create a blank file that will be used as "partition". Then you can connect your phone to your computer and put there the songs you want. Then do the same in the car. For example, in my Nexus 7 I've created a 2 GB file which serve for that purpose (takes a while when is big).

    http://xdaforums.com/showpost.php?p=39203658&postcount=21
    1
    I don't know if this is the best place to ask my question, but at least you all seem to understand this all pretty well.

    I plug my phone into my PC to just use ADB. Under Gingerbread, I would select "Charge only" as my USB connection type.

    With ICS, there is no longer the "Charge Only" option for an USB connection to a PC. I have to pick UMC, MTP, or PTP.

    Given I really don't want to use any of those, just ADB, which of the three is the most benign one?

    Either the MTP or PTP are the safer ones. There is no possibility to select "none" like was possible in previous version as you say. The UMC has the disadvantage that if you activate the Mass Storage usually the /sdcard won't be available from ADB commands.

    Anyway, the ADB is separate from those options. The ADB option is usually found under Developer options. You can use adb with any of the options you say.
    1
    If you want UMS on devices that don't have it, you can use DriveDroid from market (there's both free and paid). With it, create a blank file that will be used as "partition". Then you can connect your phone to your computer and put there the songs you want. Then do the same in the car. For example, in my Nexus 7 I've created a 2 GB file which serve for that purpose (takes a while when is big).
    1
    Hello,

    I use the app "Cryptonite" to mount a EncFS volume (stored on my local SD card and synchronized with BoxSync) at /sdcard/csh.cryptonite/mnt.

    This folder is visible to both Android and Windows(over MTP); however, the contents of "mnt" is visible in Android only (Windows shows a blank folder).
    This may be because is not mounted properly or because you connected the phone to the computer before mounting the volume. MTP does not refresh automatically when you make changes on the phone, so disconnect the phone from the computer and reconnect again with the volume mounted.

    For me is working to read from the phone, however fails when copying to the phone. Try copying something to /sdcard/csh.cryptonite/mnt:
    Cannot copy file.mkv
    The device has either stopped responding or has been disconnected.

    Is possible that the On The Fly encryption does not work well with MTP, you should ask the developer