Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Daniel James Newsgroups: comp.mobile.android Subject: Android 6 and SD cards Date: Thu, 22 Dec 2016 20:58:20 -0000 Organization: A noiseless patient Spider Lines: 70 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="b8982655b71824c2ff5e355024f477a6"; logging-data="22982"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/u/VpyEJYHpWiiZlPxGlbR" X-Newsreader: Virtual Access Open Source http://www.virtual-access.org/ Cancel-Lock: sha1:t8CmuDUfdk3UmFz6oGY46ZioSzk= Xref: csiph.com comp.mobile.android:36871 Having got my hands on a phone that runs Android 6 "Marshmallow" (a Moto G4 Play) I thought I'd play around and try to answer a question I've asked several times that nobody has been able to answer. Background Android 6 can view an SD in either of two ways. It can be "portable storage" or "internal storage". If a card is used as portable storage Android uses it in pretty-much the same way as it has in earlier versions: it's used to store data in an ordinary filesystem in such a way that the card can be removed from the phone and used in another device (such as a PC). If a card is used as internal storage it becomes an extension of the phone's internal flash storage, and data that are stored on it can only be accessed in the Android device that formatted the card. Formatting the card this way enables it to be used to store apps (which in Android 6 you can't store in portable storage) and configuration data. etc. The thing that I hadn't been able to find out is: Can you partition the card so that it has one partition that can be used as internal storage and another partition that is portable and can be read on another device. Findings My initial findings are this isn't easy to do, if indeed you can do it at all. An SD card formatted as "portable storage" has a normal BIOS-style partition table, with a single Windows-style FAT32 or exFAT partition for the data. What I've discovered about an SD card that is formatted as "internal storage" is that it has a GPT partition table and two partitions as follows: One named android_meta with type: 19A710A2-B3CA-11E4-B026-10604B889DCF9BECF4E3-44ED-48AC-A831-50D3C0FD0539 and one named android_expand with type: 193D1EA4-B3CA-11E4-B075-10604B889DCF 359AB3A6-F7B7-B687-0FC8-DB399A9BC232 I didn't try to find out what sort of filesystem these partitions hold, and I believe that in any case at least one of them is encrypted. Conclusion My hope was that it would be possible to create an SD card with two partitions, one of which was an unencrypted FAT32 or exFAT partition for use as portable storage, and one of which was whatever was needed for internal storage, but what I've discovered is that Android doesn't even use the same partitioning system for these two types of card, so it seems pretty unlikely that we can have the best of both worlds. There are good security reasons for preventing the reading and writing of data from/to the internal storage of the Android device when the card is inserted into another device, but it's a pity that Google haven't made it possible to use just part of the SD card for internal storage and the rest for portable storage. It's particularly lamentable on the G4 Play (I don't know about other Marshmallow devices) because the rather simple camera app doesn't provide any means to select the destination for photographs, so they all go into internal memory rather than onto the SD card if it is set up as portable storage. JUST what you probably don't want! I hope this is of interest to someone. -- Cheers, Daniel.