f



Android 6 and SD cards

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.
 

0
Daniel
12/22/2016 8:58:20 PM
comp.mobile.android 1779 articles. 0 followers. Post Follow

12 Replies
150 Views

Similar Articles

[PageSpeed] 15

On 22/12/2016 20:58, Daniel James wrote:
> 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.
>

Interesting!

I imagine that when you tell it to use the card as an extension of 
internal storage, it grabs the whole card and re-formats it with its 
proprietary format - so even if you did manage to create two partitions, 
they would be over-written.

There are pros and cons for both ways of using the card. A lot depends 
on how much internal storage the phone has to start with. My Moto G2 has 
only 8GB - which limits the number of apps you can install unless you 
format the SD card as internal. The downside is that if the card goes 
bad - and that's happened to two of mine - you stand to lose more than a 
bit of easily backed-up data, 'cos a lot of apps will disappear too and 
will need to be re-installed on a new card.

If my phone had 16GB of internal storage I would probably use the card 
as 'portable'. Even if the camera insisted on putting photos in internal 
storage, it shouldn't be too difficult to move them onto the card.
-- 
Cheers,
Roger
____________
Please reply to Newsgroup. Whilst email address is valid, it is seldom 
checked.
0
Roger
12/22/2016 9:34:56 PM
In article <VA.00000c19.29efe80e@me.invalid>, Daniel James wrote:
> 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

Ah! I've just discovered the slide-out menu that gives access to the 
(few) camera options that are supported, and find that the storage area 
location *is* configurable. That's good.

-- 
Cheers, 
 Daniel.
 


0
Daniel
12/22/2016 9:39:16 PM
On Thu, 22 Dec 2016 20:58:20 -0000, Daniel James wrote:

> ... 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 ...

Even if the camera app were not reconfigurable, as you discovered it is
shortly after that post, to use the external SD card as photo destination,
you could always move or copy your photos from wherever they are to the
external SD card with ES File Explorer (or a similar utility). More grunt
work, of course, but ... . HTH.

Cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.
0
tlvp
12/23/2016 1:14:41 AM
On 12/22/2016 12:58 PM, Daniel James wrote:
> 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!

There may be some camera apps that allow you to set the destination, but 
the MotoG #2 doesn't.  So I just created a couple of appropriate 
subdirectories (/sdcard/PHOTOS and /sdcard/SAVE [for DL, insurance, 
passport, etc.]).  It's not difficult to move photos from one place to 
another with the Gallery app that came with the phone.

> I hope this is of interest to someone.

Me, certainly :-)


-- 
Cheers, Bev
    "History started badly and hav been geting steadily worse."
                                          -- Nigel Molesworth
0
The
12/23/2016 5:43:28 AM
On 12/22/2016 01:39 PM, Daniel James wrote:
> In article <VA.00000c19.29efe80e@me.invalid>, Daniel James wrote:
>> 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
>
> Ah! I've just discovered the slide-out menu that gives access to the
> (few) camera options that are supported, and find that the storage area
> location *is* configurable. That's good.

