Android partition introduction and fastboot flash tutorial

Source: Internet
Author: User

Many Forum friends are quite confused about fastboot flash, or are quite afraid of using fastboot flash. Whatever the reason, I just need to tell you that it is very simple and fast to use fastboot.
Below I will write some methods I have summarized, hoping to help G you on the road.

Fastboot for Windows has been added to the attachment. Please download it by yourself.
There is only one file, which can be downloaded and stored anywhere you can find. Before the official introduction, let's talk about G1 or android partition knowledge.
Splash1: boot screen. After nandroid backup is used to back up the system, the file is splash1.img.

Remg: This partition is in recovery mode (that is, the interface that enters by home + power upon startup). Use nandroid backup to back up data as recovery. IMG.

Boot: Kernel boot partition, which is backed up as boot. IMG using nandroid backup

System: Android system. The directory is/system, which is usually read-only. nandroid backup is used to back up data as system. IMG.

Cache: cache folder. The directory is/cache. In fact, it is useless except for T-Mobile OTA update. nandroid backup is used as cache. IMG.

Userdata: software installed by the user and various data. The directory is/data, and nandroid backup is used to back up data. img

Therefore, you can understand the image as follows:
1. Modify the boot screen. The modification is splash1.
2. All partitions are flushed during root operation.
3. Click test_keys to update the recovery.
4. Use update.zip to update boot, System
5. Restore the factory settings and clear userdata and cache.
After understanding this, you can understand it well. Generally, you do not need to update the recovery. IMG. Normally, you only need to update boot and system. however, in my opinion, the two are interdependent and inseparable. okay. Next, let's start to explain how to brush the machine.
Enter the mobile phone's SPL mode (Power + camera), and the driver has been installed.
The driver has been uploaded as an attachment. If this problem is found in my computer device management, Figure 1 is not correctly installed. You only need to right-click to update the driver, and point to the driver you downloaded from me.

Description: Figure 1.

 

No matter where you download a file that contains boot. IMG and system. IMG, you only need to download the files that contain these two files. You can then copy the downloaded fastboot file to this folder, as shown in figure 2.

Description: Figure 2.

 

In start-run cmd for example 3

Description: Figure 3.

 

Now you can see the opened command line
Run the CD command to open the folder where fastboot is located. Figure 4

Description: Figure 4.

 

Enter fastboot devices Figure 5

Description: Figure 5

 

If I see htxxxxxxx fastboot, this proves that you have already succeeded in half. OK, the next step is to erase the partition and use fastboot erase XXXX.
For example, you only need to erase boot, system, userdata, and recovery .. Oh, you actually need it.
OK. See figure 6.

Description: Figure 6.

 

Okay

Description: Figure 7

 

Still okay .. I will not erase userdata and recovery, and the command is also
Fastboot erase userdata: Press ENTER
After fastboot erase recovery is completed, press Enter.
OK. After the erased file is complete, click it... Figure 8

Description: Figure 8.

 

Flash boot. IMG first. The command is simple.
Then flash system. IMG Figure 9

Description: Figure 9.

 

Also okay, like the previously backed up userdata or recovery, you do not need to use flash if it is not erased. The syntax is as follows:
Fastboot flash userdata. img)
Fastboot flash recovery. img
OK, next restart, fig 10

Description: Figure 10

 

At this point, the flash is all over. Wait until your small G starts up ..
Sometimes, fastboot is not allowed when you install the APK program on your computer. You only need to run ADB install xxx.apk under SDK-tools, the premise is that the program you want to install is in the same directory as ADB.

Due to the habits of underlying R & D, I first looked at the distribution of file systems in NAND FLASH:
I connected G1 using ADB in Ubuntu, and then:

# Cat/proc/MTD
Dev: Size erasesize name
Mtd0: 00040000 00020000 "Misc"
Mtd1: 00500000 00020000 "recovery"
Mtd2: 00280000 00020000 "Boot"
Mtd3: 05a0000000020000 "system"
Mtd4: 01e00000 00020000 "cache"
Mtd5: 059c00000 00020000 "userdata"
Mtd6: 10000000 00020000 "msm_nand"

We can see that:
Misc: 0.25 MB: it is the partition that stores the boot screen, that is, the white big G1 text displayed at boot (the default is white "T-Mobile G1 ")
Recovery: 5 MB: indicates the image area in the recovery mode of G1 (that is, the interface to be started by home + end)
Boot: 2.5 MB: partitions stored after the Linux operating system kernel is packaged with the ramdisk Image
System: 90 MB: The partition stored by system. IMG. After the image is started, it is mounted to the system folder under the root directory.
Cache: 30 mb: it is a temporary cache folder and mounted to the/cache directory. It is said that it is useless except for T-Mobile's OTA update.
Userdata: 89.75 MB: the software installed by the user and various data are mounted to the/data directory.

