Sample Header Ad - 728x90

How (& why) does just inserting a USB flash-disk into my Android (15) phone cause 15 directories to be written?

4 votes
0 answers
156 views
Just in case what I'm seeing is OS specific: I am running the latest OxygenOS on a OnePlus 10 Pro 5G (GLO NE2213_15.0.0.401(EX01)).The phone is rooted via Magisk but I doubt that matters (except for how i can use the phone to format the disk; but the behavior is identical when I format with a PC) I format a USB flash-disk with exFAT, via mkfs.exFAT /dev/sxx1, either from a root termux shell on the phone, or from a root terminal on my (arch) linux PC. Either way, the format succeeds, and I can immediately mount the flash-disk via mount /dev/sxx1 /mnt/. The disk is empty, and I can write and read files on it. But if I then unmount it, unplug it (from the PC or the phone), and then insert it into the phone (which might mean "insert it back into the phone), then the phone automagically both mounts the flash-disk AND writes the following 13 directories/folders onto it:
Alarms   Audiobooks  Documents  LOST.DIR  Music          Pictures  Recordings   
Android  DCIM        Download   Movies    Notifications  Podcasts  Ringtones
I would be grateful to read the explanation of: 1. Just what process/system/thingie in Android is noticing the insertion and reacting in this way? I put "Android udev?" into title of the question as a way of asking how whatever is doing that mount+write compares with udev.... 2. Is there some profound (or even just necessary) reason for or benefit from providing all this structure on EVERY disk one might insert? The fact is that I inserted the flash disk so that I could do a TWRP backup to it. And although there are more annoying things about my phone than just needing to erase some folders whenever i want to use a USB flashdisk, perhaps something "bad" will happen if I do? And in any case, I might well want to retrain it to do something else, once I know what's going on. thanks PS: I note that SE points me to [this and this ; but neither explains what system service is doing this udev-like functionality, nor why it is now MORE invasive than it used to be (in the sense that it now writes 13 directories, and not 2. Perhaps it's a OnePlus/OPPO "improvement" ...)
Asked by Scott Petrack (181 rep)
Feb 22, 2025, 12:09 PM
Last activity: Feb 22, 2025, 04:20 PM