FORUMS
Remove All Ads from XDA

[GUIDE] How to create 'mmcblk0.img' from a working device?

300 posts
Thanks Meter: 378
 
By kalyansundhar, Senior Member on 12th June 2018, 04:53 PM
Post Reply Email Thread
Below are the steps I followed to create a mmcblk0.img from a working device.

What is needed? -
a) A Working device of same model XT179x where 'x' could be 2,3,4,5,etc depending on region.
b) It should be a rooted one.
c) A working linux system. Any variant would do.

Steps to follow in working device:
1) Reboot device to TWRP recovery.
2) Take a backup of system,data and boot partitions. While taking backup, select the storage as Micro SDCard.
3) Once backup is complete, do a factory reset. This step is required as you don't want your friends personal files and settings.
3a) Power off the device.
4) Remove the SIM and existing SDCard.
5) Insert a new 32GB SDCard Class 10 UHS-1 into the device. This should be formatted as FAT32 or exFAT.
6) Boot the device.
7) Once booted, connect the device to computer using USB.
8) Open a terminal in your linux.
9) adb devices (This step assumes that adb and fastboot are in linux system path)
10) adb shell
11) su -
12) You are in root shell now.
13) cat /proc/partitions.
13a) Above step would list out all partitions.
14) Note the size of mmcblk0 partition.
15) Now run 'dd if=/dev/block/mmcblk0 of=/storage/<STORAGE-ID>/mmcblk0.img bs=1000000000 count=30' without quotes. 'bs' stands for block size. Here in the above command I am giving a block size of 1GB. In my case mmcblk0 partition size was nearly 30GB. So the above command worked for me. If you are experiencing problem, then play with the numbers. For example you could try decreasing the 'bs' value and increase the 'count' value. Ultimately 'bs' multiplied by count should be the partition size. If everything goes fine, you will have a mmcblk0.img in your sdcard. One more point to note. <STORAGE-ID> in the command is the place holder. The actual ID would be a hexadecimal value. You can get your storage id by doing a 'ls /storage' in root shell. In my case the SDCard was referred as 7368-9BEE.
16)Above step would take some time as it has to create a image of 30G size. Once complete, copy the image from SDcard to your computer.
17) Power off the device and remove the SDcard from device.
18) Insert your friend's SIM card and SDCard.
19) Boot to TWRP recovery.
20) Restore the backup you took in step 2 above.

Thanks
KS
The Following 15 Users Say Thank You to kalyansundhar For This Useful Post: [ View ] Gift kalyansundhar Ad-Free
 
 
12th June 2018, 05:00 PM |#2  
vaserbanix's Avatar
Senior Member
Flag Bucharest
Thanks Meter: 2,063
 
Donate to Me
More
Quote:
Originally Posted by kalyansundhar

Below are the steps I followed to create a mmcblk0.img from a working device.
Thanks
KS

I, Thankyou!
The Following 2 Users Say Thank You to vaserbanix For This Useful Post: [ View ] Gift vaserbanix Ad-Free
13th June 2018, 09:52 PM |#3  
takoa's Avatar
Senior Member
Flag mAdRiD
Thanks Meter: 11
 
More
Can someone please create this file of a moto g5 xt1676 cedric?
we are many who need this file. Thanks again.
13th June 2018, 10:28 PM |#4  
vaserbanix's Avatar
Senior Member
Flag Bucharest
Thanks Meter: 2,063
 
Donate to Me
More
Quote:
Originally Posted by takoa

Can someone please create this file of a moto g5 xt1676 cedric?
we are many who need this file. Thanks again.

sure, but you have to ask this in g5 threads not here
is hard to beleive someone has both devices tipe g5 and g5s
The Following User Says Thank You to vaserbanix For This Useful Post: [ View ] Gift vaserbanix Ad-Free
26th June 2018, 06:07 PM |#5  
Junior Member
Flag and Netherlands ...
Thanks Meter: 12
 
More
I just used adb in a dos-cmd-prompt under windows 10. As steps 10 until 15 are executed inside 'adb shell' and use nothing of the underlying OS (only on the phone itself).