Msm_nand: 256 MB: represents the entire NAND Flash, not a partition. However, all the partitions add up to 217.5 MB, less than 256 MB, indicating that there is still the remaining flash space. (This partition does not exist on most hosts and does not affect usage)

The NAND Flash used by G1 is k5e2g1gacm, but datasheet is not found on Samsung's Internet, and Google is not found on the Internet!

The output in the simulator is as follows:
# Cat/proc/MTD
Dev: Size erasesize name
Mtd0: 04000000 00020000 "system"
Mtd1: 04000000 00020000 "userdata"
Mtd2: 06100000 00020000 "cache"

 

 

 

 

Add the G2 partition of the Black edition:

# Cat/proc/MTD
Dev: Size erasesize name
Mtd0: 00040000 00020000 "Misc"
Mtd1: 00500000 00020000 "recovery"
Mtd2: 00280000 00020000 "Boot"
Mtd3: 05a0000000020000 "system"
Mtd4: 05000000 00020000 "cache"
Mtd5: 127c0000 00020000 "userdata"

 

We can see that the cache and userdata become larger because the G2 Rom is MB.

 

From the above data, I can find a phenomenon: No matter G1 or G2, all the partitions add up to 38.5 MB smaller than the whole NAND Flash, and these spaces should be used separately, one of the functions is to store bootloader. However, from past experiences, bootloader may not have 38.5 MB, which is certainly useful and may be used in virtual memory (speculation)

///////////////////////////////

Android phones with large-capacity Rom generally divide a part of Rom into system partitions, while others are virtualized into built-in SD cards, such as Samsung and Huawei mobile phones, in fact, most of the nominal large Rom is virtualized into a built-in SD card.

Therefore, the ROM can be adjusted because it is the capacity set during partitioning. For example, on a hard disk, the size of disk C, disk D, and disk e can be adjusted, the difference is that it is difficult for Android users to adjust their own.

First look at the partitions of the Android system. Generally, the android system divides the ROM chip into seven zones. If the built-in SD card is added, there are eight:
Hboot partition ---- start.
Radio partitioning-responsible for driving (Communication baseband ).
Recovery partition-responsible for recovery.
Boot partition-system kernel.
System partition-system file.
Cache partition-system cache.
Userdata partition-user data.

No, the capacity of the first six zones is invisible in the system information. The total Rom capacity we see is actually the size of the userdate zone of the first six zones, some software is installed in this zone, which is a partition that users can use. The size of this partition directly affects the number of installed software. That is to say, the userdate zone is what we often call "available Rom ".

In Android, although the software can be installed in the card, it is recommended that some system software be installed in the userdata partition. Otherwise, some minor loading problems may occur, for example, the desktop software used and some software that displays plug-ins on the desktop. And even if you load all the software into the card, the userdata partition will continue to decrease. Just like in windows, even if you install the software on disk D, some system files will still be generated on disk C to occupy disk C space.

///

The "system" area stores all the data in the Android system directory. After the machine is started, all the systems are here (the system will be mounted to the system/directory after the system is started ).

The "userdata" area stores all the data in the android data directory (after the system is started, it is mounted to the data/directory, which contains a lot of application data and configuration data such as your preference, the cell phone memory space we see in the cell phone settings is here ).

The "userdata2" area allows users to store their favorite images and music. (after the system is started, it will be mounted to the data/hwuserdata/directory, the internal SD card space we see in the phone settings is here) (This version does not exist, and it is merged with userdata ).

The "cache" area is a cache space where the cached data and commands used by programs or systems are stored. The CPU will give priority to calling and executing commands. (After the system is started, it will be mounted to the cache/directory ).

The "Boot" area is a necessary system for storing boot phones. It includes some underlying hardware drivers, which are mainly divided into ramdisk and Linux kernel. (Mount it to the root directory after the system is started ).

The "recovery" area is similar to the boot, but the system started during recovery has more recovery programs and resources than the boot. (Mounting only in recovery mode)

The "Splash" area is the first screen to boot. It is used during boot. (I don't know where to mount it ?)

The "Misc" area contains the bootloader control block (BCB), which is used to store the rediscovery boot information. (I guess it is mounted only when the recovery mode is enabled)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.