DISCLAIMER: This thread is unofficial and may contain errors. This information comes from personal knowledge and research from other threads. I am not responsible for what you do with your device.
Context
This thread is intended to provide an explanation of the function and importance of each partition on the Motorola Moto G. Some partitions are very ambiguous, but I will attempt to describe what these partitions store, and whether they are unique/permanent/temporary etc. Again, I am not a developer, but I hope that this will explain the structure of the partitions to new users. Also, feel free to leave more information about these partitions in the comments, and I will try to update the OP with that information.
The following partition layout can be found with root access using various commands such as
Code:
ls /dev/block/platform/msm_sdcc.1/by-name
List of partitions
Code:
DDR -> /dev/block/mmcblk0p3
aboot -> /dev/block/mmcblk0p4
abootBackup -> /dev/block/mmcblk0p11
boot -> /dev/block/mmcblk0p31
cache -> /dev/block/mmcblk0p33
cid -> /dev/block/mmcblk0p25
clogo -> /dev/block/mmcblk0p28
dhob -> /dev/block/mmcblk0p20
fsc -> /dev/block/mmcblk0p22
fsg -> /dev/block/mmcblk0p21
hob -> /dev/block/mmcblk0p19
kpan -> /dev/block/mmcblk0p35
logo -> /dev/block/mmcblk0p27
logs -> /dev/block/mmcblk0p9
misc -> /dev/block/mmcblk0p30
modem -> /dev/block/mmcblk0p1
modemst1 -> /dev/block/mmcblk0p17
modemst2 -> /dev/block/mmcblk0p18
padA -> /dev/block/mmcblk0p10
padB -> /dev/block/mmcblk0p16
pds -> /dev/block/mmcblk0p26
persist -> /dev/block/mmcblk0p29
recovery -> /dev/block/mmcblk0p32
rpm -> /dev/block/mmcblk0p5
rpmBackup -> /dev/block/mmcblk0p12
sbl1 -> /dev/block/mmcblk0p2
sdi -> /dev/block/mmcblk0p7
sdiBackup -> /dev/block/mmcblk0p14
sp -> /dev/block/mmcblk0p24
ssd -> /dev/block/mmcblk0p23
system -> /dev/block/mmcblk0p34
tz -> /dev/block/mmcblk0p6
tzBackup -> /dev/block/mmcblk0p13
userdata -> /dev/block/mmcblk0p36
utags -> /dev/block/mmcblk0p8
utagsBackup -> /dev/block/mmcblk0p15
Partition explanations
Terminology
- Partition: A hard drive, eMMC, or any storage device can be divided into separate section called partitions. Most Windows, OS X or Linux machines have 1 to 3 partitions but android devices tend to have many.
- Unique: This means this partition contains data is specific to only that device, e.g. serial numbers, IMEIs, MAC addresses etc. This data cannot be found on the internet and so one should be careful not to modify or lose it.
- Flashing: Writing data to a disk or partition, replacing what was already there.
- Root ("/"): Not to be confused with "root access", this is the Unix term for the top directory. Similar to C:\, but everything is stored in it, including partition mount points.
Common Partitions
boot: This partition contains the boot image, which includes the kernel, a device tree blob (this describes the hardware to the kernel), and the ramdisk for the root filesystem (not root access - see above). This partition is usually flashed when installing custom or stock ROMs, and can be found within stock firmware. This partition does not contain the bootloader.
system: This partition contains the Android system files (i.e. the ROM). This is what is flashed (alongside 'boot') when installing a ROM, and what is modified to give root access. Before rooting or installing a ROM, one should backup this partition (and boot) to ensure they can restore to stock.
recovery: This partitions hold the files that allow one to enter ‘recovery mode’, which is essentially a second boot partition that allows one to apply OTAs, make/restore backups, and install ROMs or root binaries. This partition will either hold the stock recovery, or a custom recovery. Custom recoveries can be flashed and allow the user to backup, restore, install to and wipe other partitions, among other features. This partition can be safely modified but ensure to always have a stock recovery flashed when applying stock OTAs.
userdata: Also known as the Data partition, this is where every user file, preference and is stored, e.g. photos, settings, app settings, messages, and everything created directly or indirectly by the user. This partition is empty on a new device, and is mounted at /Data. This partition should always be backed up before modifying the phone as it contains essentially everything personal on the phone.
cache: Another common partition; this historically contained temporary data that allows the system and apps to run more efficiently. Now it is mostly used by the recovery. Nothing important is stored here, and so it can, and often should, be wiped when necessary.
Other Partitions
Bootloader Related Partitions
aboot: This partition seems to be the main part of the bootloader. It loads the kernel and is responsible for the bootloader menu and fastboot functionality. This partition is flashed as part of motoboot.img (source below) and so can be restored with stock firmware.
abootBackup: This likely stores a backup of the aboot partition.
tz: This partition also seems to be related to the bootloader, specifically something called 'Trust Zone' . This partition is flashed as part of motoboot.img (source below) and so can be restored with stock firmware.
tzBackup: Again, this likely stores a backup of the 'tz' partition.
rpm: Another bootloader related partition. This partition could possibly be the 'Resource and Power Manager' manager partition. This partition is flashed as part of motoboot.img (source below) and so can be restored with stock firmware.
rpmBackup: hopefully you get the general idea by now...
sdi: I have no idea, but it is flashed as part of motoboot.img, therefore it must be bootloader related. Is included with stock firmware.
sdiBackup: A backup of the above.
sdb1: Bootloader related. Interestingly, after looking around, I found that this appears to contains files relating to a 'Secondary BootLoader'. This partition is flashed as part of motoboot.img (source below) and so can be restored with stock firmware.
Network Related Partitions
modemst1 and modemst2: These partitions appear to contain non-essentials/temporary network related data. Interestingly, they are erased when flashing a stock rom, meaning they are probably not crucial, possibly some kind of ‘baseband cache’?
modem: The modem partition contains modem/baseband related files. These files store store settings that allow the device to communicate with cell towers, such as the frequencies. This partitions is region, not device, specific. This partition is flashed as part of the stock firmware flash procedure, so it also is likely not unique (again ensure to get firmware for the right region).
fsg: This partition also contains files related to the modem firmware/baseband. These files store store settings that allow the device to communicate with cell towers, such as the frequencies. This partitions is region, not device, specific. This partition is flashed as part of the stock firmware flash procedure, so it likely contains non-unique data (but ensure to get firmware for the right region).
Maybe ‘fsg’ and ‘modem’ are related to the modemst1 and modemst2 partitions?
Important/Unique Partitions
pds: This partition likely contains important device specific data like the IMEI, Serial Number, etc. It is important to backup this partition when you get the chance, as people in other threads attribute the loss of the IMEI to this partition. This is not included in stock firmware, reinforcing the importance of backing up this partition.
persist: Apparently this partition contains files related to WiFi, Bluetooth, MAC addresses etc. Nevertheless, it is quite important and should be backed up if possible.
hob and dhob: The exact function is not known, but they appear to contain very important information relating to the modem and/or IMEI.
fsc: Appears to be empty. Although, this partition could sometimes store important IMEI related info. Not included in factory firmware and so best left alone.
Extra
ssd: This partition appears to contains files related to something called the ‘Secure Software Download’ feature. These files are not included in factory firmware so should be left alone.
logo: This partition contains the startup splash screen and bootloader unlock warning. This partition is included with stock firmware.
clogo: After doing some research, it appears this partition might store the boot logo in an image format. Interestingly, this is not included in stock firmware, unlike the 'logo' partition.
cid: This partition appears to contain authentication/digital signature files for the bootloader. This partition is usually never interfered with, and there is no stock firmware for it, so it is best left alone.
sp: Like CID, this partition appears to contain authentication/digital signature files for the bootloader. This partition is usually never interfered with, and there is no stock firmware for it, so it is best left alone.
misc: This partition contains ‘miscellaneous system settings’, more specifically, this partition also helps the bootloader boot to recovery and pass information between boot stages. This partition is best left alone as it is apparently very important, and not included in stock firmware.
padA and padB: Apparently these are empty.
kpan: This partition seems to store kernel panic data.
logs: Possibly stores some form of log files.
utags: These partition seem to contain information used by the barcodes option in the bootloader menu.
utagsBackup: A backup of the above.
Unknown Partitions
DDR <-- Device Description Repository?.. Dance Dance Revolution?..
I could not find any information about the function of the above partitions. Although, none of these partitions are included in factory firmware, so they are likely important and best left alone. Anyone is welcome to share they own knowledge or opinion on what these partitions are for in the comments.
Sources/Interesting information:
Moto G Partition Layout.
http://forum.xda-developers.com/showthread.php?t=2540799
Bootloader Related Partitions (motoboot.img - tz, rpm, sdi, aboot, and sbl1).
http://forum.xda-developers.com/showthread.php?t=2644703&page=2
http://forum.xda-developers.com/mot...rom-xt1033-t3357718/post66336145#post66336145
Great reading about partitions on Samsung phones, although it appears a lot of this information is relevant to the Moto G. Specifically, this thread gives some hints about the function of motoboot.img, baseband partitions and the 'ssd' partition.
http://forum.xda-developers.com/showthread.php?t=1959445
Possible explanation of modemst1, modemst2 and fsg partitions. (About Samsung partitions but still relevant).
http://forum.xda-developers.com/showthread.php?p=49587431#post49587431
Instructions on flashing factory firmware.
http://forum.xda-developers.com/showthread.php?t=2542219
CID, Trust Zone, and SP partition Information.
http://blog.azimuthsecurity.com/2013/04/unlocking-motorola-bootloader.html
Possible /misc explanation, also some simple explanation of common partitions for new users.
http://www.addictivetips.com/mobile...plained-boot-system-recovery-data-cache-misc/
Some more /misc info
http://linux-sunxi.org/Android/partitions
Thread with some information relating to 'hob' and 'dhob'
http://forum.xda-developers.com/moto-g/help/imp-imei-backup-scripts-moto-g-eall-t3174569
Moto X Boot Logo Change - Appears to show purpose of 'clogo' partition on Moto G
http://www.talkandroid.com/guides/m...on-the-moto-x-splash-screen-no-root-required/
Info on Persist partition
http://forum.xda-developers.com/google-nexus-5/general/guide-to-fix-persist-partition-t2821576
https://forums.lenovo.com/t5/MOTO-G...gs-like-hell-after-update/td-p/3231064/page/2
Likely explanation of 'kpan' partition - although 'Kernel PANic' does fit well
https://plus.google.com/+hashcode0f/posts/W84mLxfMomf
Information vaguely referencing 'logs' partition
http://www.ptsmobile.com/tc55/tc55-integrator-guide.pdf
http://techtablets.com/forum/topic/help-windows-fell-by-flash-android/
Info on 'utags'
http://forum.xda-developers.com/moto-g/help/info-moto-g-imei0-t2925970/page26
Finally, thanks to @_that for extra information and corrections.
Most awesome first post I've ever seen. :good:
A few additions:
"boot" and "recovery" both contain a boot image. It begins with the magic string "ANDROID!" and they contain a Linux kernel image, a device tree blob (tables describing the hardware for the kernel), and a ramdisk image for the root ("/") filesystem.
"system" is actually mounted at /system at runtime. "userdata" is mounted on "/data".
"cache" is mostly used for communicating with the recovery.
"aboot" is the Android bootloader. It is the last step in the bootloader chain which loads the kernel. It also implements the bootloader menu and the fastboot protocol.
"logo" contains the startup splash screen and the ugly "your bootloader is unlocked" image. The boot animation is part of /system.
"misc" is used, among other things, by Android to tell the bootloader to boot to recovery.
"padA" and "padB" are really empty.
"hob" and "dhob" are somehow very important for the modem to work.
_that said:
Most awesome first post I've ever seen. :good:
A few additions:
"boot" and "recovery" both contain a boot image. It begins with the magic string "ANDROID!" and they contain a Linux kernel image, a device tree blob (tables describing the hardware for the kernel), and a ramdisk image for the root ("/") filesystem.
"system" is actually mounted at /system at runtime. "userdata" is mounted on "/data".
"cache" is mostly used for communicating with the recovery.
"aboot" is the Android bootloader. It is the last step in the bootloader chain which loads the kernel. It also implements the bootloader menu and the fastboot protocol.
"logo" contains the startup splash screen and the ugly "your bootloader is unlocked" image. The boot animation is part of /system.
"misc" is used, among other things, by Android to tell the bootloader to boot to recovery.
"padA" and "padB" are really empty.
"hob" and "dhob" are somehow very important for the modem to work.
Click to expand...
Click to collapse
Thanks _that. I've updated the OP with this info.
Which of these partitions stores the PRL file
Professor Gibbins said:
DISCLAIMER: This thread is unofficial and may contain errors. This information comes from personal knowledge and research from other threads. I am not responsible for what you do with your device.
Context
This thread is intended to provide an explanation of the function and importance of each partition on the Motorola Moto G. Some partitions are very ambiguous, but I will attempt to describe what these partitions store, and whether they are unique/permanent/temporary etc. Again, I am not a developer, but I hope that this will explain the structure of the partitions to new users. Also, feel free to leave more information about these partitions in the comments, and I will try to update the OP with that information.
The following partition layout can be found with root access using various commands such as
Code:
ls /dev/block/platform/msm_sdcc.1/by-name
List of partitions
Code:
DDR -> /dev/block/mmcblk0p3
aboot -> /dev/block/mmcblk0p4
abootBackup -> /dev/block/mmcblk0p11
boot -> /dev/block/mmcblk0p31
cache -> /dev/block/mmcblk0p33
cid -> /dev/block/mmcblk0p25
clogo -> /dev/block/mmcblk0p28
dhob -> /dev/block/mmcblk0p20
fsc -> /dev/block/mmcblk0p22
fsg -> /dev/block/mmcblk0p21
hob -> /dev/block/mmcblk0p19
kpan -> /dev/block/mmcblk0p35
logo -> /dev/block/mmcblk0p27
logs -> /dev/block/mmcblk0p9
misc -> /dev/block/mmcblk0p30
modem -> /dev/block/mmcblk0p1
modemst1 -> /dev/block/mmcblk0p17
modemst2 -> /dev/block/mmcblk0p18
padA -> /dev/block/mmcblk0p10
padB -> /dev/block/mmcblk0p16
pds -> /dev/block/mmcblk0p26
persist -> /dev/block/mmcblk0p29
recovery -> /dev/block/mmcblk0p32
rpm -> /dev/block/mmcblk0p5
rpmBackup -> /dev/block/mmcblk0p12
sbl1 -> /dev/block/mmcblk0p2
sdi -> /dev/block/mmcblk0p7
sdiBackup -> /dev/block/mmcblk0p14
sp -> /dev/block/mmcblk0p24
ssd -> /dev/block/mmcblk0p23
system -> /dev/block/mmcblk0p34
tz -> /dev/block/mmcblk0p6
tzBackup -> /dev/block/mmcblk0p13
userdata -> /dev/block/mmcblk0p36
utags -> /dev/block/mmcblk0p8
utagsBackup -> /dev/block/mmcblk0p15
Partition explanations
Terminology
- Partition: A hard drive, eMMC, or any storage device can be divided into separate section called partitions. Most Windows, OS X or Linux machines have 1 to 3 partitions but android devices tend to have many.
- Unique: This means this partition contains data is specific to only that device, e.g. serial numbers, IMEIs, MAC addresses etc. This data cannot be found on the internet and so one should be careful not to modify or lose it.
- Flashing: Writing data to a disk or partition, replacing what was already there.
- Root ("/"): Not to be confused with "root access", this is the Unix term for the top directory. Similar to C:\, but everything is stored in it, including partition mount points.
Common Partitions
boot: This partition contains the boot image, which includes the kernel, a device tree blob (this describes the hardware to the kernel), and the ramdisk for the root filesystem (not root access - see above). This partition is usually flashed when installing custom or stock ROMs, and can be found within stock firmware. This partition does not contain the bootloader.
system: This partition contains the Android system files (i.e. the ROM). This is what is flashed (alongside 'boot') when installing a ROM, and what is modified to give root access. Before rooting or installing a ROM, one should backup this partition (and boot) to ensure they can restore to stock.
recovery: This partitions hold the files that allow one to enter ‘recovery mode’, which is essentially a second boot partition that allows one to apply OTAs, make/restore backups, and install ROMs or root binaries. This partition will either hold the stock recovery, or a custom recovery. Custom recoveries can be flashed and allow the user to backup, restore, install to and wipe other partitions, among other features. This partition can be safely modified but ensure to always have a stock recovery flashed when applying stock OTAs.
userdata: Also known as the Data partition, this is where every user file, preference and is stored, e.g. photos, settings, app settings, messages, and everything created directly or indirectly by the user. This partition is empty on a new device, and is mounted at /Data. This partition should always be backed up before modifying the phone as it contains essentially everything personal on the phone.
cache: Another common partition; this historically contained temporary data that allows the system and apps to run more efficiently. Now it is mostly used by the recovery. Nothing important is stored here, and so it can, and often should, be wiped when necessary.
Other Partitions
Bootloader Related Partitions
aboot: This partition seems to be the main part of the bootloader. It loads the kernel and is responsible for the bootloader menu and fastboot functionality. This partition is flashed as part of motoboot.img (source below) and so can be restored with stock firmware.
abootBackup: This likely stores a backup of the aboot partition.
tz: This partition also seems to be related to the bootloader, specifically something called 'Trust Zone' . This partition is flashed as part of motoboot.img (source below) and so can be restored with stock firmware.
tzBackup: Again, this likely stores a backup of the 'tz' partition.
rpm: Another bootloader related partition. This partition could possibly be the 'Resource and Power Manager' manager partition. This partition is flashed as part of motoboot.img (source below) and so can be restored with stock firmware.
rpmBackup: hopefully you get the general idea by now...
sdi: I have no idea, but it is flashed as part of motoboot.img, therefore it must be bootloader related. Is included with stock firmware.
sdiBackup: A backup of the above.
sdb1: Bootloader related. Interestingly, after looking around, I found that this appears to contains files relating to a 'Secondary BootLoader'. This partition is flashed as part of motoboot.img (source below) and so can be restored with stock firmware.
Network Related Partitions
modemst1 and modemst2: These partitions appear to contain non-essentials/temporary network related data. Interestingly, they are erased when flashing a stock rom, meaning they are probably not crucial, possibly some kind of ‘baseband cache’?
modem: The modem partition contains modem/baseband related files. These files store store settings that allow the device to communicate with cell towers, such as the frequencies. This partitions is region, not device, specific. This partition is flashed as part of the stock firmware flash procedure, so it also is likely not unique (again ensure to get firmware for the right region).
fsg: This partition also contains files related to the modem firmware/baseband. These files store store settings that allow the device to communicate with cell towers, such as the frequencies. This partitions is region, not device, specific. This partition is flashed as part of the stock firmware flash procedure, so it likely contains non-unique data (but ensure to get firmware for the right region).
Maybe ‘fsg’ and ‘modem’ are related to the modemst1 and modemst2 partitions?
Important/Unique Partitions
pds: This partition likely contains important device specific data like the IMEI, Serial Number, etc. It is important to backup this partition when you get the chance, as people in other threads attribute the loss of the IMEI to this partition. This is not included in stock firmware, reinforcing the importance of backing up this partition.
persist: Apparently this partition contains files related to WiFi, Bluetooth, MAC addresses etc. Nevertheless, it is quite important and should be backed up if possible.
hob and dhob: The exact function is not known, but they appear to contain very important information relating to the modem and/or IMEI.
fsc: Appears to be empty. Although, this partition could sometimes store important IMEI related info. Not included in factory firmware and so best left alone.
Extra
ssd: This partition appears to contains files related to something called the ‘Secure Software Download’ feature. These files are not included in factory firmware so should be left alone.
logo: This partition contains the startup splash screen and bootloader unlock warning. This partition is included with stock firmware.
clogo: After doing some research, it appears this partition might store the boot logo in an image format. Interestingly, this is not included in stock firmware, unlike the 'logo' partition.
cid: This partition appears to contain authentication/digital signature files for the bootloader. This partition is usually never interfered with, and there is no stock firmware for it, so it is best left alone.
sp: Like CID, this partition appears to contain authentication/digital signature files for the bootloader. This partition is usually never interfered with, and there is no stock firmware for it, so it is best left alone.
misc: This partition contains ‘miscellaneous system settings’, more specifically, this partition also helps the bootloader boot to recovery and pass information between boot stages. This partition is best left alone as it is apparently very important, and not included in stock firmware.
padA and padB: Apparently these are empty.
kpan: This partition seems to store kernel panic data.
logs: Possibly stores some form of log files.
utags: These partition seem to contain information used by the barcodes option in the bootloader menu.
utagsBackup: A backup of the above.
Unknown Partitions
DDR <-- Device Description Repository?.. Dance Dance Revolution?..
I could not find any information about the function of the above partitions. Although, none of these partitions are included in factory firmware, so they are likely important and best left alone. Anyone is welcome to share they own knowledge or opinion on what these partitions are for in the comments.
Sources/Interesting information:
Moto G Partition Layout.
http://forum.xda-developers.com/showthread.php?t=2540799
Bootloader Related Partitions (motoboot.img - tz, rpm, sdi, aboot, and sbl1).
http://forum.xda-developers.com/showthread.php?t=2644703&page=2
http://forum.xda-developers.com/mot...rom-xt1033-t3357718/post66336145#post66336145
Great reading about partitions on Samsung phones, although it appears a lot of this information is relevant to the Moto G. Specifically, this thread gives some hints about the function of motoboot.img, baseband partitions and the 'ssd' partition.
http://forum.xda-developers.com/showthread.php?t=1959445
Possible explanation of modemst1, modemst2 and fsg partitions. (About Samsung partitions but still relevant).
http://forum.xda-developers.com/showthread.php?p=49587431#post49587431
Instructions on flashing factory firmware.
http://forum.xda-developers.com/showthread.php?t=2542219
CID, Trust Zone, and SP partition Information.
http://blog.azimuthsecurity.com/2013/04/unlocking-motorola-bootloader.html
Possible /misc explanation, also some simple explanation of common partitions for new users.
http://www.addictivetips.com/mobile...plained-boot-system-recovery-data-cache-misc/
Some more /misc info
http://linux-sunxi.org/Android/partitions
Thread with some information relating to 'hob' and 'dhob'
http://forum.xda-developers.com/moto-g/help/imp-imei-backup-scripts-moto-g-eall-t3174569
Moto X Boot Logo Change - Appears to show purpose of 'clogo' partition on Moto G
http://www.talkandroid.com/guides/m...on-the-moto-x-splash-screen-no-root-required/
Info on Persist partition
http://forum.xda-developers.com/google-nexus-5/general/guide-to-fix-persist-partition-t2821576
https://forums.lenovo.com/t5/MOTO-G...gs-like-hell-after-update/td-p/3231064/page/2
Likely explanation of 'kpan' partition - although 'Kernel PANic' does fit well
https://plus.google.com/+hashcode0f/posts/W84mLxfMomf
Information vaguely referencing 'logs' partition
http://www.ptsmobile.com/tc55/tc55-integrator-guide.pdf
http://techtablets.com/forum/topic/help-windows-fell-by-flash-android/
Info on 'utags'
http://forum.xda-developers.com/moto-g/help/info-moto-g-imei0-t2925970/page26
Finally, thanks to @_that for extra information and corrections.
Click to expand...
Click to collapse
Thanks for posting such an in depth explanation on what all those partitions mean. I am using the Moto G3 2015 and I would like to know which one of those partitions stores the PRL file, I would like to manually update my PRL as I am using Cyanogenmod and do not want to deal with the hassle of going to Stock just to perform this one simple task, so I figure that I can perform a back up with Partitions Backup and Restore app, then mount the image on ubuntu, copy the new .prl file there, unmount image and then restore the image to the corresponding partition. I am assuming that's all what it would take to change my prl provided that the prl is actually stored on one of those partition.
Nice post but lacks informations about hob and dhob partitions. This post says
1. Dhob and Hob are nothing but plain text partitions, Dhob is dynamic hob and Hob is static Hob.
2. Dhob stores cryptotext by default, this crypto text contains information like Imei, ESN, Meid etc.
3. The Hob partition is a XML formatted plain-text file that contains Data which i am not sure about.
4. Uses a PBKDF2 key for encryption and decryption of Dhob.
5. The size field in Hob is Hex. So, 16 is 22 and 32 is 50.
6. The modem updates NV items on the fly which is why you can get 0 and null IMEI by fiddling.
7. In case the IMEI doesn't match with equipment then NV item is made 0.
8. EFS is created on the go not sure.
Click to expand...
Click to collapse
Fully duplicating a tablet to many other tablets.
This guide was used to clone several hundreds of Samsung Galaxy S2 tablets, model SM-T815Y.
You will need:
Linux computer for getting the master tablet image.
Windows computer for flashing that image using Odin.
latest firmware for the Android tablet.
TWRP image for the Android tablet.
On your Linux computer, heimdall and some executables for manipulating Android sparse images. You can find these executables in my Google drive folder linked below.
Getting the master tablet image
Upgrade Android
On your computer, download the latest firmware for your tablet. You should end up with folder containing partition images.
Put the tablet in download mode: power if off, then press home + volume down + power.
Flash the firmware to the tablet:
Code:
heimdall flash --BOOTLOADER sboot.bin --BOOT boot.img --RECOVERY recovery.img --SYSTEM system.img --CACHE cache.img --HIDDEN hidden.img --RADIO modem.bin
Once the tablet boots, do a factory data reset from the settings menu.
Configure
Install and configure apps, adjust the settings, etc.
Flash TWRP
Download the TWRP image for your tablet model.
Put the tablet in download mode.
Flash TWRP to the tablet:
Code:
heimdall flash --RECOVERY twrp.img --no-reboot
Reboot into recovery: hold home + volume down + power, and as soon as you see the boot screen, hold home + volume up + power.
Get an image of the data partition
Insert an SD card into the tablet. The SD card should be big enough to contain the data partition. Make sure the External SD card is mounted from the TWRP menu.
In TWRP, go to Advanced > Terminal.
Copy the data partition to the SD card:
Code:
dd if=/dev/block/mmcblk0p22 | gzip > /external_sd/data.gz
Transfer that data.gz file to a Linux computer.
gunzip it. You should get a data file that is a Linux filesystem.
Convert it to the Android sparse format using ext2simg. You can download that executable below.
Code:
./ext2simg data data.img
Bloat the data.img headers. That is a Samsung particularity.
Code:
./sgs4ext4fs --bloat data.img data_32bit.img
Create an Odin flashable tar file by combining your data image with the firmware parititions:
Code:
mv data_32bit.img userdata.img
tar -H ustar -c boot.img cache.img hidden.img modem.bin recovery.img sboot.bin system.img userdata.img > odin_repack.tar
Flashing other tablets with the master image
From a Windows machine, open Odin, click the AP button, then open the odin_repack.tar file.
Get a tablet that you want to flash in download mode, connect it to the Windows computer.
Click start in Odin. When the flashing is finished your tablet reboots, and is exactly like the master tablet.
Notes
You can connect up to 8 tablets to Odin and flash them in parallel.
If you have very big files on the data partition, Odin may crash. In this case you'll have to transfer these files after the flashing instead of including them in the data partition.
There is any easier way. Odin allows for downloading to multiple targets at the same time.
All that is required is a raw backup of the data partition converted to sparse format.
It's unnecessary to backup or flash the cache partition as it contains nothing useful.
All it shouldn't be necessary to backup the system partition unless you have good reason to do so as you can use the stock image.
ashyx said:
There is any easier way. Odin allows for downloading to multiple targets at the same time.
All that is required is a raw backup of the data partition converted to sparse format.
It's unnecessary to backup or flash the cache partition as it contains nothing useful.
All it shouldn't be necessary to backup the system partition unless you have good reason to do so as you can use the stock image.
Click to expand...
Click to collapse
Thanks ashyx! I could get a flashable data partition. Here are the steps:
Insert an SD card in the master tablet, reboot to TWRP, mount the SD card
In the master tablet TWRP terminal:
Code:
dd if=/dev/block/mmcblk0p22 | gzip > /external_sd/data.gz
Transfer that data.gz file to your computer.
gunzip it, you should get a file named data that is a Linux filesystem.
Convert it to the Android sparse format:
Code:
./ext2simg data data.img
Bloat the data.img headers:
Code:
./sgs4ext4fs --bloat data.img data_32bit.img
Flash that Android sparse image using heimdall:
Code:
heimdall flash --USERDATA data_32bit.img
The two binaries ext2simg and sgs4ext4fs were compiled using the ANDROID_IMG_REPACK_TOOLS found at https://forum.xda-developers.com/showthread.php?t=2600364. Here they are for Android 6.0.1, Linux 64-bit:
https://drive.google.com/drive/folders/0B9BiITFgw4CLT2pvcExucXJKREU?usp=sharing
Converting to a VM?
Can I use a method similar to this to convert an older Galaxy E (SMT-377A) into a VM; perhaps suitable for VMWare Fusion or similar. Obviously without cellular capabilities. I have an older tab that is probably going to die, that I want to preserve for prosperity and perhaps even use/interact with -- but not on another tab.
Utility to create ROM from images of partitions, partitions themselves, or all this mixed up.
For arm/arm64 devices
(For x86 / x64 devices I will do if there are requests for creation)
For experienced users only who can create and restore backups.
It does not have an interface (work with the command line).
Starting from the terminal emulator in the Android OS (you need a root) or the TWRP terminal.
You can quickly create the installer of partitions: TWRP, boot, edited GSI, vendor + boot for GSI, modem, etc.
Supports sparse images.
USAGE:
Help is invoked by running the utility with no arguments, with the -h --help switches, or appears along with an error message. Content:
Code:
Usage:
romi [<comp>] <out_file> <block or file> [<block or file> ...] [<banner>]
<comp> may take the following values:
--fast faster but bigger size
--norm default with no arg's
--good better compression but longer
--high it takes a very long time
<banner> may take the following values:
--sban=<text file> adds text from the specified file to the beginning of the ROM installation
--eban=<text file> adds text from the specified file to the end of the ROM installation
At least two arguments - the result file (output) and the base file (incoming). And in that order. Example:
Code:
romi /sdcard/twrp-installer.zip /sdcard/recovery.img
If you want to change the default compression level for a session, use one of the keys suggested in the quick reference. Example with minimal compression:
Code:
romi --fast /sdcard/twrp-installer.zip /sdcard/recovery.img
There can be as many objects included in the package in ROM as there is enough space for the selected drive and device capacities to create the resulting file. Example:
Code:
romi /sdcard/stock-mod-installer.zip /sdcard/boot.img /dev/block/bootdevice/by-name/vendor system
In the last example, I will try to explain the "smart" principles of sampling.
As you can see, three objects were transferred for processing: the image file of the drive partition, the drive partition, and the "mask" of the drive partition.
The utility will check for the presence of the file and whether there is a block device of the same name; when creating the ROM, boot.img itself is used.
Check for the presence of a block device and use it when creating a ROM.
Check the "mask" of the partition and, if it finds a block device corresponding to it, add this block to ROM.
Adding banners that will be displayed at the beginning and/or at the end of the installation of the generated ROM:
Code:
romi --fast /sdcard/twrp-installer.zip /sdcard/recovery.img --sban=/sdcard/start-message.txt --eban=/sdcard/end-message.txt
You can add only the initial banner, you can add only the banner to complete the installation, you can both, you can add nothing.
XDA:DevDB Information
romi, Tool/Utility for all devices (see above for details)
Contributors
nonamer1990
Source Code: https://drive.google.com/open?id=12gEApT6yk-5R8p8ymOIOL-5PJSiQa1p-
Version Information
Status: Stable
Current Stable Version: 1.0
Stable Release Date: 2020-05-19
Created 2020-05-19
Last Updated 2020-05-19