Furtheron, i had to use a exFAT formatted SD-card, as FAT32 maxfile size is 4Gb and the mmcblk0.img file will be (a lot) bigger.
And i had to use a 64Gb SD-card as my mmcblk0.img seems to be bigger as yours (and the SD-card hosts some files in the android-folder, onces the phone was booted).

My mmcblk0 was listed in 'cat /proc/partitions' sized at 30.535.680 (blocks of 1024 bytes).
I used dd command:
dd if=/dev/block/mmcblk0 of=/storage/<SDcard-ID>/mmcblk0.img bs=1048576 count=29820
matching the exact size of mmcblk0

Once i uploaded the image file, i will put the download link in a post in the unbrick thread. With specs of my phone and versions.
The Following 4 Users Say Thank You to hanshu43 For This Useful Post: [ View ] Gift hanshu43 Ad-Free
28th June 2018, 10:53 PM |#6  
Junior Member
Thanks Meter: 9
 
More
Can you make a video about it? which is in linux or windows 10 because I already have 2 days with my cell phone dead and I still can not solve the problem. The template is xt1792.
29th June 2018, 02:58 AM |#7  
Member
Flag Salvador
Thanks Meter: 169
 
Donate to Me
More
Quote:
Originally Posted by kalyansundhar

Below are the steps I followed to create a mmcblk0.img from a working device.

What is needed? -
a) A Working device of same model XT179x where 'x' could be 2,3,4,5,etc depending on region.
b) It should be a rooted one.
c) A working linux system. Any variant would do.

Steps to follow in working device:
1) Reboot device to TWRP recovery.
2) Take a backup of system,data and boot partitions. While taking backup, select the storage as Micro SDCard.
3) Once backup is complete, do a factory reset. This step is required as you don't want your friends personal files and settings.
3a) Power off the device.
4) Remove the SIM and existing SDCard.
5) Insert a new 32GB SDCard Class 10 UHS-1 into the device. This should be formatted as FAT32 or exFAT.
6) Boot the device.
7) Once booted, connect the device to computer using USB.
8) Open a terminal in your linux.
9) adb devices (This step assumes that adb and fastboot are in linux system path)
10) adb shell
11) su -
12) You are in root shell now.
13) cat /proc/partitions.
13a) Above step would list out all partitions.
14) Note the size of mmcblk0 partition.
15) Now run 'dd if=/dev/block/mmcblk0 of=/storage/<STORAGE-ID>/mmcblk0.img bs=1000000000 count=30' without quotes. 'bs' stands for block size. Here in the above command I am giving a block size of 1GB. In my case mmcblk0 partition size was nearly 30GB. So the above command worked for me. If you are experiencing problem, then play with the numbers. For example you could try decreasing the 'bs' value and increase the 'count' value. Ultimately 'bs' multiplied by count should be the partition size. If everything goes fine, you will have a mmcblk0.img in your sdcard. One more point to note. <STORAGE-ID> in the command is the place holder. The actual ID would be a hexadecimal value. You can get your storage id by doing a 'ls /storage' in root shell. In my case the SDCard was referred as 7368-9BEE.
16)Above step would take some time as it has to create a image of 30G size. Once complete, copy the image from SDcard to your computer.
17) Power off the device and remove the SDcard from device.
18) Insert your friend's SIM card and SDCard.
19) Boot to TWRP recovery.
20) Restore the backup you took in step 2 above.

Thanks
KS


Thanks for the tutorial, I'm doing the file for the moto G5 Cedric.
The Following User Says Thank You to rssxda For This Useful Post: [ View ] Gift rssxda Ad-Free
30th June 2018, 09:53 AM |#8  
arvindgr's Avatar
Senior Member
Flag Tamilan
Thanks Meter: 300
 
More
Quote:
Originally Posted by TheFixItMan

Since no one responded to my request in the Q&A section I'll ask here so sorry for off topic but I know people here will have a rooted moto g5

