SOLVED Logical Linux-like file structure on Android phone

I finally solved the messy file structure of Android!

While everyone has their own idea of a nice file system, it helps everyone if one person can get a specific system to work!

I've done that.

I want to show my current solution so that you can benefit. Also, you can suggest improvements.

I can't change the internal sdcard Android file structure except to create symbolic links to the external sdcard where appropriate, which is what I have effectively done below.

Here's the file structure that you can make ahead of time: /storage/extSdCard/data/ /storage/extSdCard/tmp/

These are created somehow by Android, so you can't avoid them: /storage/extSdCard/Android /storage/extSdCard/LOST.DIR /storage/extSdCard/.android_secure

In the "data" directory, you can create these managed directories: ./data/audio/{audiobook,mic,music,phone,podcast,ringtone} ./data/doc/{docx,excel,memo,pdf,ppt} ./data/download ./data/map/{gpx,kml} ./data/pic/{camera,snapshot} ./data/software/apk ./data/video

To tell Android to *use* those locations, install this freeware: Redirect File Organizer by Xavier Tobin (handles all the folders above)

formatting link

There are only two steps in toto:

  1. Define your desired file system FROM: /storage/emulated/0/App_Backup_Restore TO: /storage/extSdCard/data/software/apk
  2. AutomaticCallRecorder: Settings > Recording Path > FROM: /storage/emulated/0/CallRecordings/ TO: /storage/extSdCard/data/audio/phone/call
  3. GTVoiceNotes: Settings > Recording folder FROM: /sdcard/GTVoiceNotes TO: /storage/extSdCard/data/audio/mic/GTVoiceNotes (it will create the folder on its own)
  4. DONOTUSE: Camera: Settings > Storage > Memorycard Unfortunately you get no granularity other than FROM: /storage/emulated/0/DCIM TO: /storage/extSdCard/DCIM So just make sure that the Camera is set to: Camera: Settings > Storage > device
  5. DONOTUSE: (default) Voice Recorder: Unfortunately you get no granularity other than Settings > Storage > (Device or Memorycard) So just make sure that the recorder is set to: Recorder: Settings > Storage > device
  6. DONOTUSE: CameraFV5 FROM: "DCIM/CameaFV5 folder" It only has three choices, one of which is "custom" but it doesn't internal, external, or custom (but custom doesn't seem to work)

The whole point is to keep a logical file hierarchy on the external sdcard, which I have been able to do above. Any advice is appreciated, but, let's not argue over the "specific" hierarchy I chose, as that is the hardest thing to come up with, but, since everyone may wish to organize their socks differently, the actual organization is not an important point.

The important thing is that you *can* organize your files on Android! If you know of improvements, let me know!

Reply to
Jim Jansen
Loading thread data ...

Jim Jansen wrote this copyrighted missive and expects royalties:

Thank you for sharing!

Reply to
Chris Ahlstrom

Thanks for recognizing that it can help all of us.

The hardest (and most controversial) part is always how "I" organize my socks versus how anyone else organizes theirs.

The second hardest part was finding a free app that created the symbolic links. At first, I tried a few "crippleware" apps, that only created one to three links, but I needed more than what they could offer for free:

This only allows 1 folder redirect (before asking you to pay): URSafe Media Redirector by Venator Software Media & Video

formatting link

This also only allows 1 folder redirect (before asking you to pay): Photo & File Redirect by Nicola Rosada

formatting link

This at least allows 3 folder redirects (before asking you to pay): Automatic File Mover FREE by CM Apps

formatting link

In fact, I had used those 3 apps above and needed *more* links, so I stumbled upon Xavier Tobin's app merely in trying to find another free crippleware app that allowed more links:

Redirect File Organizer by Xavier Tobin (this redirects many folders for free)

formatting link

Once I realized that Redirect File Organizer did everything I needed, I started over again and deleted everything and did it all with just that one app. Hooray!

By the way, could there have been an even *simpler* way to move folders.

Perhaps I could have just used a terminal and typed in a symbolic link? "ln -s /oldfilespec /newfilespec".

Does anyone here know whether it could have been that simple? $ mv /storage/DCIM /storage/extSdCard/data/pic/DCIM $ ln -s /storage/extSdCard/data/pic/DCIM /storage/DCIM

Reply to
Jim Jansen

FAT (fat16, fat32, vfat) filesystems do not support symbolic (or hard) links.

If you can format your external card as ext2, ext3 or ext4, it may work with Android (since the underlying kernel is linux).

Reply to
Scott Lurndal

Thank you for that suggestion.

My external SD card is 134GB so it must be exfat, which you didn't list above so I wasn't sure if the card allowed symbolic links.

Googling, I find this article: Does or will exFAT support symlinks?

formatting link
Which implies that exfat does not support symbolic links.

I also was unsure what the file system of the default Android internal sdcard was, so I googled and found that it's amazingly difficult to find an article that describes what the Android default file system is.

I found this which implies that Android defaults to yaffs2 and vfat, depending on what part of the Android file system we're looking at: What is Android's file system?

formatting link

Since we're looking at moving things from the internal sdcard to the external sdcard, it seems that the internal file system is "vfat".

If the internal card is vfat and the external card is exfat, neither of which apparently support symbolic links, then, I see exactly why you said that "ln -s" wouldn't work. Too bad. It would be so easy if it did.

I wonder how the "Redirect File Organizer" app manages to run, in effect, a symbolic link?

Anyway, it works, so, here's my suggested method for storing on the external sd card all your important data, which then can be easily backed up over your local WiFi network (I abhor the cloud for a variety of reasons) to your hard disk drive or directly to DVD or other hard media.

  1. Write down on paper your desired file system, with the rule being that all data that you want to back up later, should be under a single directory at some point high up.
  2. Manually consider each of your apps, one by one, & note which apps store data you want to keep and backup later. (We'll call these the "important" apps.)
  3. Make sure that each "important app" has a logical place to store its data on your external SD card. Usually that means you need to modify the hierarchy you defined in step 1 above.
  4. Install "Redirect File Organizer" on our Android device.
  5. One by one, for each "important app", redirect its data to the corresponding location on your external SD card. (Almost always you'll find you need to re-organize your hierarchy, e.g., I went through a half dozen iterations myself, and I'm very experienced at organizing Windows & Linux file system hierarchies).
  6. When it comes time to back up the data, you can easily just back up your "data" hierarchy, confident that you have just what you need (no more, no less).

It's (almost) perfect!

Reply to
Jim Jansen

BTW, while I was googling to find that the Android default file system is both vfat (for /sdcard0) and yaffs2 (for everything else), I found this nice article which explains the *organization* of the Android partitions.

Android File System Structure/Architecture/Layout Details

formatting link

Android consists of six partitions: /boot ==> e.g., the android kernel /system ==> e.g., the android os /recovery ==> e.g., a backup boot recovery area /data ==> e.g., contains your applications /cache ==> e.g., frequently accessed data /misc ==> e.g., on/off system settings And two sd-card partitions: /sdcard ==> e.g., user data /sd-ext ==> e.g., more user data

Reply to
Jim Jansen

HomeOwnersHub website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.