[DEV Discussion]Moto X variants *partition dumps* - Moto X General

I don't know how many of us have access to multiple Moto X devices let alone have physical access to more then one vendor release. It seems that all moto x devices are physically identical apart from any custom decorations done by Motorola (the made in the US ones) and the model identifier on the back bottom "Model: XT1056" (as mine shows) they even lack carrier markings on the phone like most have.
But there are differences between the Models and that's what this thread is being made to investigate. I've noticed both from examining the open source releases on github and poking around the memory that there is a lot of sprint-specific modifications including what appears to be set aside partitioning for sprint's... well, er... ****. We don't really know exactly what kind of operation sprint has going on where they need their own partition but it's likely related their funky LTE implementation (remember they were late-adopters since they placed their chips on wimax initially and had cut some corners to deploy LTE on a wide enough scale to compete with carriers that had been building their LTE infrastructure for a year or two at least. There is even a system app completely devoted to this). I've pretty much figured out all the sprint specific system apps and their purposes but I'll post that later since the selfish ulterier motive of the thread is to get partition tables and partition dumps from other models so I can start comparing them and figuring out where the UICC lock implementation really is. People going for VZ/AT&T bootloader unlock solutions may benefit from using these dumps similarly.
Here is the partition table for the XT1056 (bootloader unlocked although that shouldn't make any difference in the partition table)
Model: MMC 016G92 (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 105MB 105MB ext4 modem
2 105MB 107MB 1536kB sbl1
3 107MB 108MB 1536kB sbl2
4 108MB 109MB 526kB sbl3
5 110MB 111MB 524kB aboot
6 112MB 112MB 145kB rpm
7 112MB 112MB 215kB tz
8 113MB 113MB 524kB utags
9 113MB 114MB 1049kB logs
10 114MB 117MB 3150kB padA
11 117MB 119MB 1536kB sbl2Backup
12 119MB 121MB 2097kB sbl3Backup
13 121MB 123MB 1536kB abootBackup
14 123MB 123MB 512kB rpmBackup
15 123MB 124MB 512kB tzBackup
16 124MB 124MB 524kB utagsBackup
17 124MB 126MB 1671kB padB
18 126MB 129MB 3146kB modemst1
19 129MB 132MB 3146kB modemst2
20 132MB 134MB 2097kB mbl
21 134MB 135MB 655kB hob
22 135MB 135MB 8192B dhob
23 135MB 143MB 8389kB ext4 persist
24 143MB 143MB 8192B ssd
25 143MB 147MB 3146kB ext2 fsg
26 147MB 148MB 1049kB sp
27 148MB 148MB 524kB misc
28 148MB 151MB 3146kB ext3 pds
29 151MB 151MB 131kB cid
30 151MB 156MB 4194kB logo
31 156MB 160MB 4194kB clogo
32 160MB 161MB 1049kB devtree
33 161MB 171MB 10.5MB boot
34 171MB 182MB 10.5MB recovery
35 182MB 190MB 8389kB kpan
36 190MB 1257MB 1067MB ext4 cache
37 1257MB 1258MB 1049kB padC
38 1258MB 2869MB 1611MB ext4 system
39 2869MB 2982MB 113MB customize
40 2982MB 15.7GB 12.8GB userdata
I'll provide dumps of any of these partitions on request, I am requesting partition tables from any other models and some speicific partition dumps from other models and any 1056 that hass been UICC unlocked by sprint. cid, tz, misc, utags, persist, kpan, mbl, any of the little odd partitions.
Notes- misc partition is all zeros on mine,
cid partition includes some binary data and some phone-speicific identifiers like the serial number. Most of these partitions I request don't appear to be written to during rsd flashes or most zip flashes so all theinformation contained in these should be preserved between flashes, that is why I am interested in them and why these partitions are the difference between the models.
I will reserve the next post because I'll include some more of the model specific info like the sprint specific system apps and descriptions as i promised, later.

Reserved for thread ****.

Which command I need to use to get partition table?

Al936 said:
Which command I need to use to get partition table?
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=2450045

I have written a small utility to hopefully assist in the analysis of this information. It is based on the same idea as the cat command in POSIX, but with the added benefit of allowing you to effectively 'cast' the file as a collection of chars, 8-bit ints, unsigned 8-bit ints, 16-bit ints, unsigned 16-bit ints, 32-bit ints, unsigned 32-bit ints, 64-bit ints or unsigned 64-bit ints and print to the console. I wrote it because I want to modify the factory 4.4 update files to inject root.
I have attached the .cpp file to this post (simply rename it from "catAll.c" to "catAll.cpp"). It can be compiled with mingw using the following command: g++ catAll.cpp -o catall
I hope this is helpful!

Using the catAll utility I wrote, I have performed the following dumps of gpt.bin and motoboot.bin from the factory 4.4 firmware for the T-Mobile variant (XT1053):
>char
>8-bit signed integer
>8-bit unsigned integer
>16-bit signed integer
>16-bit unsigned integer
>32-bit signed integer
>32-bit unsigned integer
>64-bit signed integer
>64-bit unsigned integer
I will also post the dump of factory 4.2.2's gpt.bin for the XT1053 shortly. I would like to compare them to understand why the phone "detects" trying to downgrade the firmware when flashing from factory 4.4 to factory 4.2.2

The model numbers indicate unique hardware variants - XT1053, ZT1058, XT1060 etc all have different *radio* hardware internally.

I have an XT1049 from hybrid Wi-Fi/cell MVNO Republic Wireless. My phone is not rooted so I can't push parted onto the system and get a partition table readout like the one you have posted.
I do have the out put of 'ls -al /dev/block/platform/msm_sdcc.1/by-name' and 'cat /proc/partitions' which may provide useful information. Here are chunks of these two files (in the order I have listed them above):
lrwxrwxrwx root root 2014-03-14 15:32 aboot -> /dev/block/mmcblk0p5
lrwxrwxrwx root root 2014-03-14 15:32 abootBackup -> /dev/block/mmcblk0p13
lrwxrwxrwx root root 2014-03-14 15:32 boot -> /dev/block/mmcblk0p33
lrwxrwxrwx root root 2014-03-14 15:32 cache -> /dev/block/mmcblk0p36
lrwxrwxrwx root root 2014-03-14 15:32 cid -> /dev/block/mmcblk0p29
...
and
major minor #blocks name
7 0 3150 loop0
7 1 17703 loop1
179 0 15388672 mmcblk0
179 1 102400 mmcblk0p1
179 2 1500 mmcblk0p2
179 3 1500 mmcblk0p3
179 4 514 mmcblk0p4
...
Would full listings of these commands be useful to you?

OP, I have an XT1056 as well, currently running 4.4.2. It is the stock ROM with stock recovery. I am preparing to unlock the BL and flash TWRP, but would prefer a copy of the stock recovery image for the purposes of returning to stock for OTA updates in the future. A search lead me to this thread. Can you tell me the proper command to pull the stock recovery, or if it's easier for you, can you pull it and post it?
Thanks in advance!

I'm not the OP but in case he doesn't respond ...
You may find the stock Sprint 4.4.2 ROM here:
http://sbf.droid-developers.org/phone.php?device=0
Scroll down to the listing marked --
"Android 4.4.2
Blur_Version.161.44.32.ghost_sprint.Sprint.en.US"
The link to download it is on the far right side of that line on the page.
The recovery image is in the zip file. No special commands are needed to extract it from the archive. Just do 'unzip ghost_sprint-user-4.2.2-13.9.0Q2.X-116-MX-17-57-1-1-release-keys-cid9.xml.zip' and it will be extracted into a new directory wherever you are in the file hierarchy. So be sure you have write permission there.
If you need help flashing it there are many, many [better] places in these forums to find it.

Brilliant! Thank you very much!
glarepate said:
I'm not the OP but in case he doesn't respond ...
You may find the stock Sprint 4.4.2 ROM here:
http://sbf.droid-developers.org/phone.php?device=0
Scroll down to the listing marked --
"Android 4.4.2
Blur_Version.161.44.32.ghost_sprint.Sprint.en.US"
The link to download it is on the far right side of that line on the page.
The recovery image is in the zip file. No special commands are needed to extract it from the archive. Just do 'unzip ghost_sprint-user-4.2.2-13.9.0Q2.X-116-MX-17-57-1-1-release-keys-cid9.xml.zip' and it will be extracted into a new directory wherever you are in the file hierarchy. So be sure you have write permission there.
If you need help flashing it there are many, many [better] places in these forums to find it.
Click to expand...
Click to collapse

Related

Redmi 2 pro not working / partitions corrupted (phone bricked ?)

Hello everyone,
Instead of hijacking the topic of gkalen i'am going to expose my problem here, is my phone dead ?!
5 days after installing the miui v7 global rom my phone rebooted and got stuck at Mi logo.
Since then i dont have acces to xiaomi recover only to fastboot mode.
I cant use miflash because i kept getting the following error: [00000AFC]86d6ac8f 0.27 FAILED (remote: failed to write partition)
Mi PC suite isnt working either.
Today i managed to access TWRP recovery and as well adb shell, but installaing via recovery is not working as well and I get the following message:
E:Unable to mount '/data'
Same error using adb shell.
So I think the problem is linked to the partitions, let me show you thoses logs:
/dev/block/mmcblk0p24 /cache ext4 rw
/dev/block/mmcblk0p23 /system ext4 rw
/dev/block/mmcblk0p30 /data ext4 rw
/dev/block/mmcblk0p1 /firmware vfat rw
/dev/block/mmcblk0p25 /persist ext4 rw
/dev/block/mmcblk1p1 /external_sd vfat rw
/usb-otg vfat rw
Parted /dev/block/mmcblk0p24
print
Error: /dev/block/mmcblk0p24: unrecognised disk label
Parted /dev/block/mmcblk0p23 => Fine
print
Model: Unknown (unknown)
Disk /dev/block/mmcblk0p23: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 1074MB 1074MB ext4
Parted /dev/block/mmcblk0p30
print
]Error: /dev/block/mmcblk0p30: unrecognised disk label
I'am getting desesperate, anyone knows how to fix partitions issue ?
Actually i could need some help, if someone would be kind enough to run the following command with adb shell:
parted /dev/block/mmcblk0
print
And give me the output, here is mine and I guess i'am missing a few bits...:
Model: MMC HAG2e (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 67.1MB 134MB 67.1MB fat16 modem
2 134MB 135MB 524kB sbl1
3 135MB 135MB 524kB sbl1bak
4 135MB 136MB 1049kB aboot
5 136MB 137MB 1049kB abootbak
6 137MB 138MB 524kB rpm
7 138MB 138MB 524kB rpmbak
8 138MB 139MB 524kB tz
9 139MB 139MB 524kB tzbak
10 139MB 140MB 524kB hyp
11 140MB 141MB 524kB hypbak
12 141MB 142MB 1049kB pad
13 142MB 143MB 1573kB modemst1
14 143MB 145MB 1573kB modemst2
15 145MB 146MB 1049kB misc
16 146MB 146MB 1024B fsc
17 146MB 146MB 8192B ssd
18 146MB 156MB 10.5MB splash
19 201MB 201MB 32.8kB DDR
20 201MB 203MB 1573kB fsg
21 203MB 203MB 16.4kB sec
22 203MB 237MB 33.6MB boot
23 237MB 1310MB 1074MB ext4 system
24 1310MB 1646MB 336MB cache
25 1646MB 1679MB 33.6MB ext4 persist
26 1679MB 1713MB 33.6MB recovery
27 1745MB 1745MB 524kB keystore
28 1745MB 1745MB 32.8kB config
29 1745MB 1812MB 67.1MB oem
30 1879MB 15.8GB 13.9GB userdata
Hi,
were you abel to solve your problem or have you received any reply to it? I also think that my internal SD card is corrupted and to install a new ROM I have to set it up again. I always get the following error messagre if I want to flash it with Mi-flash
"remote: failed to write partition" .
If I check it with fastboot in detail, I miss the partition with the name "partition". This is the first one which is flashed, but I do not have.
My phone is 2014813.
I hope somebody may help me.
Hello,
did any of you ever get this fixed ? Would be nice to hear the solution because I am faced with the same problem unfortunatly....
tia !
Did anyone here fixed this issue? Or is it hardbricked forever?
I never was able to repair it unfortunatly.

How can I Create a byte-for-byte image of my Internal Memory (from Recovery or ADB)

I am looking for a way to create a perfect, byte for byte, image of my internal memory so that I can recover data from the image in a safer way and from a copy where I cant destroy the original. I am really just looking to recover files I had under the /sdcard (USERDATA mount) however, since my partitions are messed up, I want to broaden the scope and capture everything. Can anyone point me in the right direction?
Help is greatly appreciated.
re: byte for byte
waypoint.delta said:
I am looking for a way to create a perfect, byte for byte, image of my internal memory so that I can recover data from the image in a safer way and from a copy where I cant destroy the original. I am really just looking to recover files I had under the /sdcard (USERDATA mount) however, since my partitions are messed up, I want to broaden the scope and capture everything. Can anyone point me in the right direction?
Help is greatly appreciated.
Click to expand...
Click to collapse
You would need to develop or find a developer who knows
how to create a very specific & special application to do that.
At the present time there is no applications that can do it.
You would be way better off to simply copy whatever good
files are in your internal memory to your computer because
any other way would result in many unusable files since
you said that the partition is all messed up.
By creating a byte for byte image of your internal memory
you would simply end up with a lot of unusable files since
your partitions are messed up.
Good luck, have a great day!
Thanks for the response Mr Junky. I can tell you I am fairly determined, short of hopping the NSA fence and demanding justice. Anyways, The partitions only matter so much since they do not define the files, the 1's and 0's do. There's tons of recovery software already, so no need to go that far, just need to get the data off my phone so it can be analysed. Square one is I grabbing a quality snapshot of the Internal Memory and putting it on my PC. At that point I can rebuild my phone without concern.
Misterjunky said:
. . .
Click to expand...
Click to collapse
Does anyone know if the partition/sector offsets ever change, or are they static? I ask because I ran "Repair or Change File System" on /data which shares a mount with /sdcard (i think). If they are static, it wont matter that the partition table was rebuilt, the lost data should still reside there. I can simply use DD to capture /dev/block/sda18 to a file. As a side note, I'm really glad i had busybox installed.
Code:
~ # ←[6n[COLOR="DarkGreen"][B]busybox fdisk -l /dev/block/sda[/B][/COLOR]
Note: sector size is 4096 (not 512)
Found valid GPT with protective MBR; using GPT
Disk /dev/block/sda: 62464000 sectors, 2336M
Logical sector size: 4096
Disk identifier (GUID): 52444e41-494f-2044-4d4d-43204449534b
Partition table holds up to 128 entries
First usable sector is 6, last usable sector is 7807994
Number Start (sector) End (sector) Size Code Name
1 1024 2047 4096K 0700 BOTA0
2 2048 3071 4096K 0700 BOTA1
3 3072 8191 20.0M 0700 EFS
4 8192 10239 8192K 0700 PARAM
5 10240 20479 40.0M 0700 BOOT
6 20480 32255 46.0M 0700 RECOVERY
7 32256 34303 8192K 0700 OTA
8 34304 45055 42.0M 0700 RADIO
9 45056 45311 1024K 0700 TOMBSTONES
10 45312 45567 1024K 0700 DNT
11 45568 45759 768K 0700 PERSISTENT
12 45760 45823 256K 0700 STEADY
13 45824 48127 9216K 0700 PERSDATA
14 48128 1148927 4300M 0700 SYSTEM
15 1148928 1200127 200M 0700 CACHE
16 1200128 1238527 150M 0700 HIDDEN
17 1238528 1239807 5120K 0700 CP_DEBUG
[COLOR="Red"][B] 18 1239808 7806719 25.0G 0700 USERDATA[/B][/COLOR]
~ # ←[6n
C:\adb>
C:\adb>adb shell
/dev/block/platform/155a0000.ufs/by-name # ?[6n[COLOR="darkgreen"][B]ls -l[/B][/COLOR]
__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
lrwxrwxrwx 1 root root 15 Jan 2 12:45 BOOT -> /dev/block/sda5
lrwxrwxrwx 1 root root 15 Jan 2 12:45 BOTA0 -> /dev/block/sda1
lrwxrwxrwx 1 root root 15 Jan 2 12:45 BOTA1 -> /dev/block/sda2
lrwxrwxrwx 1 root root 16 Jan 2 12:45 CACHE -> /dev/block/sda15
lrwxrwxrwx 1 root root 15 Jan 2 12:45 CPEFS -> /dev/block/sdd1
lrwxrwxrwx 1 root root 16 Jan 2 12:45 CP_DEBUG -> /dev/block/sda17
lrwxrwxrwx 1 root root 16 Jan 2 12:45 DNT -> /dev/block/sda10
lrwxrwxrwx 1 root root 15 Jan 2 12:45 EFS -> /dev/block/sda3
lrwxrwxrwx 1 root root 16 Jan 2 12:45 HIDDEN -> /dev/block/sda16
lrwxrwxrwx 1 root root 15 Jan 2 12:45 OTA -> /dev/block/sda7
lrwxrwxrwx 1 root root 15 Jan 2 12:45 PARAM -> /dev/block/sda4
lrwxrwxrwx 1 root root 16 Jan 2 12:45 PERSDATA -> /dev/block/sda13
lrwxrwxrwx 1 root root 16 Jan 2 12:45 PERSISTENT -> /dev/block/sda11
lrwxrwxrwx 1 root root 15 Jan 2 12:45 RADIO -> /dev/block/sda8
lrwxrwxrwx 1 root root 15 Jan 2 12:45 RECOVERY -> /dev/block/sda6
lrwxrwxrwx 1 root root 16 Jan 2 12:45 STEADY -> /dev/block/sda12
lrwxrwxrwx 1 root root 16 Jan 2 12:45 SYSTEM -> /dev/block/sda14
lrwxrwxrwx 1 root root 15 Jan 2 12:45 TOMBSTONES -> /dev/block/sda9
[COLOR="Red"][B]lrwxrwxrwx 1 root root 16 Jan 2 12:45 USERDATA -> /dev/block/sda18[/B][/COLOR]
/dev/block/platform/155a0000.ufs/by-name # ?[6n
I created the dd image of the USERDATA partition and saved it to the external SD card using the following command
Code:
dd if=/dev/block/sda18 of=/external_sd/dev/block/sda18.dd bs=4096
I then ran it against photorec which only returned 2 elf files. I will run it against testdisk as well, but I'm thinking either the data is gone or I did not use DD correctly.
In TWRP, when you go to "Wipe" -> "Advanced Wipe" you see a list of partitions, among them are "Data" and "Internal Storage". I wiped the "Data" partition as I thought "Internal Storage" would be untouched (since it was listed seperatly). Nope. Apparently they map to the exact same partition
Code:
/dev/block/sda18 on /data type ext4 (rw,seclabel,relatime,data=ordered)
/dev/block/sda18 on /sdcard type ext4 (rw,seclabel,relatime,data=ordered)
I used "Change File System" on "Data" in order to make it usable again, I must have destroyed all the data I was trying to recover. Had I build the image before I fixed the data partition, I would probably have recovered most everything.
Thanks go out to Samsung for enabling auto update by default and for thoroughly testing the update which blew up my phone! Great job guys : )
waypoint.delta said:
I am looking for a way to create a perfect, byte for byte, image of my internal memory so that I can recover data from the image in a safer way and from a copy where I cant destroy the original. I am really just looking to recover files I had under the /sdcard (USERDATA mount) however, since my partitions are messed up, I want to broaden the scope and capture everything. Can anyone point me in the right direction?
Help is greatly appreciated.
Click to expand...
Click to collapse
You need to use photorec directly on the block device, not a copy. Copies don't copy detached inodes, even with dd.
Sent from my SM-G935T using Tapatalk
Everything I've read online negates that statement. however, I've yet to recover anything from the images I've copied, but I believe it may be due to hardware error. As a test, I put an photo on my /system mount and deleted the image. then I cloned the system block device and attempted recovery using photorec. this test failed to recover the file. so either DD is not copying the raw bytes or I am doing something incorrectly. I will try the same test using scalpel and also on another android phone.
toastido said:
You need to use photorec directly on the block device, not a copy. Copies don't copy detached inodes, even with dd.
Sent from my SM-G935T using Tapatalk
Click to expand...
Click to collapse

Partition problems, no ERI, Unknown IMEI, no USB

I was attempting to troubleshoot another phone I had and it was suggested somewhere on here that I back up my efs partition and gave directions to use the command "reboot nvbackup". Well the result was not good. I've searched the forums for over a week and have decided to finally post as I'm out of ideas.
I followed radionerd's thread here and was able to get the Baseband back but I still do not have anything in "Hardware Version", and show "0" in PRL version, "None" in ERI version, "Unknown" in IMEI. The kicker is that somehow my USB no longer works when connecting to the PC. The cord works fine with other phones and it charges this phone but gives a "USB device is not recognized" error when connecting, under device manager it shows up as "Device Descriptor Request Failed".
I have been able to flash back to a stock ROM using TWRP (RUEOF1 is what I've been flashing) but that hasn't helped at all. I've attempted to copy mmcblk1 from the sd but it always fails, both from TWRP file manager and from the ES File Explorer. I'm guessing if I was able to flash a new PIT file I'd be good but I have no idea how to do that without having USB support. I do have working WIFI and SD card access, along with a good operating system.
I've tried a lot of stuff over the past week so I apologize if I haven't already mentioned it but I'm looking for help to see if anyone has an idea about what can be done.
Thanks!
If you unlocked your bootloader using the "standard method" then the "debrick" image you created on the SD card has a backup of literally every partition EXCEPT the ones that you would normally flash with Odin (or a ROM, e.g. boot, system, userdata, cache etc).
The reason that that unlocking method created a debrick image is so that people could save it so they would have it for emergencies. Such as the one you created.
Even the PIT data is included in a hidden partition inside the debrick image. But having a PIT file only allows you to re-partition flash memory, which you don't need; it's partitioned already. Re-writing the PIT is not going to magically recreate data inside those partitions that you erased.
Here's the bottom line: factory images, just like ROM files have NEVER had 100% of the partitions needed to restore the phone back to working condition. So there's darn good reasons to have backups or avoid wiping all of memory.
I think that @hsbadr had posted some debrick images taken during older ROM releases (N* series, I think) on his AFH (androidfilehost.com) site. Whether or not substituting some subset of those partitions (e.g. efs, persist, etc) onto your device will work correctly or not, but it's certainly worth a try at this point.
Skills you need to learn: figuring out byte offsets from the GPT partition table at the beginning of the debrick file to get the partition offsets in the "debrick" blob, and "dd" command options for grabbing exactly the byte ranges you want out of a single large blob file containing many partitions. (e.g. "skip=", "bs=", "count=").
Note also that the Unix GPT partitioning tools "gdisk" will let you examine the Primary GPT (UEFI?) partition table in the debrick image even though the secondary GPT is not present. That way, you can figure out the exact length and initial offset of partitions that you want to copy out of the debrick image into your device. (The reason for the missing secondary GPT is that the GPT/UEFI partition table indicates the presence of very large partitions such as /system, /cache, and /userdata, and the secondary GPT is always near the very end of the disk. Because the "debrick" image is literally a byte-for-byte copy of only the first 256 MB of the mmcblk0 flash device, there is no secondary GPT some 32GB "later" then the beginning of the debrick image.
red indicates partitions in debrick not appearing in Odin factory Images
Code:
$ gdisk /tmp/mj7-debrick-unlocked.img
Command (? for help): p
Disk /tmp/mj7-debrick-unlocked.img: 524288 sectors, 256.0 MiB
Logical sector size: 512 bytes
Disk identifier (GUID): NNNNNNNN-NNNN-NNNN-NNNN-NNNNNNNNNNNN
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 61071326
Partitions will be aligned on 2-sector boundaries
Total free space is 8158 sectors (4.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 8192 38911 15.0 MiB 8300 apnhlos
2 38912 156543 57.4 MiB 0700 modem
3 156544 157567 512.0 KiB FFFF sbl1
4 157568 157631 32.0 KiB FFFF dbi
5 157632 157695 32.0 KiB FFFF ddr
6 157696 161791 2.0 MiB FFFF aboot
7 161792 162815 512.0 KiB FFFF rpm
8 162816 163839 512.0 KiB FFFF tz
[color=red] 9 163840 184319 10.0 MiB FFFF pad
10 184320 204799 10.0 MiB 8300 param
11 204800 233471 14.0 MiB 8300 efs
12 233472 239615 3.0 MiB FFFF modemst1
13 239616 245759 3.0 MiB FFFF modemst2[/color]
14 245760 268287 11.0 MiB FFFF boot
15 268288 294911 13.0 MiB FFFF recovery
[color=red] 16 294912 321535 13.0 MiB FFFF fota
17 321536 335853 7.0 MiB 8300 backup
18 335854 341997 3.0 MiB FFFF fsg
19 341998 341999 1024 bytes FFFF fsc
20 342000 342015 8.0 KiB FFFF ssd
21 342016 358399 8.0 MiB 8300 persist
22 358400 376831 9.0 MiB 8300 persdata [/color]
--------- debrick image ends ~72 MB into the start of the system partition --------
23 376832 5931007 2.6 GiB 8300 system
24 5931008 8028159 1024.0 MiB 8300 cache
25 8028160 61071326 25.3 GiB 8300 userdata
I would start by restoring as few partitions are necessary e.g. "efs" and "persist" before I would bother with the others.
Example using data given above. (You should check your own work.)
efs partition: blocks 204800 to 233471 in debrick image, blocks are 512 bytes.
check length:
(233471-204800+1)*512 = 14680064
14680064 / (1024 * 1024) = 14 O.K.
so:
# dd if=/sdcard/debrick.img bs=512 skip=204800 count=28672 of=/dev/block/platform/msm_sdcc.1/by-name/efs
(or get clever and faster)
# dd if=/sdcard/debrick.img bs=1048576 skip=100 count=14 of=/dev/block/platform/msm_sdcc.1/by-name/efs
You should be pretty sure what you are doing with byte offset calculations with the "dd" command. Fortunately you are relying on the partitioning already present on the output side of things, so the worst that you could do is write misaligned garbage to a partition. So long as you don't do something incredibly stupid like overwrite a bootloader partition you should be OK.
cheers
Thanks for the reply, I forgot to subscribe so I just saw the post.
I have been able to copy all of the partitions from another phone but it hasn't helped. I'm now wondering if I'm missing a hidden partition.

How to install a new rom with bootloader loocked?

Hello I have a machine Redmi2 that does not boot, only boots with fastboot when I pressed the power off button ans Vol - button
I can execute fastboot commands.
For example:
fastboot devices
Click to expand...
Click to collapse
967354587d12 fastboot
Click to expand...
Click to collapse
fastboot oem device-info
Click to expand...
Click to collapse
...
(bootloader) Device tampered: false
(bootloader) Device unlocked: false
(bootloader) Charger screen enabled: false
(bootloader) Display panel:
OKAY [ 0.004s]
finished. total time: 0.004s
Click to expand...
Click to collapse
I could dowloaded various rom (official from xiaomi and not official like aosp-caf_wt88047_64-21-05-2017-eng.pirej.zip or xiaomi-miui-hellas-5.1_wt88047_V8_XTRVbeta2_7.2.24.zip) but I can install a new system in this machine.
First I try to unlock the bootloader with official method from Xiaomi but the result is error.
Now I try to boot with twrp and this is works.
To boot with twrp I cam execute this with fastboot
fastboot flash recovery twrp_arm64_3.1.1.img
Click to expand...
Click to collapse
target reported max download size of 268435456 bytes
sending 'recovery' (11426 KB)...
OKAY [ 0.360s]
writing 'recovery'...
OKAY [ 0.184s]
finished. total time: 0.544s
Click to expand...
Click to collapse
fastboot flash boot twrp_arm64_3.1.1.img
Click to expand...
Click to collapse
target reported max download size of 268435456 bytes
sending 'boot' (11426 KB)...
OKAY [ 0.361s]
writing 'boot'...
OKAY [ 0.132s]
finished. total time: 0.493s
Click to expand...
Click to collapse
And with this comand boots the machine with twrp
fastboot boot twrp_arm64_3.1.1.img
Click to expand...
Click to collapse
When machine boots I have access to external card from my PC and I can put the rom to try to install.
When try to clean the partitions I can not do it:
This is the errors
Error al desmontar '/system' (invalid argument)
Error al desmontar '/data' (invalid argument)
Error al desmontar '/cache' (invalid argument)
Incapaz de montar almacenamiento
Click to expand...
Click to collapse
When I try to install RR-N-v5.8.3-20170516-wt88047-OFFICIAL.zip for example I can not install this rom.
Do you know if it is possible install a rom with bootloader locked?
Doy you know if it is possible unlocked the bootloader if xiaomi unlocker does not works?
Any ideas to install a rom in this machine?
Best regards.
i heard that redmi2 has unlocked bootloader and you are using twrp arm64 ? try official twrp and install rom ?
AKHILR4J said:
i heard that redmi2 has unlocked bootloader and you are using twrp arm64 ? try official twrp and install rom ?
Click to expand...
Click to collapse
Thanks for your help,
I have downloaded the lastest twrp img from redmi 2, and I have the same problems.
Machine boots with twrp but I can not write in the internal partitions and I can not install a rom.
I think that I need unlock the bootloader to can to modify the android partitions but I do not know to do it.
try this one
when in twrp, open mount, give check to system, but uncheck "mount system partition read-only"
then try flash the custom rom
when tried "fastboot oem device-info" to my redmi 2 it also show "(bootloader) Device unlocked: false"
yet i can install just now, LineageOS
Liquid2 said:
try this one
when in twrp, open mount, give check to system, but uncheck "mount system partition read-only"
then try flash the custom rom
when tried "fastboot oem device-info" to my redmi 2 it also show "(bootloader) Device unlocked: false"
yet i can install just now, LineageOS
Click to expand...
Click to collapse
Hello, thanks for your help, but when I open Mount, only I can check Firmware, Persist, Micro SDCard and I can check Mount system partition read only.
I can not check System, Data, Cache and when I select Storage (Internal Storage (0MB).
I can use TWRP becuase I execute fastboot boot twrp-3.1.1-0-wt88047.img, ¿it is possible open twrp with any parameters?
Regards, Julio.
Hello again, I have tried to mount /system with a terminal in TWRP with this command
Code:
# Montamos la carpeta /system como lectura(r) y escritura(w)
mount -o remount,rw /system
but the problem is my /proc/mounts file
Code:
rootfs / rootfs rw,seclabel 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,size=967420k,nr_inodes=153983,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
proc /proc proc rw,relatime,gid=3009,hidepid=2 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
tmpfs /tmp tmpfs rw,seclabel,relatime,size=967420k,nr_inodes=153983 0 0
pstore /sys/fs/pstore pstore rw,seclabel,relatime 0 0
adb /dev/usb-ffs/adb functionfs rw,relatime 0 0
/dev/block/mmcblk0p25 /persist ext4 rw,seclabel,nosuid,nodev,noatime,data=ordered 0 0
/dev/block/mmcblk1p1 /external_sd vfat rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/block/mmcblk0p1 /firmware vfat rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
Do you know how can I can change this file to include the /system partition to mount read/write and I can install a rom os.
Regards,
jriosa said:
Hello, thanks for your help, but when I open Mount, only I can check Firmware, Persist, Micro SDCard and I can check Mount system partition read only.
I can not check System, Data, Cache and when I select Storage (Internal Storage (0MB).
I can use TWRP becuase I execute fastboot boot twrp-3.1.1-0-wt88047.img, ¿it is possible open twrp with any parameters?
Regards, Julio.
Click to expand...
Click to collapse
have u tried another twrp?? make sure it for your device
Liquid2 said:
have u tried another twrp?? make sure it for your device
Click to expand...
Click to collapse
Thanks for your help, I have tried different versions from twrp with the same result.
Regards, Julio.
sori, cant help much, maybe
i myself in very newbie
how about if you flash fresh with flashboot rom using miflash, see if it can boot into official miui first
then you can try install twrp again and flash custom rom
have you tried twrp
Hello Now I access to android with adb.
When I boot the android with TWRP, I can access with my PC using adb.
I execute this.
adb root
Click to expand...
Click to collapse
adb shell
Click to expand...
Click to collapse
This is the partitions on my machine
~ # cat /proc/partitions
major minor #blocks name
179 0 15392768 mmcblk0
179 1 65536 mmcblk0p1
179 2 512 mmcblk0p2
179 3 512 mmcblk0p3
179 4 1024 mmcblk0p4
179 5 1024 mmcblk0p5
179 6 512 mmcblk0p6
179 7 512 mmcblk0p7
179 8 512 mmcblk0p8
179 9 512 mmcblk0p9
179 10 512 mmcblk0p10
179 11 512 mmcblk0p11
179 12 1024 mmcblk0p12
179 13 1536 mmcblk0p13
179 14 1536 mmcblk0p14
179 15 1024 mmcblk0p15
179 16 1 mmcblk0p16
179 17 8 mmcblk0p17
179 18 10240 mmcblk0p18
179 19 32 mmcblk0p19
179 20 1536 mmcblk0p20
179 21 16 mmcblk0p21
179 22 32768 mmcblk0p22
179 23 1048576 mmcblk0p23
179 24 327680 mmcblk0p24
179 25 32768 mmcblk0p25
179 26 32768 mmcblk0p26
179 27 512 mmcblk0p27
179 28 32 mmcblk0p28
179 29 65536 mmcblk0p29
179 30 13557743 mmcblk0p30
179 32 4096 mmcblk0rpmb
179 64 30375936 mmcblk1
179 65 30371840 mmcblk1p1
Click to expand...
Click to collapse
~ # cd /dev
/dev # find -inme mmcblk0
find: unrecognized: -inme
Segmentation fault
/dev # find -iname mmcblk0
./block/mmcblk0
./block/platform/soc.0/7824900.sdhci/mmcblk0
Click to expand...
Click to collapse
I have added parted to managed partitions in my machine
To see parttions in my disk
~ # /sbin/parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Click to expand...
Click to collapse
Model: MMC HAG2e (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 67.1MB 134MB 67.1MB fat16 modem
2 134MB 135MB 524kB sbl1
3 135MB 135MB 524kB sbl1bak
4 135MB 136MB 1049kB aboot
5 136MB 137MB 1049kB abootbak
6 137MB 138MB 524kB rpm
7 138MB 138MB 524kB rpmbak
8 138MB 139MB 524kB tz
9 139MB 139MB 524kB tzbak
10 139MB 140MB 524kB hyp
11 140MB 141MB 524kB hypbak
12 141MB 142MB 1049kB pad
13 142MB 143MB 1573kB modemst1
14 143MB 145MB 1573kB modemst2
15 145MB 146MB 1049kB misc
16 146MB 146MB 1024B fsc
17 146MB 146MB 8192B ssd
18 146MB 156MB 10.5MB splash
19 201MB 201MB 32.8kB DDR
20 201MB 203MB 1573kB fsg
21 203MB 203MB 16.4kB sec
22 203MB 237MB 33.6MB boot
23 237MB 1310MB 1074MB system
24 1310MB 1646MB 336MB cache
25 1646MB 1679MB 33.6MB ext4 persist
26 1679MB 1713MB 33.6MB recovery
27 1745MB 1745MB 524kB keystore
28 1745MB 1745MB 32.8kB config
29 1745MB 1812MB 67.1MB oem
30 1879MB 15.8GB 13.9GB userdata
Click to expand...
Click to collapse
To see my partitions
~ # df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 944.7M 156.0K 944.6M 0% /dev
tmpfs 944.7M 32.0K 944.7M 0% /tmp
/dev/block/mmcblk1p1 29.0G 13.4G 15.6G 46% /external_sd
Click to expand...
Click to collapse
I think that I can not install a new rom (offcial or unofficial) because the system I can not access to partitions /system for example and I think that system partitions is mmcblk0p23.
Do you know how I can modify my partitions to see in df -h and launch a new rom with twrp?
Thanks a lot,
Hello again, I download parted soft to try to create the partitions
I execute parted and I try to delete the partitions.
For example:
I execute
parted /dev/block/mmcblk0
I think that this is my internal sd
(parted) p
p
Model: MMC HAG2e (sd/mmc)
Disk /dev/block/mmcblk0: 15032MiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 64.0MiB 128MiB 64.0MiB fat16 modem
2 128MiB 128MiB 0.50MiB sbl1
3 129MiB 129MiB 0.50MiB sbl1bak
4 129MiB 130MiB 1.00MiB aboot
5 130MiB 131MiB 1.00MiB abootbak
6 131MiB 131MiB 0.50MiB rpm
7 132MiB 132MiB 0.50MiB rpmbak
8 132MiB 132MiB 0.50MiB tz
9 133MiB 133MiB 0.50MiB tzbak
10 133MiB 133MiB 0.50MiB hyp
11 134MiB 134MiB 0.50MiB hypbak
12 134MiB 135MiB 1.00MiB pad
13 135MiB 136MiB 1.50MiB modemst1
14 137MiB 138MiB 1.50MiB modemst2
15 138MiB 139MiB 1.00MiB misc
16 139MiB 139MiB 0.00MiB fsc
17 139MiB 139MiB 0.01MiB ssd
18 139MiB 149MiB 10.0MiB splash
19 192MiB 192MiB 0.03MiB DDR
20 192MiB 194MiB 1.50MiB fsg
21 194MiB 194MiB 0.02MiB sec
22 194MiB 226MiB 32.0MiB boot
23 226MiB 1250MiB 1024MiB system
24 1250MiB 1570MiB 320MiB cache
25 1570MiB 1602MiB 32.0MiB ext4 persist
26 1602MiB 1634MiB 32.0MiB recovery
27 1664MiB 1664MiB 0.50MiB keystore
28 1665MiB 1665MiB 0.03MiB config
29 1665MiB 1729MiB 64.0MiB oem
30 1792MiB 15032MiB 13240MiB userdata
Click to expand...
Click to collapse
I execute rm 30 to try to delete the last partition (userdata)
but when I see the partitions with command p, rm does not delete the partition and I can nor create it again.
Do you know how can I delete the partitions?
Best regards.
Hello again, I download parted soft to try to create the partitions
I execute parted and I try to delete the partitions.
For example:
I execute
parted /dev/block/mmcblk0
I think that this is my internal sd
(parted) p
p
Model: MMC HAG2e (sd/mmc)
Disk /dev/block/mmcblk0: 15032MiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 64.0MiB 128MiB 64.0MiB fat16 modem
2 128MiB 128MiB 0.50MiB sbl1
3 129MiB 129MiB 0.50MiB sbl1bak
4 129MiB 130MiB 1.00MiB aboot
5 130MiB 131MiB 1.00MiB abootbak
6 131MiB 131MiB 0.50MiB rpm
7 132MiB 132MiB 0.50MiB rpmbak
8 132MiB 132MiB 0.50MiB tz
9 133MiB 133MiB 0.50MiB tzbak
10 133MiB 133MiB 0.50MiB hyp
11 134MiB 134MiB 0.50MiB hypbak
12 134MiB 135MiB 1.00MiB pad
13 135MiB 136MiB 1.50MiB modemst1
14 137MiB 138MiB 1.50MiB modemst2
15 138MiB 139MiB 1.00MiB misc
16 139MiB 139MiB 0.00MiB fsc
17 139MiB 139MiB 0.01MiB ssd
18 139MiB 149MiB 10.0MiB splash
19 192MiB 192MiB 0.03MiB DDR
20 192MiB 194MiB 1.50MiB fsg
21 194MiB 194MiB 0.02MiB sec
22 194MiB 226MiB 32.0MiB boot
23 226MiB 1250MiB 1024MiB system
24 1250MiB 1570MiB 320MiB cache
25 1570MiB 1602MiB 32.0MiB ext4 persist
26 1602MiB 1634MiB 32.0MiB recovery
27 1664MiB 1664MiB 0.50MiB keystore
28 1665MiB 1665MiB 0.03MiB config
29 1665MiB 1729MiB 64.0MiB oem
30 1792MiB 15032MiB 13240MiB userdata
Click to expand...
Click to collapse
I execute rm 30 to try to delete the last partition (userdata)
but when I see the partitions with command p, rm does not delete the partition and I can nor create it again.
Do you know how can I delete the partitions?
Best regards.
jriosa said:
Hello again, I download parted soft to try to create the partitions
I execute parted and I try to delete the partitions.
For example:
I execute
parted /dev/block/mmcblk0
I think that this is my internal sd
I execute rm 30 to try to delete the last partition (userdata)
but when I see the partitions with command p, rm does not delete the partition and I can nor create it again.
Do you know how can I delete the partitions?
Best regards.
Click to expand...
Click to collapse
Have you unmounted the data partition in twrp before executing the rm command?
SidOfficial said:
Have you unmounted the data partition in twrp before executing the rm command?
Click to expand...
Click to collapse
This is my commands and my point mounts are
~ # df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 944.7M 156.0K 944.6M 0% /dev
tmpfs 944.7M 28.0K 944.7M 0% /tmp
/dev/block/mmcblk1p1 29.0G 14.9G 14.0G 52% /external_sd
Click to expand...
Click to collapse
I see a new error
~ # parted /dev/block/mmcblk0p30
Error: Could not stat device /dev/block/mmcblk0p30 - No such file or directory.
Retry/Cancel? C
C
Click to expand...
Click to collapse
maybe the first partition I think is OK
~ # parted /dev/block/mmcblk0p1
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0p1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
p
Model: Unknown (unknown)
Disk /dev/block/mmcblk0p1: 67.1MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 67.1MB 67.1MB fat16
Click to expand...
Click to collapse
adb shell
~ # cp /external_sd/parted /sbin/parted
~ # chmod +x /sbin/parted
~ # df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 944.7M 156.0K 944.6M 0% /dev
tmpfs 944.7M 28.0K 944.7M 0% /tmp
/dev/block/mmcblk1p1 29.0G 14.9G 14.0G 52% /external_sd
~ # parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit MiB
unit MiB
(parted) p
p
Model: MMC HAG2e (sd/mmc)
Disk /dev/block/mmcblk0: 15032MiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 64.0MiB 128MiB 64.0MiB fat16 modem
2 128MiB 128MiB 0.50MiB sbl1
3 129MiB 129MiB 0.50MiB sbl1bak
4 129MiB 130MiB 1.00MiB aboot
5 130MiB 131MiB 1.00MiB abootbak
6 131MiB 131MiB 0.50MiB rpm
7 132MiB 132MiB 0.50MiB rpmbak
8 132MiB 132MiB 0.50MiB tz
9 133MiB 133MiB 0.50MiB tzbak
10 133MiB 133MiB 0.50MiB hyp
11 134MiB 134MiB 0.50MiB hypbak
12 134MiB 135MiB 1.00MiB pad
13 135MiB 136MiB 1.50MiB modemst1
14 137MiB 138MiB 1.50MiB modemst2
15 138MiB 139MiB 1.00MiB misc
16 139MiB 139MiB 0.00MiB fsc
17 139MiB 139MiB 0.01MiB ssd
18 139MiB 149MiB 10.0MiB splash
19 192MiB 192MiB 0.03MiB DDR
20 192MiB 194MiB 1.50MiB fsg
21 194MiB 194MiB 0.02MiB sec
22 194MiB 226MiB 32.0MiB boot
23 226MiB 1250MiB 1024MiB system
24 1250MiB 1570MiB 320MiB cache
25 1570MiB 1602MiB 32.0MiB ext4 persist
26 1602MiB 1634MiB 32.0MiB recovery
27 1664MiB 1664MiB 0.50MiB keystore
28 1665MiB 1665MiB 0.03MiB config
29 1665MiB 1729MiB 64.0MiB oem
30 1792MiB 15032MiB 13240MiB userdata
(parted) rm 30
rm 30
(parted) p
p
Model: MMC HAG2e (sd/mmc)
Disk /dev/block/mmcblk0: 15032MiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 64.0MiB 128MiB 64.0MiB fat16 modem
2 128MiB 128MiB 0.50MiB sbl1
3 129MiB 129MiB 0.50MiB sbl1bak
4 129MiB 130MiB 1.00MiB aboot
5 130MiB 131MiB 1.00MiB abootbak
6 131MiB 131MiB 0.50MiB rpm
7 132MiB 132MiB 0.50MiB rpmbak
8 132MiB 132MiB 0.50MiB tz
9 133MiB 133MiB 0.50MiB tzbak
10 133MiB 133MiB 0.50MiB hyp
11 134MiB 134MiB 0.50MiB hypbak
12 134MiB 135MiB 1.00MiB pad
13 135MiB 136MiB 1.50MiB modemst1
14 137MiB 138MiB 1.50MiB modemst2
15 138MiB 139MiB 1.00MiB misc
16 139MiB 139MiB 0.00MiB fsc
17 139MiB 139MiB 0.01MiB ssd
18 139MiB 149MiB 10.0MiB splash
19 192MiB 192MiB 0.03MiB DDR
20 192MiB 194MiB 1.50MiB fsg
21 194MiB 194MiB 0.02MiB sec
22 194MiB 226MiB 32.0MiB boot
23 226MiB 1250MiB 1024MiB system
24 1250MiB 1570MiB 320MiB cache
25 1570MiB 1602MiB 32.0MiB ext4 persist
26 1602MiB 1634MiB 32.0MiB recovery
27 1664MiB 1664MiB 0.50MiB keystore
28 1665MiB 1665MiB 0.03MiB config
29 1665MiB 1729MiB 64.0MiB oem
30 1792MiB 15032MiB 13240MiB userdata
(parted) q
q
Information: You may need to update /etc/fstab.
~ # parted /dev/block/mmcblk0p30
Error: Could not stat device /dev/block/mmcblk0p30 - No such file or directory.
Retry/Cancel? C
C
~ # parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
p
Model: MMC HAG2e (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 67.1MB 134MB 67.1MB fat16 modem
2 134MB 135MB 524kB sbl1
3 135MB 135MB 524kB sbl1bak
4 135MB 136MB 1049kB aboot
5 136MB 137MB 1049kB abootbak
6 137MB 138MB 524kB rpm
7 138MB 138MB 524kB rpmbak
8 138MB 139MB 524kB tz
9 139MB 139MB 524kB tzbak
10 139MB 140MB 524kB hyp
11 140MB 141MB 524kB hypbak
12 141MB 142MB 1049kB pad
13 142MB 143MB 1573kB modemst1
14 143MB 145MB 1573kB modemst2
15 145MB 146MB 1049kB misc
16 146MB 146MB 1024B fsc
17 146MB 146MB 8192B ssd
18 146MB 156MB 10.5MB splash
19 201MB 201MB 32.8kB DDR
20 201MB 203MB 1573kB fsg
21 203MB 203MB 16.4kB sec
22 203MB 237MB 33.6MB boot
23 237MB 1310MB 1074MB system
24 1310MB 1646MB 336MB cache
25 1646MB 1679MB 33.6MB ext4 persist
26 1679MB 1713MB 33.6MB recovery
27 1745MB 1745MB 524kB keystore
28 1745MB 1745MB 32.8kB config
29 1745MB 1812MB 67.1MB oem
30 1879MB 15.8GB 13.9GB userdata
(parted)
Click to expand...
Click to collapse
Do you know Iif it is possible to clean all disk and I can recreate /system, /cache, /persist, /firmware and /data partitions?
jriosa said:
This is my commands and my point mounts are
I see a new error
maybe the first partition I think is OK
Do you know Iif it is possible to clean all disk and I can recreate /system, /cache, /persist, /firmware and /data partitions?
Click to expand...
Click to collapse
Yes, you can recreate all the partitions and can even resize the system and data partitions. Head over to this link https://forum.xda-developers.com/redmi-2/how-to/wt88047-redmi-2-resize-partition-t3612933

Install original firmware

Hi. I had lineage os installed on my phone. Now i want to restore it to original. I can flash original firmware from there https://developers.google.com/android/images#occam without any error. The problem is during boot. It boot endless. I wait couple hours without any effect. I installed twrp and check partitions but it looks ok
Bash:
~ # ./parted /dev/block/mmcblk0 p
Model: MMC 016G92 (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 524kB 67.6MB 67.1MB fat16 modem
2 67.6MB 68.2MB 524kB sbl1
3 68.2MB 68.7MB 524kB sbl2
4 68.7MB 70.8MB 2097kB sbl3
5 70.8MB 71.3MB 524kB tz
6 71.3MB 94.4MB 23.1MB boot
7 94.4MB 117MB 23.1MB recovery
8 117MB 118MB 799kB m9kefs1
9 118MB 119MB 799kB m9kefs2
10 119MB 120MB 799kB m9kefs3
11 120MB 121MB 524kB rpm
12 121MB 121MB 524kB aboot
13 121MB 122MB 524kB sbl2b
14 122MB 124MB 2097kB sbl3b
15 124MB 124MB 524kB abootb
16 124MB 125MB 524kB rpmb
17 125MB 125MB 524kB tzb
18 125MB 126MB 524kB metadata
19 126MB 143MB 16.8MB misc
20 143MB 159MB 16.8MB ext4 persist
21 159MB 1040MB 881MB ext4 system
22 1040MB 1627MB 587MB ext4 cache
23 1627MB 7817MB 6190MB ext4 userdata
24 7817MB 7818MB 524kB DDR
25 7818MB 7818MB 507kB grow
Do you have any idea what is wrong?
skoczo said:
Hi. I had lineage os installed on my phone. Now i want to restore it to original. I can flash original firmware from there https://developers.google.com/android/images#occam without any error. The problem is during boot. It boot endless. I wait couple hours without any effect. I installed twrp and check partitions but it looks ok
Bash:
~ # ./parted /dev/block/mmcblk0 p
Model: MMC 016G92 (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 524kB 67.6MB 67.1MB fat16 modem
2 67.6MB 68.2MB 524kB sbl1
3 68.2MB 68.7MB 524kB sbl2
4 68.7MB 70.8MB 2097kB sbl3
5 70.8MB 71.3MB 524kB tz
6 71.3MB 94.4MB 23.1MB boot
7 94.4MB 117MB 23.1MB recovery
8 117MB 118MB 799kB m9kefs1
9 118MB 119MB 799kB m9kefs2
10 119MB 120MB 799kB m9kefs3
11 120MB 121MB 524kB rpm
12 121MB 121MB 524kB aboot
13 121MB 122MB 524kB sbl2b
14 122MB 124MB 2097kB sbl3b
15 124MB 124MB 524kB abootb
16 124MB 125MB 524kB rpmb
17 125MB 125MB 524kB tzb
18 125MB 126MB 524kB metadata
19 126MB 143MB 16.8MB misc
20 143MB 159MB 16.8MB ext4 persist
21 159MB 1040MB 881MB ext4 system
22 1040MB 1627MB 587MB ext4 cache
23 1627MB 7817MB 6190MB ext4 userdata
24 7817MB 7818MB 524kB DDR
25 7818MB 7818MB 507kB grow
Do you have any idea what is wrong?
Click to expand...
Click to collapse
If your stock firmware installed correctly you shouldn't have root any longer. How did you install TWRP? How did you install your firmware? flash-all.bat?
Tulsadiver said:
If your stock firmware installed correctly you shouldn't have root any longer. How did you install TWRP? How did you install your firmware? flash-all.bat?
Click to expand...
Click to collapse
So when i figure out that stock rom don't want to boot i installed twrp from command line by
Code:
sudo fastboot flash recovery twrp-3.5.0_9-0-mako.img
to check partitions.
I installed stock rom by executing
Code:
sudo ./flash-all.sh
I see that i have 16G version but from partitions it looks like 8G version. Can it be a problem? How to restore partitions to original?
Your firmware should take care of everything. Did you edit the flash-all.sh? Take off the -w?
I've never used sudo before when flashing mine.
Tulsadiver said:
Your firmware should take care of everything. Did you edit the flash-all.sh? Take off the -w?
I've never used sudo before when flashing mine.
Click to expand...
Click to collapse
No i didn't edit files from google. Sudo is needed for fastboot execution on my system(manjaro). Then this command is run with higher privileges.
skoczo said:
No i didn't edit files from google. Sudo is needed for fastboot execution on my system(manjaro). Then this command is run with higher privileges.
Click to expand...
Click to collapse
Have you tried a factory reset from within TWRP?
It's been a while since I've had a working TWRP.
Tulsadiver said:
Have you tried a factory reset from within TWRP?
It's been a while since I've had a working TWRP.
Click to expand...
Click to collapse
Tulsadiver said:
Have you tried a factory reset from within TWRP?
It's been a while since I've had a working TWRP.
Click to expand...
Click to collapse
I have some progress. I run stock firmware but with some additional steps. This is what i did:
- install stock rom
- install clockwork or twrp
- boot to clockwork
- start `adb shell`
- execute `mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p23` in shell
But if i flash it again i need to do this procedure again. I don't understand why. I can't also do factory reset in twrp because it shows that can't mount some partitions.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I can do factory reset after calling `mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p23` in adb shell
I started stock android and did some configuration. It looks that system is working. Now as a test i flash stock firmware again and i have boot loop again. Probably i need do the procedure one again. Do you have any idea why? And how to fix this? i see that cache also can't be mounted after flash stock rom so i did `mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p22` and now it can be mounted. But why i need to do this? Why stock rom is not working? And this happen each time when i flash stock rom.
There is also such thing that if i don't execute `mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p2` after flashing lineage os is showing screen that device is encrypted. Then i need to login do adb shell and execute mke2fs. This is wired that i need to do this every time when i flash device.
skoczo said:
I see that i have 16G version but from partitions it looks like 8G version. Can it be a problem? How to restore partitions to original?
Click to expand...
Click to collapse
You can find the Solution here:
[TUTORIAL]How to unbrick your N4
How to unbrick your N4 I'm not responsible for anything that happens with your device! I accidently flashed a S4 ROM. After I noticed that, I tried to flash a factory image, but it booted for a very long time and WiFi, signal and other radio...
forum.xda-developers.com
Akhilesh S V said:
You can find the Solution here:
[TUTORIAL]How to unbrick your N4
How to unbrick your N4 I'm not responsible for anything that happens with your device! I accidently flashed a S4 ROM. After I noticed that, I tried to flash a factory image, but it booted for a very long time and WiFi, signal and other radio...
forum.xda-developers.com
Click to expand...
Click to collapse
I solve my problem by following this instruction https://forums.androidcentral.com/n...3923-guide-nexus-4-factory-image-restore.html
I think that key was those commands:
- fastboot erase boot
- fastboot erase cache
- fastboot erase recovery
- fastboot erase system
- fastboot erase userdata
- fastboot oem lock
- fastboot oem unlock

Categories

Resources