What happens when you first add an sd card to an Android phone?

Discussion in 'Android OS' started by tbessie, Nov 8, 2014.

  1. tbessie

    tbessie PIM-Loving Maniac

    Messages:
    669
    Likes Received:
    151
    Trophy Points:
    118
    So I got the fast sd card I'd ordered in the mail today, and inserted it into my Z3 Compact phone.

    I checked the card, and there were a bunch of files added to it, all under an Android folder, all seeming to be for various apps.

    Does anyone know what's actually going on here? It seems that the fake sd folder "sdcard0" is there already, and the real one, "sdcard1" has a bunch of files added to it automatically somehow when a real sdcard is added. Does anyone know how this is done? What's the process causing this, etc? I can't find anything about this online.

    - Tim
     
  2. Hook

    Hook Have keyboard, will travel

    Messages:
    20,214
    Likes Received:
    13,445
    Trophy Points:
    288
    I think it's the same thing Palms used to do. It just detects and sets up the card for itself. It does that with external flash drives I set up on my Nexus 5.
     
    lelisa13p likes this.
  3. jigwashere

    jigwashere Mobile Deity

    Messages:
    18,149
    Likes Received:
    15,695
    Trophy Points:
    288
    Apple computers do this, too.

    Sent from my LG-LS980 using Tapatalk
     
    lelisa13p likes this.
  4. raspabalsa

    raspabalsa Brain stuck BogoMipping

    Messages:
    9,773
    Likes Received:
    10,357
    Trophy Points:
    288
    As fas as I know, it's the OS itself who adds folders to a new SD card, kind of placeholders for the apps to store their data. This is normal and can't be avoided. Eventually these folders will start to fill up as the apps copy stuff into them. Any app that has an option to store its data on external storage will use the sdcard1.

    Regarding the numbered sdcards, the sdcard0 is not a fake card, it's the internal flash drive, the one that's advertised in the phone's sales pitch. The sdcard1 is the physical SD card as you have noticed. But Sony makes thing a bit more complicated, because on my Z1 I see several other ways to access the sdcards. Under storage you'll see a folder called "emulated", and inside you'll see a folder called "0" which is also the internal drive, and another called "legacy" which is also the same drive. I guess these are kept for backwards compatibility. Further down you'll see a "removable" folder and inside you'll again find the sdcard1, plus the usbdisk (if your device supports USB host). I know all these are simply mounting points for the drives, but it takes some time to get used to this structure.
     
    lelisa13p likes this.
  5. Hook

    Hook Have keyboard, will travel

    Messages:
    20,214
    Likes Received:
    13,445
    Trophy Points:
    288
    That's not your Sony, those multiple paths are Android. Forget when they were introduced, but definitely in 4.4.x, those alternate paths are what is referred to in Linux as symlinks (like shortcuts). If you investigate them it will look like you have duplicate files, but you don't. They all point to the same folder tree.
     
    raspabalsa and lelisa13p like this.
  6. tbessie

    tbessie PIM-Loving Maniac

    Messages:
    669
    Likes Received:
    151
    Trophy Points:
    118
    Thanks for all the ideas, folks. My main concern was what were the various apps that are now using sdcard1 doing?

    That is, they used to use sdcard0, but now that sdcard1 exists... did they copy their data that WAS on sdcard0 to sdcard1? Did they leave the data that was on sdcard0 and start new sets of data on sdcard1?

    What happens if I remove sdcard1? Do I lose data from apps that I didn't even configure to USE sdcard1 in the first place? etc.

    Anyone know if there's any documentation on this?

    - Tim
     
  7. SGosnell

    SGosnell (retired) Palm Pilot

    Messages:
    5,254
    Likes Received:
    773
    Trophy Points:
    288
    Google has your answers. Google owns Android, and the documentation is available, although it can be obscure. You just have to know how to use the Google search engine.

    But no, you don't lose anything unless you specifically set up apps to run off the external SD, and that's becoming more difficult, if it's even possible. It depends on which version of Android you're running. There should be nothing in the folders on the external card until you make backups to it.
     
    Hook likes this.
  8. tbessie

    tbessie PIM-Loving Maniac

    Messages:
    669
    Likes Received:
    151
    Trophy Points:
    118
    Well jah, I could search around in the Android developer API docs and such; I already did a lot of general Google searches to find an answer to this and couldn't find any mention of it (just tangentially related things). I was hoping not to have to peruse the API docs. :-/

    Thanks tho'!

    - Tim
     
  9. raspabalsa

    raspabalsa Brain stuck BogoMipping

    Messages:
    9,773
    Likes Received:
    10,357
    Trophy Points:
    288
    On apps that have the option to move their data to the external SD card, the app will move the data over from the internal (sdcard0) to the external (sdcard1). This means the original data will no longer be on sdcard0. This is a good way to free the precious, limited internal drive. For example, a map app I use (Map Factor Navigator) will store its data on Android/data/com.mapfactor.navigator/files. If you download a lot of maps, this will add up to several GB of storage. My Z1 has only 11GB of available internal storage, so this would take a sizable portion. Moving the data to the SD card frees up the internal storage. I have a dictionary app, a few astronomy apps, and a couple of games that allow moving to the external card. Added up, they'd take 4GB, or 36% of my Z1's internal drive, but now they take just 6% of my 64GB SD card.
    No. An app will not install to the SD card unless you manually select the option under its own menu. By default they'll install to the internal drive. But, for the apps that you configured to use external card, you will lose the data if you remove or change the SD card. If you launch them, they'll report missing data, but at worst they'll prompt you to redownload the data and reinstall either to internal or to external.
     
    lelisa13p, RickAgresta and tbessie like this.
  10. John Farrel

    John Farrel Mobile Evangelist

    Messages:
    92
    Likes Received:
    10
    Trophy Points:
    13
    Same thing happens with every Android device when you puts the sdcard the Android system automatically creates some files and folders.
     

Share This Page