Since I don't own this device anymore I'm looking for someone to provide the mmcblk0 partition so people with hard bricked device could potentially revive them

If you would like to provide it you will need the following

A moto g5 cedric rooted with twrp installed
A blank micro sd card of at least 32gb
Linux/Ubuntu or a virtual machine running it
Cloud storage & a decent Internet connection

See instructions below
https://forum.xda-developers.com/sho...90&postcount=1

You can pm me the image

I suppose @rssxda, as messaged previously, can help you..
30th June 2018, 06:35 PM |#9  
Junior Member
Flag and Netherlands ...
Thanks Meter: 12
 
More
I have 2 mmcblk0 images:
1) Moto G5S and
2) Moto G5.

My Moto G5 (Cedric): XT1676, model M2675 (3Gb mem + 16Gb storage), NPP25.137-93 (1nov2017), reteu, android 7.0
download link: https://www.androidfilehost.com/?fid...83647474830935
MD5 of 7z-file: fc8617eb3957e2b4df16400f722f8095
MD5 of img-file (after unzip): 90efa172d7881f7268bb58708f3d9935

My Moto G5S (Montana): XT1794, model 2996, (3Gb + 32Gb), NPPS26.102-49-8 (1apr2018), reteu, android 7.1.1
download link https://www.androidfilehost.com/?fid...83647474830875
MD5 of 7z-file: dd10315797b78c359a2887b149cc8f44
MD5 of img-file (after unzip): ffeca74973f0b38b0996e13cde667c38

Have fun with it!
1st July 2018, 09:33 PM |#10  
Member
Thanks Meter: 6
 
More
Quote:
Originally Posted by hanshu43

I have 2 mmcblk0 images:
1) Moto G5S and
2) Moto G5.

My Moto G5 (Cedric): XT1676, model M2675 (3Gb mem + 16Gb storage), NPP25.137-93 (1nov2017), reteu, android 7.0
download link: https://www.androidfilehost.com/?fid...83647474830935
MD5 of 7z-file: fc8617eb3957e2b4df16400f722f8095
MD5 of img-file (after unzip): 90efa172d7881f7268bb58708f3d9935

My Moto G5S (Montana): XT1794, model 2996, (3Gb + 32Gb), NPPS26.102-49-8 (1apr2018), reteu, android 7.1.1
download link https://www.androidfilehost.com/?fid...83647474830875
MD5 of 7z-file: dd10315797b78c359a2887b149cc8f44
MD5 of img-file (after unzip): ffeca74973f0b38b0996e13cde667c38

Have fun with it!


-friend I have a Motorola g5 xt1670 (2GB ram and 32 storage) sera compatible ?
-Tengo otro dispositivo y la hora de extraer el mmcblk0 pesa 30 000 000 000 y no me enciende ademas mi
mmcblk0 su tamaƱo de bloques es igual al de usted uso el mismo comando ?
2nd July 2018, 04:13 PM |#11  
Member
Thanks Meter: 6
 
More
Quote:
Originally Posted by hanshu43

I just used adb in a dos-cmd-prompt under windows 10. As steps 10 until 15 are executed inside 'adb shell' and use nothing of the underlying OS (only on the phone itself).

Furtheron, i had to use a exFAT formatted SD-card, as FAT32 maxfile size is 4Gb and the mmcblk0.img file will be (a lot) bigger.
And i had to use a 64Gb SD-card as my mmcblk0.img seems to be bigger as yours (and the SD-card hosts some files in the android-folder, onces the phone was booted).

My mmcblk0 was listed in 'cat /proc/partitions' sized at 30.535.680 (blocks of 1024 bytes).
I used dd command:
dd if=/dev/block/mmcblk0 of=/storage/<SDcard-ID>/mmcblk0.img bs=1048576 count=29820
matching the exact size of mmcblk0

Once i uploaded the image file, i will put the download link in a post in the unbrick thread. With specs of my phone and versions.


Thank you very much excellent tutorial, my block is equal to yours.
-What method do I burn the image to your sdcard?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes