1

How is Android supposed to handle multiple partitions on an extern sd card?

As an experiment, I took a 64 GB SDXC card, looked at it in Gparted, it turns out it is exfat formatted, with some amount of MB unallocated at start. Using gparted and gnome-disks, I managed to split the partition into two exfat partitions, which should be around 32 GB each.

Inserted this into an Xperia Z2, stock ROM (the last Android 5.x update). The phone didn't put out any notification upon plug in of the sdcard, but notified the plug out of the card, and complained it should be unmounted first. I inspected a bit via adb logcat and it looks like mounting is ultimately fine, as /storage/sdcard1. But when I look at that via Settings/Storage, I can only see 29.12 GB for "SD Card". Plugging the card back at the PC, I can see only the first partition has Android files saved, not the second one. Same result if first partition is exfat, and second partition is fat32.

So, basically, is this the expected behavior of Android when presented with an SD card with two partitions - it just mounts the first one, and ignores the rest? Could I mount the second partition from say adb shell, and would I need a rooted device for that?

1

By default, Android only uses the first partition found on the card and mounts it as described in your question. Subsequent partitions will be ignored. That's what's utilized by tools like : as the system won't interfere on other partitions, they use those for their purposes – be it moving apps to free up space on internal storage (Link2SD), having a swap partition/file, or something else.

Now, if you want to use multiple partitions for your own purposes, you'll have to care for them yourself – which, next to the obvious creation, also includes mounting. To do so, you will most likely need root; I have not read about a user-accessible FUSE method for this (open to learn if it exists :)

-1

I agree with Izzy. You need to have rooted phone to perform tasks like 'mount'. And android by default, mount only the first partition.

Android environment pretty restrictive, they even disallows fuse-mount by normal-users! Rooted mobile pretty much required. I read somewhere upcoming Android version allows you to use SD Card for internal storage. I don't know whether they allow partition of sd card too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.