zlacker

[parent] [thread] 9 comments
1. causal+(OP)[view] [source] 2025-03-26 23:25:51
God I miss the days when I could plug a phone in and get a mass storage device. Imagine, I could copy a video off my phone and copy music onto it at the same time.
replies(2): >>KiwiJo+48 >>Norweg+T8
2. KiwiJo+48[view] [source] 2025-03-27 00:39:28
>>causal+(OP)
To be fair to Android, this is a limitation of the MTP protocol and not android. To mount your storage as a mass storage device then the host device (your computer in this case) does raw sector read/writes to the device, the host device provides the filesystem services. For this to work it has to be completely unmounted from the phone as obviously having the block mounted in two filesystems at once would corrupt everything very badly.

Android used to split storage into various partitions, which is why this used to work - It was able to unmount the partition and let your PC manage it. This meant any apps using that partition needed to be stopped, etc etc. It was a pain, and I can totally understand why they moved away from this approach.

Personally I prefer the new way, yes using MTP has some limitations as you've noticed but it does mean the storage can remain mounted on android while your PC accesses it.

replies(2): >>Chocol+GH >>johnea+x32
3. Norweg+T8[view] [source] 2025-03-27 00:47:56
>>causal+(OP)
What do you mean you miss it? What is stopping you from doing exactly that now? Plug it in, drag down the drop-down and make you phone identify as storage. Then you can copy video off it while moving music onto it, if that is what you want.
replies(2): >>numpad+5K >>causal+L54
◧◩
4. Chocol+GH[view] [source] [discussion] 2025-03-27 08:17:36
>>KiwiJo+48
I can't think of any modern operating system that lets a foreign system mount it's already mounted filesystem over USB without going through some kind of server such as MTP, NFS etc.
replies(1): >>johnea+952
◧◩
5. numpad+5K[view] [source] [discussion] 2025-03-27 08:49:31
>>Norweg+T8
That uses rather unstable protocol called MTP that is rather slow and unstable. Pre-iPhone devices often supported USB Mass Storage. Protocol difference.
replies(1): >>Arrowm+yI1
◧◩◪
6. Arrowm+yI1[view] [source] [discussion] 2025-03-27 16:30:52
>>numpad+5K
Yes but they needed to unmount the storage media from the phones OS to be able to present it to the computers OS as a USB Storage device. That works great when the storage is only used for media files and those functions are disabled when you plug the device into a computer.

People often lament about the early days of smart phones where you could put in a microSD card to expand storage and even move apps to it. But nobody remembers the details of how janky it really was. AOSP and Googles own Nexus phones never supported apps on microSD, it was added by other manufacturers and was not perfect, often apps crashed when running from microSD or ran slowly.

I'm not defending MTP either, it's a mess too and hasn't gotten any real multiplatform improvements since back when it was first being used for MP3 players.

◧◩
7. johnea+x32[view] [source] [discussion] 2025-03-27 18:34:23
>>KiwiJo+48
This isn't really accurate.

In the case of plugging a "phone", as a device, into a USB host computer, the USB device (the phone) can present a filesystem endpoint to the host, and allow read/write access. The OS of the phone then passes these read/writes through to its mounted filesystem, with whatever mapping and access controls to the mounted filesystem it wishes to implement.

Thus the USB connection doesn't require that the raw filesystem of the phone be mounted by 2 hosts at the same time.

This already happens with every USB "stick" you plug into a host computer. The memory in the USB stick is accessed by firmware on a CPU inside the memory stick, which then presents that memory to the host as a USB storage class device. The firmware may not have a linux or iOS OS, but it does perform mapping to preserve and remap sectors to alleviate flash endurance issues, perform secure mounting, and other features.

There's no technical reason android can't do this.

p.s. MTP clients accessing an android device are a major PITA! Especially, ironically, for a linux OS USB host...

replies(1): >>Hercur+ePi
◧◩◪
8. johnea+952[view] [source] [discussion] 2025-03-27 18:42:08
>>Chocol+GH
Again, this isn't accurrate. Please see my other comment on why the filesystem is not mounted by multiple hosts.
◧◩
9. causal+L54[view] [source] [discussion] 2025-03-28 12:14:29
>>Norweg+T8
No, you can't. Try it. It will only let you read or write from one location at a time. If you're copying files out of one folder you can't even find out what files are in a different folder until you're done.
◧◩◪
10. Hercur+ePi[view] [source] [discussion] 2025-04-02 20:19:56
>>johnea+x32
I think the issue comes with trying to present a USB mass storage API to the host where you allow the host to write to any arbitrary byte offset of the mass storage device without the structure that is imposed by a file system.

If the host and guest both get presented with the same “array of bytes” mass storage interface, then they will compete and potentially mess up each other’s reads and writes, let’s say if they both treat that array of bytes as an ext4 file system and try to write a file system metadata to the same physical location at the same time.

Of course you have have a “virtual file system” exposed over USB, but isn’t that exactly what MTP is? The point is that USB mass storage is not a virtual file system.

[go to top]