Android Storage: Internal, External, Removable. Part 1/3

Android OS is currently the most flexible and functional of mobile operating systems, which ensures its high popularity. Internally, an Android device assumes the presence of its own file system, the structure of which is determined by a tree-like architecture, which differs from the organization of information in Windows and for many users has an unusual appearance.

Data can be stored in internal memory and external memory (and users and Google understand different things by these concepts). Some files and folders are available for working with them, while others, for example, those created by the system, can be seen by turning on the display of hidden elements in the file manager, but you can make your own adjustments only if you have root rights (by default, this option is not available for system safety reasons Android).

The amount of memory on modern devices allows you to record an impressive amount of information, and depending on the nature of the data, you can choose where exactly to save the created files. As for the Android storage model, it’s worth bringing a little clarity here, for which we turn to such concepts as Internal Storage and External Storage and consider each separately (if we translate the terms from English, the first is an internal storage location, and the second is an external one) .

The drive is 75% full. Transfer data to SD card

Over time, when the amount of information stored on a smartphone increases greatly, the user may encounter the problem of insufficient memory on the phone. The memory-full notification may look different. Here is one example:

What does this warning mean? In this case, the system warns that there is less than 25% free space left on the device’s internal memory. By and large, this is not a critical error, the available memory is still available, but you need to keep two things in mind:

  1. Free space on your phone may soon run out, so to prevent this from happening at the most inopportune moment, take care in advance to free up occupied space.
  2. For comfortable work with the OS, it is advisable to keep some amount of internal storage memory free. This will ensure that you maintain a level of performance and smoothness in everyday use.

In the article Memory on Android. All sections of the memory of Android devices , we dwelled in detail on the analysis of all types of Android OS memory. There was also the following line:

Internal phone storage is that part of the smartphone’s memory module that is not occupied by system partitions and is available to the user for storing applications, media content and documents. The part of memory on which the software is installed is defined as the Data , and the part occupied by user files is defined as User . Often there is no real boundary between these areas, and then the allocation of memory depends only on the needs of the device owner.

If we take this into account within the framework of the current publication, we conclude that the system can notify both about a lack of memory on the internal drive in general, and specifically about a lack of memory in the Data section. The difference is as follows:

  • If a smartphone needs to free up space in the general internal storage, then we can sacrifice either user data (music, photos, videos, documents), or applications and files associated with them.
  • If you need to free up the dedicated Data section on your smartphone, then deleting photos or music will not lead to any result. In this case, optimization of the memory occupied by programs and games is required. This is important to understand.

If everything is more or less clear with deleting media files and documents, then we will consider the issue of optimizing the memory occupied by applications in more detail.

What is External Storage and where is it located?

Now let's look at what External Storage is in Android. This is external storage where user data is saved, which is easy to find on the phone. The Storage folder will be located in Android/data, and in this directory there are numerous subfolders with application names (the location of the external memory is determined by the OS, but not by the user).

Clear cache and free up storage space in Android OS

There may be various files here, for example, music, photos, videos and other content available to the user and applications. That is, the location of External Storage can be anywhere in the phone’s memory or on removable media, and external storage means not only an SD card, but also part of the built-in memory of an Android device (the difference from the internal one is in security).

Thus, there are two types of external drives:

  • Primary External Storage. Built-in shared storage, which can be accessed when your smartphone is connected via USB to a computer or laptop.
  • Secondary External Storage. Removable memory, such as an SD card.

External storage data is managed using existing operating system tools or an installed file manager; third-party software can be used. The user has access to any manipulation of files; they can be renamed, copied, transferred, deleted, etc. However, deleting some data may affect the functioning of individual programs installed on the device, so before doing this it is better to check the purpose of the element.

General external storage for saving data common to different applications lies in the root of the external partition (next to the Android folder), for example, the DCIM folder for photos from a smartphone camera. These files will remain in place if you uninstall the app, but you can follow the steps to remove them manually if necessary.

The external storage used to save files is supported by each Android device, its capacity differs depending on the device model, and this information is indicated in the specifications.

Both internal and external storage perform the task of storing temporary or permanent data, and the sections differ in the level of access to information.

Emulation:

Why is emulation here? An emulated file system is an abstraction layer on a real file system (ext4 or f2fs) that serves primarily two purposes:

  • Keeping Android devices USB connected to PC (now works via MTP after a few days)
  • Restrict unauthorized applications/processes from accessing user's personal storage media and data of other applications on the SD card.

Read Android Storage Travel for details, summary:

Early Android devices lacked internal storage and relied on (physical) external SD cards, which traditionally use the FAT family file system to ensure compatibility with most PCs (see Microsoft's Dominance in the PC World). As the internal storage size grew, the same file system was moved to the internal (still called "external") SD card. But the implementation of FAT/vFAT had two main problems that Google gradually solved:

  • Android devices were connected to PC directly (USB Mass Storage) the same way we connect USB storage these days. UMS exposes the device at the block level and disconnects the SD card from the Android platform (disables mounting), which makes entire data inaccessible to applications and possibly breaks many functions.
  • FAT (a favorite of Windows in its design days) was never intended to provide UNIX permissions (symlinks mode, uid, gid and similar, and ioctls like FS_IOC_FIEMAP). Thus, all data on the SD card was available to all applications (since every Android application is a UNIX/Linux user and has a user ID) without restrictions, which causes serious security and privacy issues.

Both of these problems were solved using emulation:

  • The actual SD card storage has been moved to the /data partition (or an independent /sdcard partition on some devices previously), which contains the ext4 filesystem (phasing out being replaced by f2fs), fully implementing UNIX permissions.
  • This design made the use of UMS impossible because the entire /data partition could not be opened to the PC for two reasons: (1) It contains a lot of settings and application data that must be protected from other applications as well as from users. (2)Linux file systems are not supported by Windows. Thus, UMS was replaced by Media Transfer Protocol, which is a client-server extension to PTP, an already established protocol. MTP does not provide a block device, but operates through a software stack. The MTP host runs on Android as an application (android.process.media), completely isolated in the Android environment, unable to perform any complex tasks.

Now applications (and MTP, which is also an application) instead interact with the emulated /data/media storage, doing both tasks simultaneously, i.e. performing permission checking on the bottom and looking like a FAT file system on the top surface.

Google is now implementing emulation via sdcardfs to overcome the shortcomings of FUSE; One of the main reasons is I/O costs, i.e. increasing read/write speed.

EXTERNAL STORAGE PERMISSIONS: The concept of public and private files on external storage can be demonstrated with an example: Install the Termux application. Create directories /sdcard/Android/data/com.termux/test_dir and /sdcard/test_dir. Create the files /sdcard/Android/data/com.termux/test_file and /sdcard/Android/data/com.termux/test_file. Run the following commands:


*You must have WhatsApp installed or select another application's personal folder.

Now force stop the Termux application and grant storage permission. Run the commands again:

See the difference in permissions for the same files and directories. It seems that this is simply not possible without emulation on the native Linux file system when hundreds of applications (users) are running simultaneously. It is a file system emulation that allows the same file to be opened with three different sets of permissions simultaneously, regardless of its original permissions on the real file system:

# touch /data/media/0/test_file# stat -c '%a %u %g %n' /data/media/0/test_file644 1023 1023 /data/media/0/test_file# stat -c '%a % u %g %n' /mnt/runtime/*/emulated/0/test_file660 0 1015 /mnt/runtime/default/emulated/0/test_file640 0 9997 /mnt/runtime/read/emulated/0/test_file660 0 9997 /mnt /runtime/write/emulated/0/test_file

Also see: What is the UID "u#_everybody"?

Connected:

  • Why is the 'storage/emulated/' directory not accessible?
  • How can I make a symbolic link (or equivalent) inside /storage/emulated/0?

What do Android applications consist of?

First of all, it is worth pointing out that each Android application can be divided into three parts according to the type of files used:

  1. Program . This is the application itself, an apk file.
  2. Application data . This is user information that is saved throughout the entire life of a particular program on a smartphone. Data is entered into the program by the user or at his direct request.
  3. Application cache . These are temporarily stored files. Roughly speaking, this is the same user information, with the only difference being that its loss does not affect the performance of the application. The program is able to fill the cache with the necessary data independently during operation.

Now let’s determine where the program, its data and the application cache on Android are stored. If we continue to refer to the above-mentioned article about memory on Android and use the classification of partitions from it, then we can safely say that the program itself, the data of user applications, and their cache are stored in Non-Volatile Memory -> in the Rewritable EEPROM Section -> Internal phone storage (internal storage) -> Data (that is, data). In this case, we are not considering system applications, since they are located in the System section being flashed, and, without root rights, are not available for removal. That is, from the above we conclude that both the program and its data with cache occupy memory in the Data section, which means that clearing any of these components frees up user space and, in fact, partially solves the problem of low memory on an Android device. Let's take a closer look at all the components of Android applications.

Article on the topic: Google Android what is it

Where can I find storage in the settings?

Go to Settings > General > Storage [device]. You may see a list of recommendations for optimizing your device's storage, listing installed programs and the amount of memory used by each.

Interesting materials:

How can I hide text in Word? How can you highlight text in HTML? How to copy text on a computer without a mouse? How to type text on a computer without a keyboard? How to type text with Swipe on iPhone? How to start text on a new line in VK? How to find personification in a text? How to find spelling patterns in text? How to find key phrases in the text? How to find adverbs in text?

What is Termux used for?

Termux

is a free terminal emulator for Android that includes a large collection of Linux operating system packages. ... The application supports advanced management if you have superuser rights and install a special package “tsu” (analogous to sudo). Without root rights, the application also has quite wide capabilities.

Interesting materials:

Where did the first life on Earth originate? Where can I insure my car with compulsory motor liability insurance? Where can I certify a purchase and sale agreement? Where did Steve Jobs live? Where did the Incas live? Where did mammoths live in Russia? Where did the Wends live? Where did the Mayan tribe live? Where does Davidich live? Where does the goldfinch bird live?

Android Memory: Clear cache and app data

Mobile device memory is an issue that interests many owners of Android smartphones. The amount of available free memory provided by phone manufacturers has increased significantly in recent years, but the amount of data that users store in wearable gadgets is growing even faster.

Article on the topic: How to install the installer on Android

In this article we will talk about one of the ways to free up space in the memory of an Android smartphone. Below we will talk about what clearing the cache is and what happens when you click on the Clear data for applications in Android OS .

How can paths to root directories differ?

To fully understand what a root folder is, let's look at any of the programs available on the computer. Most often, during the installation process, the installer itself suggests the location where the main files of the installed application will be placed. Typically these are the Program File directories for 64-bit programs and Program Files (x86) in the case of 32-bit applications.

For example, you installed the WinRAR archiver, for which a subfolder with the name of the program was created in the main directory of program files.

It contains the main application launch file in EXE format and some related components. Thus, this directory is the root directory for the program itself (and not the program directory with all the subfolders with installed applications).

How to find the storage folder on Android?

I unpacked the archive into storage and can’t find the specified path,
how can I find the /storage/sdcard0/ folder on Android?

This is actually not a folder, storage is general storage, it includes device memory, internal memory and an external memory card. That’s why it says storage/SDcard 0/and then there are folders. You should probably unpack it to sdcard 0, that’s where you should look, or maybe to sdcard1, depending on where you sent it.

In order to make everything clear with this, it is enough to install any file manager, for example Total Commander, but in it you can already see that the storage/sdcard0 is located here:

sdcard0 - usually the device’s memory card, at least that’s how it is for me;

sdcard1 - built-in memory on which you can store files (for applications there is another memory section, but in this case it is not important).

You should unpack archives and add other files to one of these locations, but it is not recommended to simply place them at the root of the file system.

In fact, storage in Android is not a folder, but a section that includes real memory cards, both internal and flash memory (SD). And when the path to a file is written, storage is indicated at the beginning.

The first task, the correct answers to it will be: Celebration, goal, sport, gloves, helmet, boots, lacrosse, player, net, success.

The second task, the correct answers to it will be: Butcher, ribs, shop, counter, buyer, meat, price tags, carcasses, semi-finished product.

The third task, the correct answers to it will be: Iron, copper, pressure gauge, table, curtains, windows, valves, boilers, brewing, beer.

The fourth task, the correct tasks for it will be: Forest, fence, comb, plumage, wings, beak, bird, dove, paws, vegetation, nature.

The fifth task, the correct answers to it will be: Diamonds, emerald, luxury, transparency, reflection, ring, stones, diamond, jewelry.

Another crossword game for Android, the correct answers to level 1 will be like this.

The first task is horizontal, Napkin, straw, spoon, sugar.

Vertically. Serving, pancakes, sieve, fork, dishes, breakfast, eggs.

Article on the topic: How to install a bin file on Android

The second task, horizontally, Flowers, calm, embankment, sand, seagulls, hill.

Vertical, Grass, shadows, beach, trees, bench.

Third task, Horizontal, Currant, apricot, lid.

Vertical, Leaves, table, jar, cherries, cups, fruits.

Fourth task, Horizontal, Comfort, relaxation, coffee, fireplace.

Vertical, Slippers, tablet, heat, steam, fire.

Fifth task, Horizontally, Cups, bracelet, napkins, frying pan, dishes.

Vertical, Breakfast, coffee, water, bottle, waffles.

Gorse, code, cat, mole, tor, mouth, rod, rokot, dart, eye, current, rock, lamb, youth, orc (villain from The Lord of the Rings), court, pillbox, dor (spread according to Dahl's dictionary), cord ( woolen fabric), odr, trok (girth, braid on the buckles of a horse), dok, odor (something torn off according to Dahl’s dictionary), rotok.

Go to the cabinet on the left and take the razor. Turn around and take a chair. Look at the cover on the ceiling. Set up a chair and pull the string. There will be a key there. Open the cabinet with them and take the flask with the skull. Use it on the closet next to the girl. The doors will open and you will see the password - 7913. Turn around. There is a box on the floor. This is the password to it. When you open the box, you see the order of colors: red - purple - green - blue. Enter these colors on the right side of the cabinet, which is to the left of the door. Take the hammer from the cabinet. Turn around. There is a shelf on the wall with a white box on it. Break it with a hammer and take out the camera. Nearby there is a wall covered with newspapers. Use a razor on her. And then - the camera. You will see the numbers - 3784. Also look at the bottles that are in the right corner of this location. You need to match the colors of these bottles and the colors of the stripes on the cabinet. Then the password is changed. And it turns out - 4738. Enter these numbers and get the key. We open the doors and see. Okay, he's not scary

Rating
( 2 ratings, average 4 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]