Really?  Mine (G#2) doesn't seem to have that unless I'm missing 
something.  What icon chooses storage?

-- 
Cheers, Bev
    "History started badly and hav been geting steadily worse."
                                          -- Nigel Molesworth
0
The
12/23/2016 5:45:30 AM
On Thu, 22 Dec 2016 21:45:30 -0800, The Real Bev wrote:

> Really?  Mine (G#2) doesn't seem to have that unless I'm missing 
> something.  What icon chooses storage?

No "icon" -- instead, open your Camera app, find whatever button(*) or
"..." or "|||" or hamburger icon it is that shows you the Options for the
Camera app, there select the Settings icon, and then scroll down to find
(if you're in luck) a Storage Location entry with possible values Internal
phone storage and SD Card.

(*) In the case of my Moto Droid X2 running Android v. 2.3.5 it's the LH
button amongst the four physical buttons *on* the case, the one with four
little cubes as its colophon (so not the Search or Back or Home button).

HTH. Cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.
0
tlvp
12/23/2016 5:09:17 PM
On Fri, 23 Dec 2016 12:09:17 -0500, tlvp wrote:

> ... it's the LH
> button amongst the four physical buttons *on* the case, the one with four
> little cubes as its colophon

Terminology: the "Menu Key". (No, I didn't make that up; nor can I be
expected to keep track of terms like that (Menu, Options, Settings, More).)

Seasons' Choicest Greetings to all! Cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.
0
tlvp
12/24/2016 4:51:34 PM
On 12/24/2016 08:51 AM, tlvp wrote:
> On Fri, 23 Dec 2016 12:09:17 -0500, tlvp wrote:
>
>> ... it's the LH
>> button amongst the four physical buttons *on* the case, the one with four
>> little cubes as its colophon

Sweet Jesus, yet ANOTHER word.  Apparently a colophon is more like a 
trademark than an icon.  Or not.

> Terminology: the "Menu Key". (No, I didn't make that up; nor can I be
> expected to keep track of terms like that (Menu, Options, Settings, More).)
>
> Seasons' Choicest Greetings to all! Cheers, -- tlvp

If I were going to wish greetings, I'd use 'Prime'.  'Choice' was 
downgraded a while back, as was 'Prime', so we do the best we can.

-- 
Cheers, Bev
                   SAVE GAS, FART IN A JAR
0
The
12/24/2016 6:06:22 PM
On Sat, 24 Dec 2016 10:06:22 -0800, The Real Bev wrote:

> On 12/24/2016 08:51 AM, tlvp wrote:
>> On Fri, 23 Dec 2016 12:09:17 -0500, tlvp wrote:
>>
>>> ... it's the LH
>>> button amongst the four physical buttons *on* the case, the one with four
>>> little cubes as its colophon
> 
> Sweet Jesus, yet ANOTHER word.  Apparently a colophon is more like a 
> trademark than an icon.  Or not.
> 
>> Terminology: the "Menu Key". (No, I didn't make that up; nor can I be
>> expected to keep track of terms like that (Menu, Options, Settings, More).)
>>
>> Seasons' Choicest Greetings to all! Cheers, -- tlvp
> 
> If I were going to wish greetings, I'd use 'Prime'.  'Choice' was 
> downgraded a while back, as was 'Prime', so we do the best we can.

Let's not lose focus, Bev: can you send photos to the external SD card now?

Cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.
0
tlvp
12/24/2016 6:21:54 PM
On 12/24/2016 10:21 AM, tlvp wrote:
> On Sat, 24 Dec 2016 10:06:22 -0800, The Real Bev wrote:
>
>> On 12/24/2016 08:51 AM, tlvp wrote:
>>> On Fri, 23 Dec 2016 12:09:17 -0500, tlvp wrote:
>>>
>>>> ... it's the LH
>>>> button amongst the four physical buttons *on* the case, the one with four
>>>> little cubes as its colophon
>>
>> Sweet Jesus, yet ANOTHER word.  Apparently a colophon is more like a
>> trademark than an icon.  Or not.
>>
>>> Terminology: the "Menu Key". (No, I didn't make that up; nor can I be
>>> expected to keep track of terms like that (Menu, Options, Settings, More).)
>>>
>>> Seasons' Choicest Greetings to all! Cheers, -- tlvp
>>
>> If I were going to wish greetings, I'd use 'Prime'.  'Choice' was
>> downgraded a while back, as was 'Prime', so we do the best we can.
>
> Let's not lose focus, Bev: can you send photos to the external SD card now?

Direct from the camera?  No.  Easy to do it with the 'Gallery' app, 
though.  I have several 'albums' -- 'Camera' on the internal memory (no 
choice), and 'Photos' , 'Save', 'Garden', and 'Screenshots' on the 
external card.

-- 
Cheers, Bev
   "Incontinence hotline, can you hold?"
0
The
12/24/2016 7:54:49 PM
On Sat, 24 Dec 2016 11:54:49 -0800, The Real Bev wrote:

>>
>> ... Bev: can you send photos to the external SD card now?
> 
> Direct from the camera?  No.  Easy to do it with the 'Gallery' app, 
> though.  I have several 'albums' -- 'Camera' on the internal memory (no 
> choice), and 'Photos' , 'Save', 'Garden', and 'Screenshots' on the 
> external card.

Sorry to hear it. Sending direct from the camera to your choice -- internal
storage or external SD card -- must be something Motorola got right in the
antique Android its Droid X2 used (v. 2.3.5), that later products using
newer Android versions got wrong -- your phone being a case in point,

All that's left is to find acceptable workarounds, I guess. Cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.
0
tlvp
12/25/2016 5:01:14 AM
On 12/24/2016 09:01 PM, tlvp wrote:
> On Sat, 24 Dec 2016 11:54:49 -0800, The Real Bev wrote:
> >>>
>>> ... Bev: can you send photos to the external SD card now?
>>
>> Direct from the camera?  No.  Easy to do it with the 'Gallery' app,
>> though.  I have several 'albums' -- 'Camera' on the internal memory (no
>> choice), and 'Photos' , 'Save', 'Garden', and 'Screenshots' on the
>> external card.
>
> Sorry to hear it. Sending direct from the camera to your choice -- internal
> storage or external SD card -- must be something Motorola got right in the
> antique Android its Droid X2 used (v. 2.3.5), that later products using
> newer Android versions got wrong -- your phone being a case in point,

There are a lot of camera apps.  I tried a couple, but they didn't seem 
to offer anything better/easier than the one that came with the phone 
and I got tired of trying.

> All that's left is to find acceptable workarounds, I guess. Cheers, -- tlvp

We're human.  It's what we do :-)


-- 
Cheers, Bev
  His men would follow him anywhere, but only out of morbid curiosity.
0
The
12/25/2016 5:44:26 AM
Reply: