[Guide] Resize partition in daisly to install large system images (like miui, one UI) - Xiaomi Mi A2 Lite Guides, News, & Discussion

It is possible to brick your device or future problems caused by this guide
Need flash patched boot image to use parted
1. Download Parted
2.Paste in inside Adb root
3. Boot Twrp
4. Execute in fastboot and adb:
Code:
adb push parted /sbin/parted
adb shell
su (linux users)
cd /sbin && chmod 777 parted
5.
Code:
parted /dev/block/mmcblk0
(start parted)
Parted tutorial
uses "print" and copy results to make backup
Use "help" for list all commands
print - show all partition statuts
Rm (number of partiton) - delete partition
mkpart - create partiton
Code:
[SIZE="4"]exemple:[/SIZE]
mkpart
[FONT="Comic Sans MS"]Partition name?
[/FONT]system_a
[FONT="Comic Sans MS"]File system type?
[/FONT] ext4
[FONT="Comic Sans MS"]Start?
[/FONT] 930
[FONT="Comic Sans MS"]End?
[/FONT]4030
Now we need to name the partitions so the bootloader can find them
name 56
Name?
system_a
​
type "i" or "ignore" to any messages parted gives you which are warnings and not errors, do NOT type yes if it talks about sectors being moved.
in my case:
Code:
print...
....
56 738MB 3423MB 2684MB ext2 system_a
57 3423MB 6107MB 2684MB ext2 system_b
58 6107MB 6912MB 805MB ext2 vendor_a
59 6912MB 7718MB 805MB ext2 vendor_b
60 7718MB 31.3GB 23.6GB ext4 userdata
Deleted 56 to 60 ,and recrate system to 3.1 Gb, keeping vendor intact, and recrate userdata with what remained
Pos resize:
56 738MB 4239MB 3501MB ext2 system_a msftdata
57 4239MB 7740MB 3500MB ext2 system_b
58 7740MB 8546MB 806MB ext2 vendor_a msftdata
59 8546MB 9352MB 806MB ext2 vendor_b
60 9352MB 31.2GB 21.9GB ext4 userdata msftdata
Soon tutorial in images and more detailed (no time this week)...
Font: http://lunarixus.party/oxygenosguide/part1.html​

If i face with a problem or bootloop, flashing stock rom via mi flash will fix everything?

Kineceleran said:
If i face with a problem or bootloop, flashing stock rom via mi flash will fix everything?
Click to expand...
Click to collapse
nop, only to flash large system images like Miui,one ui ....
Do not touch in partitions it if you do not know

this is not proper method.......after this we have to name the partition..without doing this the phone will brick 100%.
........

Related

CLOSE, please

All important information/ links will be moved to an INFO thread, since this is a question thread, we do not need it anymore.
Still looking.
Bump, can anyone help?
Saw this page:
forum.xda-developers .com/showthread.php?t=1959445
Was wondering if it's worth a shot.
Kernel released by Huawei.
For kernel/Rom Developers, Huawei has released the kernel for the Huawei Prism II online.
Attached is a notepad document with the links in them, since I am not allowed to post links. I apologize for the inconvenience.
ALSO
For anyone else with a Huawei device that has not released their kernel, I used the email format below:
Emal 1:
I would like the source code for my phone that is available to me. I am an android developer, and it would be useful to me if I have the
source code(that is offerred by Huawei).
The reply you will get:
Dear Customer,
Thank you for contacting Huawei device. The open source is under our technical department to make. Since the procedure is a little more complex, so please kindly be a little patient. We will keep you informed once available.Once again thank you for contacting Huawei device.
Best Regards.
Huawei Device Customer Care Team.
Give them 2-3 days, then E-mail once again! Be persistent!
2nd email:
Any new information about the source code?
The reply I got:
Dear Customer,
Thank you for contacting Huawei device. Please kindly check the source code link for your reference:
(link given above)
Once again thank you for contacting Huawei device.
Best Regards.
Huawei Device Customer Care Team.
Parted/FDisk Output on /dev/block/mmcblk0
streetdev22 said:
Bump, can anyone help?
Saw this page:
forum.xda-developers .com/showthread.php?t=1959445
Was wondering if it's worth a shot.
Click to expand...
Click to collapse
Tried the guide on my Prism II. Parted gave me an error. Possible reason for parted error is explained here: http://forum.xda-developers.com/showthread.php?t=2169709.
However, fdisk worked, but it doesn't clearly identify the partitons:
Edited to include gdisk output
parted:
Code:
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) print
print
print
Error: Unable to satisfy all constraints on the partition.
fdisk:
Code:
[email protected]:/ # fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 3909 MB, 3909091328 bytes
1 heads, 16 sectors/track, 477184 cylinders
Units = cylinders of 16 * 512 = 8192 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 1 3 20 4d Unknown
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 3 41 300 45 Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 41 16681 133120 c Win95 FAT32 (LBA)
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 16681 477184 3684031+ 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 16897 18432 12288 6a Unknown
/dev/block/mmcblk0p6 18433 18944 4096 46 Unknown
/dev/block/mmcblk0p7 18945 19456 4096 63 GNU HURD or SysV
/dev/block/mmcblk0p8 19457 19840 3072 58 Unknown
/dev/block/mmcblk0p9 19969 20352 3072 4a Unknown
/dev/block/mmcblk0p10 20481 20864 3072 4b Unknown
/dev/block/mmcblk0p11 20993 21504 4096 47 Unknown
/dev/block/mmcblk0p12 21505 22528 8192 48 Unknown
/dev/block/mmcblk0p13 22529 25088 20480 60 Unknown
/dev/block/mmcblk0p14 25089 25600 4096 6c Unknown
/dev/block/mmcblk0p15 25601 50176 196608 83 Linux
/dev/block/mmcblk0p16 50177 60416 81920 83 Linux
/dev/block/mmcblk0p17 60417 191488 1048576 83 Linux
/dev/block/mmcblk0p18 191489 338944 1179648 83 Linux
/dev/block/mmcblk0p19 338945 477184 1105920 6b Unknown
gdisk:
Code:
[email protected]:/ # gdisk -l /dev/block/mmcblk0
gdisk -l /dev/block/mmcblk0
GPT fdisk (gdisk) version 0.8.4
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format.
***************************************************************
Exact type match not found for type code 4D00; assigning type code for
'Linux filesystem'
Exact type match not found for type code 4500; assigning type code for
'Linux filesystem'
Exact type match not found for type code 6A00; assigning type code for
'Linux filesystem'
Exact type match not found for type code 4600; assigning type code for
'Linux filesystem'
Exact type match not found for type code 6300; assigning type code for
'Linux filesystem'
Exact type match not found for type code 5800; assigning type code for
'Linux filesystem'
Exact type match not found for type code 4A00; assigning type code for
'Linux filesystem'
Exact type match not found for type code 4B00; assigning type code for
'Linux filesystem'
Exact type match not found for type code 4700; assigning type code for
'Linux filesystem'
Exact type match not found for type code 4800; assigning type code for
'Linux filesystem'
Exact type match not found for type code 6000; assigning type code for
'Linux filesystem'
Exact type match not found for type code 6C00; assigning type code for
'Linux filesystem'
Exact type match not found for type code 6B00; assigning type code for
'Linux filesystem'
Warning! Main partition table overlaps the first partition by 33 blocks!
You will need to delete this partition or resize it in another utility.
Warning! Secondary partition table overlaps the last partition by
33 blocks!
You will need to delete this partition or resize it in another utility.
Disk /dev/block/mmcblk0: 7634944 sectors, 3.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): E271C8D6-2001-435D-A466-BEFE7ED158CD
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 7634910
Partitions will be aligned on 1-sector boundaries
Total free space is 9599 sectors (4.7 MiB)
Number Start (sector) End (sector) Size Code Name
1 1 40 20.0 KiB 8300 Linux filesystem
2 41 640 300.0 KiB 8300 Linux filesystem
3 641 266880 130.0 MiB 0700 Microsoft basic data
5 270336 294911 12.0 MiB 8300 Linux filesystem
6 294912 303103 4.0 MiB 8300 Linux filesystem
7 303104 311295 4.0 MiB 8300 Linux filesystem
8 311296 317439 3.0 MiB 8300 Linux filesystem
9 319488 325631 3.0 MiB 8300 Linux filesystem
10 327680 333823 3.0 MiB 8300 Linux filesystem
11 335872 344063 4.0 MiB 8300 Linux filesystem
12 344064 360447 8.0 MiB 8300 Linux filesystem
13 360448 401407 20.0 MiB 8300 Linux filesystem
14 401408 409599 4.0 MiB 8300 Linux filesystem
15 409600 802815 192.0 MiB 8300 Linux filesystem
16 802816 966655 80.0 MiB 8300 Linux filesystem
17 966656 3063807 1024.0 MiB 8300 Linux filesystem
18 3063808 5423103 1.1 GiB 8300 Linux filesystem
19 5423104 7634943 1.1 GiB 8300 Linux filesystem
[email protected]:/ #
Partition Layout
streetdev22 said:
Recently rooted and unlocked the bootloader on my Huawei Prism II, but there is no custom recovery nor custom roms for this phone. I have tried determing the partition layout in order to dump the recovery, but I am unable to do so.
Tried earlier versions of romdump, but they returned with a segmentation failure.
Click to expand...
Click to collapse
I believe I've found the partition layout based on the /etc/recovery_mmc.fstab extracted from mmcblk0p13, but am not sure. The excerpt of my /etc/recovery_mmc.fstab file from mmcblk0p13 shows some partition names correlated to device names. Could someone verify this is a legitimate way to determine the partition layout? I've also attached the whole recovery_mmc.fstab file.
recovery_mmc.fstab excerpt:
Code:
/boot emmc /dev/block/mmcblk0p12
/cache ext4 /dev/block/mmcblk0p15
# /* < DTS2012062603367 lizhigang 20120626 begin */
/data ext4 /dev/block/mmcblk0p18 length=-16384
#/* < DTS2012062603367 lizhigang 20120626 end */
/recovery emmc /dev/block/mmcblk0p13
/misc emmc /dev/block/mmcblk0p7
/sdcard vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1
/system ext4 /dev/block/mmcblk0p17
/sys_boot vfat /dev/block/mmcblk0p3
/fat vfat /dev/block/mmcblk0p3
/HWUserData vfat /dev/block/mmcblk0p19
#/*< DTS2012020804291 weizhonghui 20120208 begin */
/cust ext4 /dev/block/mmcblk0p16
#/* DTS2012020804291 weizhonghui 20120208 end >*/
#/* DTS2012011906026 chendeng 20120120 end > */
# /* DTS2012031506621 lishubin 20120321 end > */
Easier to read (joined fdisk and the recovery_mmc.fstab)
Code:
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 * 1 3 20 4d Unknown /sdcard
/dev/block/mmcblk0p2 3 41 300 45 Unknown
/dev/block/mmcblk0p3 41 16681 133120 c Win95 FAT32 (LBA) /sys_boot and /fat
/dev/block/mmcblk0p4 16681 477184 3684031+ 5 Extended
/dev/block/mmcblk0p5 16897 18432 12288 6a Unknown
/dev/block/mmcblk0p6 18433 18944 4096 46 Unknown
/dev/block/mmcblk0p7 18945 19456 4096 63 GNU HURD or SysV /misc
/dev/block/mmcblk0p8 19457 19840 3072 58 Unknown
/dev/block/mmcblk0p9 19969 20352 3072 4a Unknown
/dev/block/mmcblk0p10 20481 20864 3072 4b Unknown
/dev/block/mmcblk0p11 20993 21504 4096 47 Unknown
/dev/block/mmcblk0p12 21505 22528 8192 48 Unknown /boot
/dev/block/mmcblk0p13 22529 25088 20480 60 Unknown /recovery
/dev/block/mmcblk0p14 25089 25600 4096 6c Unknown
/dev/block/mmcblk0p15 25601 50176 196608 83 Linux /cache
/dev/block/mmcblk0p16 50177 60416 81920 83 Linux /cust
/dev/block/mmcblk0p17 60417 191488 1048576 83 Linux /system
/dev/block/mmcblk0p18 191489 338944 1179648 83 Linux /data
/dev/block/mmcblk0p19 338945 477184 1105920 6b Unknown /HWUserData
Very nice!
Correlates with the hints found in other files as seen above, so I think we have successfully found the partition layout! I will take a look when my device gets here(originally was working on my relative's phone, but now I purchased it for myself). If this method is confirmed,we can to port CWM, thank you all!! After CWM, we should be able to make custom ROMs freely.
streetdev22 said:
Correlates with the hints found in other files as seen above, so I think we have successfully found the partition layout! I will take a look when my device gets here(originally was working on my relative's phone, but now I purchased it for myself). If this method is confirmed,we can to port CWM, thank you all!! After CWM, we should be able to make custom ROMs freely.
Click to expand...
Click to collapse
Great. I'm glad that someone can verify part of the partition layout. Hopefully, this means that the new information is credible too.
Prism 2 said:
Great. I'm glad that someone can verify part of the partition layout. Hopefully, this means that the new information is credible too.
Click to expand...
Click to collapse
How exactly did you extract the file? Did you extract it from mmcblk0p13? Have the device on hand, so I am trying to verify the findings.
Thanks.
Unpacking Recovery Image
streetdev22 said:
How exactly did you extract the file? Did you extract it from mmcblk0p13? Have the device on hand, so I am trying to verify the findings.
Thanks.
Click to expand...
Click to collapse
First, I made a selective backup using a google store app called Online Nandroid Backup https://play.google.com/store/apps/details?id=com.h3r3t1c.onnandbup&hl=en to make a backup on the "recovery" partition. Even though the app does not specify which block it copies, I believe the app makes a backup of /dev/block/mmcblk0p13 because it uses /system/partlayout4nandroid to determine the partition layout. If you look at the "cat /system/partlayout4nandroid" output below, you'll see that mmcblk0p13 corresponds to recovery.
Then I transferred the recovery.img from the sdcard to my computer.
From there, I followed the directions in Step 1 and Step 2 of http://www.imajeenyus.com/computer/20130301_android_tablet/android/unpack_repack_recovery_image.html to unpack and extract recovery.img.
Online Nandroid Backup Partition Layout:
Code:
[email protected]:/ # cat /system/partlayout4nandroid
cat /system/partlayout4nandroid
dev: size erasesize name
mmcblk0p1: 010000 000000 "modem"
mmcblk0p2: 000008 000000 "ssd"
mmcblk0p3: 000080 000000 "sbl1"
mmcblk0p4: 000100 000000 "sbl2"
mmcblk0p5: 000200 000000 "sbl3"
mmcblk0p6: 000200 000000 "aboot"
mmcblk0p7: 000200 000000 "rpm"
mmcblk0p8: 000200 000000 "tz"
mmcblk0p9: 002800 000000 "pad"
mmcblk0p10: 000c00 000000 "fsg"
mmcblk0p11: 002000 000000 "persist"
mmcblk0p12: 002800 000000 "boot"
[B]mmcblk0p13: 002800 000000 "recovery"[/B]
mmcblk0p14: 0b8000 000000 "system"
mmcblk0p15: 0d0000 000000 "cache"
mmcblk0p16: 000c00 000000 "modemst1"
mmcblk0p17: 000c00 000000 "modemst2"
mmcblk0p18: 040000 000000 "tombstones"
mmcblk0p19: 000400 000000 "misc"
mmcblk0p20: 001000 000000 "logo"
mmcblk0p21: 001000 000000 "logo2"
mmcblk0p22: 54c000 000000 "userdata"
mmcblk0p23: 00ffef 000000 "grow"
[email protected]:/ #
Probably correct.
My father(the owner of the phone) has once again left on a trip, so I will have to wait until Monday/Tuesday, when I receive my phone, to confirm these results.
My only issue with this is is why nandroid shows a different partition layout then what is shown in other files.
If partition 13 is recovery, there is no coincidence that you would find that fstab file in the extracted recovery.
Do you mind dumping all the extracted files from the recovery and uploading them to 4shared, mediafire, or any other cloud service as a compressed file(zip, tar)? I think the file is not coincidental, and that we have indeed found the partition layout(or at least the important partitions for our purposes).
Also, try dumping the boot partition that is currently identified (block 12) without using online nandroid backup(I think via dd should still work) and see if you can find similar files to that explained in the guide(.png, ramdisk directory, etc). If these files match up to what would be typically found in a boot.img or recovery.img, then the layout is most likely correct.
If these files match up to typical boot.img or recovery.img files, we can test the layout by changing something simple like a background before working on serious stuff.
Also, thanks for helping! Once we conclusively identify that this partition layout is correct, we can start to port clockworkmod.
streetdev22 said:
My father(the owner of the phone) has once again left on a trip, so I will have to wait until Monday/Tuesday, when I receive my phone, to confirm these results.
My only issue with this is is why nandroid shows a different partition layout then what is shown in other files.
If partition 13 is recovery, there is no coincidence that you would find that fstab file in the extracted recovery.
Do you mind dumping all the extracted files from the recovery and uploading them to 4shared, mediafire, or any other cloud service as a compressed file(zip, tar)? I think the file is not coincidental, and that we have indeed found the partition layout(or at least the important partitions for our purposes).
Also, try dumping the boot partition that is currently identified (block 12) without using online nandroid backup(I think via dd should still work) and see if you can find similar files to that explained in the guide(.png, ramdisk directory, etc). If these files match up to what would be typically found in a boot.img or recovery.img, then the layout is most likely correct.
If these files match up to typical boot.img or recovery.img files, we can test the layout by changing something simple like a background before working on serious stuff.
Also, thanks for helping! Once we conclusively identify that this partition layout is correct, we can start to port clockworkmod.
Click to expand...
Click to collapse
The extracted files in partition 13 can be found in post #44 of http://forum.xda-developers.com/showthread.php?t=2546455&page=5 labeled as "ramdisk.tar.bz2". I will make a dump of the boot partition using dd and run the tests tomorrow.
Looks validated, Also more tools
There are other guides on the matter of porting cyanogenmod..for example
http://wiki.cyanogenmod.org/w/Doc:_porting_intro
which even mentions a recovery.fstab file in recovery.img! So, that means the partition layout in the fstab file you found is most likely correct.
Another guide:
http://xda-university.com/as-a-developer/porting-clockworkmod-recovery-to-a-new-device
Also, there is an automated tool to porting cyanogenmod for new devices..
http://builder.clockworkmod.com/ (I would recommend avoiding the touch recovery for now, simple is all we need and we don't need more complications)
I am really feeling pretty confident about the partition layout found in the recovery.fstab, because one guide mentions it to be found in the recovery.img!
I would recommend making the changes to a recovery.img instead, because boot.img is still kinda scary (possible bricking )
Also, I think there is a command to try booting from a recovery.img without flashing the .img to the actual partition.
I think the command is mentioned here: http://forum.xda-developers.com/showthread.php?t=2233477
fastboot boot recovery.img is the command and it will not overwrite your existing recovery.
By using this command, you can try booting the stock recovery you extracted(to validate that we have a stock recovery available if we need it), and then boot the recovery.img you make with small edits, and then boot the recovery.img made from the automated CWM porter.
Thank you for replying so fast! We have made real progress in the last few days.
Edit:In the ramdisk that was extracted, another fstab exists on the root of the directory that is named fstab.msm7627, which is the same name from the file I located in post 1! They are the same file! I think this is validated.
Testing Recovery Partition
streetdev22 said:
I would recommend making the changes to a recovery.img instead, because boot.img is still kinda scary (possible bricking )
Also, I think there is a command to try booting from a recovery.img without flashing the .img to the actual partition.
I think the command is mentioned here: http://forum.xda-developers.com/showthread.php?t=2233477
fastboot boot recovery.img is the command and it will not overwrite your existing recovery.
By using this command, you can try booting the stock recovery you extracted(to validate that we have a stock recovery available if we need it), and then boot the recovery.img you make with small edits, and then boot the recovery.img made from the automated CWM porter.
Click to expand...
Click to collapse
I've made
a regular recovery.img using "dd if=/dev/block/mmcblk0p13 of=/sdcard/recovery.img" to make a copy of the recovery partition
a test recovery.img that is the same in every way to the original recovery.img except that all the images under /res/images is rotated 90 degrees. You can see the difference yourself by looking in res.rar attached below.
a clockworkmod recovery image from the clockworkmod recovery builder website
These images can be found attached below:
recovery.rar = original Huawei recovery image
recovery-test.rar = edited recovery image
recovery.img = clockworkmod recovery automatic builder image from http://jenkins.cyanogenmod.com/job/recovery/52069/
Unfortunately, I cannot test this image myself, because I do not want to unlock my bootloader yet.
If anyone with a rooted, unlocked Huawei Prism 2 is interested in helping to further the development of recovery roms for the Prism 2, I have made 3 tests to see if
the recovery partition is located in /dev/block/mmcblk0p13
the command "fastboot boot recovery.img", which we will be using extensively, can be used to boot the specified image file
the Clockworkmod Recovery image made from automated CWM porter successfully boots
The files you will need are provided below. I've also given instructions to the best of my ability without actually having done this.
To test if the recovery partition is located in /dev/block/mmcblk0p13:
Go into fastboot mode (step 2f in post #1 of http://forum.xda-developers.com/showthread.php?t=2546455)
Download the recovery.rar file below and extract it to get recovery.img.
Open up terminal
change directory to where you extracted recovery.img
type
Code:
fastboot boot recovery.img
See if phone boot into recovery
Next we test an edited recovery.img to see if "fastboot boot recovery.img" is truly letting us boot the image we've specified.
To find out, we're going to use the edited recovery.img and do pretty much the same thing except now with recovery-test.img:
Go into fastboot mode (step 2f in post #1 of http://forum.xda-developers.com/showthread.php?t=2546455)
Download the recovery-test.rar file below and extract it to get recovery-test.img.
Open up terminal
change directory to where you extracted recovery-test.img
type
Code:
fastboot boot recovery-test.img
See if any pictures are upside down (the battery symbol, numbers, or the android robot)
After completing the 2 tasks above, and verifying that we have a valid original recovery.img and that we can use
Code:
fastboot boot recovery.img
to boot a specific image file, we can start testing a very, very, very EXPERIMENTAL Clockworkmod Recovery image using fastboot. I would not rely on this image to make backups and I honestly do not know what kind of damage it might inflict on the phone so make a backup of everything before starting.
output from CWM automatic recovery builder: http://jenkins.cyanogenmod.com/job/recovery/52069/
To test if this CWM recovery image will boot and have the right partition layout:
Go into fastboot mode (step 2f in post #1 of http://forum.xda-developers.com/showthread.php?t=2546455)
Download the recovery.img.
Open up terminal
change directory to where you downloaded recovery.img
type
Code:
fastboot boot recovery.img
If the cwm recovery image boots, type
Code:
mount
See if /sdcard is mounted to the right partition)
If you're feeling lucky, make a backup to /sdcard **this step can cause damage to phone if /sdcard is mounted to the wrong partition**
Thanks for volunteering and bringing the Huawei Prism 2 one step closer to custom roms.
Will test as soon as I get the phone.
I should be getting my phone in the mail Tuesday-Wednesday, but I will test as soon as I get it in the mail and I get my bootloader unlocked. I shouldn't have an issue booting it, since it will boot without effecting my current recovery partition. Hopefully the cwm recovery boots as well.
streetdev22 said:
I should be getting my phone in the mail Tuesday-Wednesday, but I will test as soon as I get it in the mail and I get my bootloader unlocked. I shouldn't have an issue booting it, since it will boot without effecting my current recovery partition. Hopefully the cwm recovery boots as well.
Click to expand...
Click to collapse
Great! I really hope it works. Let me know if I can help with anything in the meantime.
Getting my phone today
My phone is coming today! I will let you know the results either later today or tomorrow. Also, could you pull a build.prop using ADB from your phone? This guy needs it: http://forum.xda-developers.com/showthread.php?p=49494728
niceeeee
Prism 2 said:
Great! I really hope it works. Let me know if I can help with anything in the meantime.
Click to expand...
Click to collapse
I tried them today and they work fine siiiiir. both booted while i was stuck in a boot loop from deleting my settins apk
Cjantolak said:
I tried them today and they work fine siiiiir. both booted while i was stuck in a boot loop from deleting my settins apk
Click to expand...
Click to collapse
Thats good news! Could you state specifically which 2 of the 3 images booted though? I'm assuming the original (recovery.rar file) and the edited (recovery-test.rar file) recovery.images, but want to make sure
In other words, did you test the clockworkmod recovery image?
first two
Prism 2 said:
Thats good news! Could you state specifically which 2 of the 3 images booted though? I'm assuming the original (recovery.rar file) and the edited (recovery-test.rar file) recovery.images, but want to make sure
In other words, did you test the clockworkmod recovery image?
Click to expand...
Click to collapse
I did just boot the clockworkmod recovery and i just booted up fine. os is running as it should other than the whole missing settings app. im stuck without root, without wifi, and usb debugging.
adb not installing the app either so idk.
Thanks for straightening out the confusion. Can you check the mounted partitions are correct? Afterwards you can use update.zip to install your settings.apk
---------- Post added at 01:11 AM ---------- Previous post was at 01:04 AM ----------
Never mind about checking the partition layout. I just remembered you don't have adb. I will try to make a better recovery image.

Can't mount storage on sony xperia L. Hard brick Xperia L during repartition.

here is what i did in my sony xperia L and now i anything that can help kindly let me know
I rooted my device and then i officially unlocked my bootloader but after unlocking bootloader the phone was stuck in bootlooop so i installed stock recovery in the phone using flashtool and phone was just fine then. I did all this in order to change the partition of my phone.
Now i installed cwm recovery and after that phone i did the following commands
Open a command window: CMD, then get into shell:
adb shell
Once in shell, type:
umount /storage
parted /dev/block/mmcblk0
print
This prints out the partition information of your phone's memory chip
You will see the partition numbers in the first column, partition names in the last one,
in between you have the start/end memory index and the partition size
------start---end---size
...
31---1795---3506---1711---userdata
32---3506---7818---4312---sdcard
In the above output, consider the values indicated in italic as not to be changed !
Now calculate (open a spreadsheed if you like) the new value for the end of the userdata partition,
and use the same value for the start of the sdcard partition
On your sheet it should look something like this if you added 2048 to the userdata size
------start---end---size
31---1795---5554---3759---userdata
32---5554---7818---2264---sdcard
Remove userdata and sdcard partitions:
rm 31
rm 32
Create the new userdata and sdcard partitions:
mkpartfs logical ext2 1795 5554
name 31 userdata
mkpartfs logical fat32 5554 7818
name 32 sdcard
Exit parted to go to the adb shell again:
quit
userdata partition (31) needs to have ext4 file system
The following will do the ext2->ext4 conversion:
cd /storage/sdcard1/fs-utils
tune2fs -j /dev/block/mmcblk0p31
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p31
e2fsck -fpDC0 /dev/block/mmcblk0p31
Now when i restart my phone or even open the phone in cwm recovery it says cannot mount storage.
I tried installing the Rom again using flashtool it does not work and device gets disconnected probably coz now i am not able to mount my storage.
I tried to start adb shell and revert the changes i made in the above command in order to bring phone back to normal but now adb says no device is found.
I went to the customer service centre of sony they said they will change the motherboard.
Now my question is there any way i can fix my phone kindly tell me. I will really appreciate it Since i am not a software developer so i do not know any commands. Is there any way i can change my storage settings so they can be mounted again kindly let me know.
py.puneet said:
here is what i did in my sony xperia L and now i anything that can help kindly let me know
I rooted my device and then i officially unlocked my bootloader but after unlocking bootloader the phone was stuck in bootlooop so i installed stock recovery in the phone using flashtool and phone was just fine then. I did all this in order to change the partition of my phone.
Now i installed cwm recovery and after that phone i did the following commands
Open a command window: CMD, then get into shell:
adb shell
Once in shell, type:
umount /storage
parted /dev/block/mmcblk0
print
This prints out the partition information of your phone's memory chip
You will see the partition numbers in the first column, partition names in the last one,
in between you have the start/end memory index and the partition size
------start---end---size
...
31---1795---3506---1711---userdata
32---3506---7818---4312---sdcard
In the above output, consider the values indicated in italic as not to be changed !
Now calculate (open a spreadsheed if you like) the new value for the end of the userdata partition,
and use the same value for the start of the sdcard partition
On your sheet it should look something like this if you added 2048 to the userdata size
------start---end---size
31---1795---5554---3759---userdata
32---5554---7818---2264---sdcard
Remove userdata and sdcard partitions:
rm 31
rm 32
Create the new userdata and sdcard partitions:
mkpartfs logical ext2 1795 5554
name 31 userdata
mkpartfs logical fat32 5554 7818
name 32 sdcard
Exit parted to go to the adb shell again:
quit
userdata partition (31) needs to have ext4 file system
The following will do the ext2->ext4 conversion:
cd /storage/sdcard1/fs-utils
tune2fs -j /dev/block/mmcblk0p31
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p31
e2fsck -fpDC0 /dev/block/mmcblk0p31
Now when i restart my phone or even open the phone in cwm recovery it says cannot mount storage.
I tried installing the Rom again using flashtool it does not work and device gets disconnected probably coz now i am not able to mount my storage.
I tried to start adb shell and revert the changes i made in the above command in order to bring phone back to normal but now adb says no device is found.
I went to the customer service centre of sony they said they will change the motherboard.
Now my question is there any way i can fix my phone kindly tell me. I will really appreciate it Since i am not a software developer so i do not know any commands. Is there any way i can change my storage settings so they can be mounted again kindly let me know.
Click to expand...
Click to collapse
Just a question here, why did you want to change the partition of your phone?_? And no there isnt a way to revert thats a hard brick
Changing the motherboard will be the quickest method for Sony, which will not cause any trouble for them. You could ask the price for doing a low level format and restoring the partitions etc. Though I don't if they can do this in this case.

Nexus 5 32GB shows only 12.55GB. Cannot Use Stock Recovery, gets stuck on formating.

I'm having the issue of missing storage with a 32GB phone.
Trying the instructions here - https://forum.xda-developers.com/showpost.php?p=47156078&postcount=2
The issue is the stock recovery doesn't seem to work for me. When you go to recovery mode with it flashed it gets stuck on the android symbol standing up with the spinning gear. I've left this overnight for over 10 hours.
I can resolve this if I flash TWRP recovery which then enables the phone to boot into android setup properly but it then reverts back to the issue of missing storage.
32 become 16 GB, the last last last attempt to solve the issue
Quote:
Originally Posted by GioVIP
i did just like you said but got again 16 instead of 32
Click to expand...
Click to collapse
I was in the same situation, metod 1, metod 2 any method to fix it did not work
I've solved it by doing this (make this at your own risk, FIRST be sure that your emmc is not damaged):
root your device, and put parted binary ( find it in the forum) in system/bin with execution permission.
Then reboot in twrp recovery, then in twrp recovery terminal or in adb root shell, type this :
Code:
Code:
mount system
umount /dev/block/mmcblk0p28
parted /dev/block/mmcblk0
check 28
it should say something like
Code:
Code:
Error: The backup GPT table is not at the end of the disk, as it should be.
This might mean that another operating system believes the disk is smaller.
Fix, by moving the backup to the end (and removing the old backup)?
Fix/Ignore/Cancel? Fix
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be
used, you can fix the GPT to use all of the space (an extra xxxxxx blocks) or
continue with the current setting?
Fix/Ignore?Fix
answer Fix and Fix.
now type:
Code:
Code:
print
the last two partitions should be:
Code:
28 2032MB 15.8GB 13.7GB userdata
29 15.8GB 15.8GB 5632B grow
if EVERYTHING is like that, let's make a try, type:
Code:
Code:
mkpart primary ext4 15.8GB 25.8GB name 30 trypart
name 30 trypart
print
if you can make trypart without errors and you can see trypart with the print command then
you can proceed to the next step, that will ERASE your data ( worse your userdata partition, before recreating it), type:
Code:
Code:
rm 30
rm 29
rm 28
mkpart primary ext4 2032140288B 31268511743B name 28 userdata
name 28 userdata
mkpart primary 31268511744B 31268517375B name 29 grow
name 29 grow
print
you should see the userdata partition with the new size, and the grow partition after.
Exit from parted by typing
Code:
Code:
quit
Now reboot in fastboot mode and from pc terminal type:
Code:
Code:
fastboot format userdata
ok reboot (wait it take its time) it should be solved.
16 to 32
1.Flash stock rom
2.Wait for opening
3.Reset ur nexus 5 (using options in setting app)
4.*important* Reset when phone boot completely..

Need a repartitioning expert to restore an omitted partition

I think I did some mistakes while trying to reflash a rom on my Sony Xperia S (lt26i).
I was following this guide, the first time it worked but then I decided to ungoogle my phone but it went bad.
[GUIDE/TUTORIAL/HOWTO] Sony Xperia S stock to Android 8.1 Oreo
[GUIDE/TUTORIAL/HOWTO] Sony Xperia S stock to Android 8.1 Oreo [GUIDE/TUTORIAL/HOWTO] Upgrade Sony Xperia S (Model LT26i codename nozomi) from Android 2.3.7 to Android 8.1 Oreo / nAOSP Rom This detailed step-by-step guide helps you transform...
forum.xda-developers.com
My problem is that I deleted my OS and TWRP can't read the data partition nor mount to Windows.
So now, with djibe89's help (the OP of the guide), I managed to figure out that my data partition is corrupted.
Using the adb shell, like on step 12 of the guide, I went to the partitions and it gave me this
Omitting empty partition (14)
Disk /dev/block/mmcblk0: 31.9 GB, 31910264832 bytes
4 heads, 16 sectors/track, 973824 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 65 2048 f0 Linux/PA-RISC boot
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 * 65 81 512 4d Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 129 768 20480 48 Unknown
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 769 954240 30511104 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 785 800 512 46 Unknown
/dev/block/mmcblk0p6 833 928 3072 4a Unknown
/dev/block/mmcblk0p7 961 1056 3072 4b Unknown
/dev/block/mmcblk0p8 1089 1184 3072 58 Unknown
/dev/block/mmcblk0p9 1217 1376 5120 70 Unknown
/dev/block/mmcblk0p10 1409 1664 8192 83 Linux
/dev/block/mmcblk0p11 1665 2176 16384 f0 Linux/PA-RISC boot
/dev/block/mmcblk0p12 2177 34944 1048576 83 Linux
/dev/block/mmcblk0p13 34945 42944 256000 83 Linux
~ # fdisk -l /dev/block/mmcblk0
Click to expand...
Click to collapse
The partition 14 should be the data one, that i already merged with the 15 the first time i flashed the rom.
What should I do?
try deleting it and let Android generate new one??
Code:
fastboot erase userdata
fastboot format:ext4 userdata
fastboot reboot
now there's a high chance that your device doesn't support " fastboot format:ext4 userdata "
here's an alternative
fastboot erase userdata <~ never reboot your device after typing this command you would go on infinite bootloop type the next command ...
fastboot reboot recovery <~ if this command does not work and just restarted your device instead of going recovery mode you are now on bootloop ... access recovery mode by pressing combination key instead
via recovery mode do "wipe data / factory reset"
then reboot
ineedroot69 said:
Code:
fastboot erase userdata
fastboot format:ext4 userdata
fastboot reboot
now there's a high chance that your device doesn't support " fastboot format:ext4 userdata "
here's an alternative
fastboot erase userdata <~ never reboot your device after typing this command you would go on infinite bootloop type the next command ...
fastboot reboot recovery <~ if this command does not work and just restarted your device instead of going recovery mode you are now on bootloop ... access recovery mode by pressing combination key instead
via recovery mode do "wipe data / factory reset"
then reboot
Click to expand...
Click to collapse
the first method didn't work because of the format command like you predicted.
then i did the <erase userdata> but i think the <reboot recovery> command isn't available because it returns me the commands list. so i used this command from the list
fastboot reboot-bootloader
Click to expand...
Click to collapse
then unplugged the usb and rebooted on twrp.
now my data partition went back to 0mb (going to wipe -> advanced wipe -> data -> repair or change file system) and i can't even reformat it.
should i re-do the adb procedure to recreate the data partition?
mongolino0 said:
the first method didn't work because of the format command like you predicted.
then i did the <erase userdata> but i think the <reboot recovery> command isn't available because it returns me the commands list. so i used this command from the list
then unplugged the usb and rebooted on twrp.
now my data partition went back to 0mb (going to wipe -> advanced wipe -> data -> repair or change file system) and i can't even reformat it.
should i re-do the adb procedure to recreate the data partition?
Click to expand...
Click to collapse
yes your device won't boot without userdata partition since it got deleted with "fastboot erase userdata" so you need to recreate it by "formatting" it somehow
so i wanted to "recreate" the data partition with adb but now i can't even use adb.
i went to mount on twrp with the phone connected and the cmd still running from 2 hours ago. when I type adb devices I can't find
... is it possible that i did some irreversible mistake?
mongolino0 said:
so i wanted to "recreate" the data partition with adb but now i can't even use adb.
i went to mount on twrp with the phone connected and the cmd still running from 2 hours ago. when I type adb devices I can't find
... is it possible that i did some irreversible mistake?
Click to expand...
Click to collapse
you have TWRP flashed? you can't use it to format data?
also looking at the Sony Xperia S (lt26i) specification it was released back in February 2012 i guess it has serve its purpose for too long it is time for it to retire

[GUIDE] Dual-Boot for any Android Device

Code:
disclaimer
/*
* Your warranty is... still valid?
*
* I am not responsible for bricked devices, dead SD cards,
*/
Hello
This Guide to make Dual-Boot for any android device that can be useful. It allows two Android os installed at the same time and switch between them almost as easily as a simple reboot.
Spoiler: General information
This done by creating a new system partition using Parted (shrink userdata partition and creat the new system partition)
To Boot from the new system partition: change the name of the new system partition to "system" and the name of old system partition to any name e.g. "system-b"
To Boot from the old system partition: change the name of the old system partition to "system" and the name of new system partition to any name e.g. "system-b"
Dual boot for P20 lite - demonstration video (I am using SHRP RECOVERY (like TWRP) with tweaks to change boot partition easily, instead of writing terminal commands. This a video shows the dual boot process)
Requirements​
TWRP
Parted (attached arm and arm64, unzip the file)
Latest fastboot and ADB commands installed
Backup all your data because you will make a factory reset and format data partition
Steps:​
Boot to TWRP
Run the following commands
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
p free
note: parted /dev/block/xxxxx according do your device
3- it will show the list of partition "save this you may use it later". remember the number of old system partition which is in my case "52"
{
"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"
}
4- remove "userdata" partition which in my case number 59 using the following command
Code:
rm 59
5- create the new system partition (partition number 59 in my case ) using the following command
Code:
mkpart name fs_type start end
name: name of new partition e.g "system-b"
fs_type: file system type e.g "ex4"
start: the end value in MB of the previous partition, in my case "7153MB"
end: equal to start + size where size will be the size of the target partition. in my case in need 4GB partition so end=7153MB + 4GB =11153MB
In my case I'll type:
Code:
mkpart system-b ext4 7153MB 11153MB
set 59 msftdata on
6- create the "userdata" partition (partition number 60 in my case, start= 11153MB )
In my case I'll type:
Code:
mkpart userdata ext4 11153MB 31.3GB
set 60 msftdata on
7- get the new partition list
Code:
p free
8- exit
Code:
quit
9- format userdata and the new system partition using "mkfs.type /dev/block/mmcblk0pxx" (in my case partition number 59 and 60). you may need to reboot before doing that or make factory reset using your recovery
Code:
adb push /path/to/mkfs.ext4 /sbin/mkfs.ext4
adb shell
chmod 777 /sbin/mkfs.ext4
mkfs.ext4 /dev/block/mmcblk0p59
mkfs.f2fs /dev/block/mmcblk0p60
10- To Boot from your new system partition > boot to twrp and run the following command
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
name 52 system-b
name 59 system
or from TWRP terminal write the following
Code:
parted -s /dev/block/mmcblk0 name 52 system-b
parted -s /dev/block/mmcblk0 name 59 system
change the number 52 and 59 according to your partition list (in my case 59: new system partion, 52 old system partition ). Then reboot TWRP and flash your new android os
11- To Boot from your old system partition > boot to twrp and run the following command
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
name 59 system-b
name 52 system
or from TWRP terminal write the following
Code:
parted -s /dev/block/mmcblk0 name 59 system-b
parted -s /dev/block/mmcblk0 name 52 system
change the number 52 and 59 according to your partition list (in my case 59: new system partion, 52 old system partition ). Then reboot
-------------------------------------------------------
You may create flashable zip or modify TWRP file to switch between the two android os easily[/CODE]
You can also create two userdata profiles such as here
https://forum.xda-developers.com/t/a-simple-way-to-kind-of-dual-boot-an-android.4176415/
Did you get what you described on your phone and would you like to show it in a video?
ze7zez said:
Did you get what you described on your phone and would you like to show it in a video?
Click to expand...
Click to collapse
Yes. It is worked on my phone Huawei P20 lite ... I am using SHRP RECOVERY (like TWRP) with tweaks to change boot partition easily, instead of writing terminal commands. This a video shows the dual boot process
Flashable zip Files to switch easily between the two android os (you must have "System" and "System-b" partitions, other names not accepted)
Flash "Active-New-System-partition-arm64-v2" to active the new system partition
Flash "Active-Default-System-partition-arm64-v2" to active the default system partition
Anyone else tried this? I'm courious how safe this is... Someone warned me it's very easy to brick device
Abdelhay.ali said:
Code:
disclaimer
/*
* Your warranty is... still valid?
*
* I am not responsible for bricked devices, dead SD cards,
*/
Hello
This Guide to make Dual-Boot for any android device that can be useful. It allows two Android os installed at the same time and switch between them almost as easily as a simple reboot.
Spoiler: General information
This done by creating a new system partition using Parted (shrink userdata partition and creat the new system partition)
To Boot from the new system partition: change the name of the new system partition to "system" and the name of old system partition to any name e.g. "system-b"
To Boot from the old system partition: change the name of the old system partition to "system" and the name of new system partition to any name e.g. "system-b"
Dual boot for P20 lite - demonstration video (I am using SHRP RECOVERY (like TWRP) with tweaks to change boot partition easily, instead of writing terminal commands. This a video shows the dual boot process)
Requirements​
TWRP
Parted (attached arm and arm64, unzip the file)
Latest fastboot and ADB commands installed
Backup all your data because you will make a factory reset and format data partition
Steps:​
Boot to TWRP
Run the following commands
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
p free
note: parted /dev/block/xxxxx according do your device
3- it will show the list of partition "save this you may use it later". remember the number of old system partition which is in my case "52"
View attachment 5772225
4- remove "userdata" partition which in my case number 59 using the following command
Code:
rm 59
5- create the new system partition (partition number 59 in my case ) using the following command
Code:
mkpart name fs_type start end
name: name of new partition e.g "system-b"
fs_type: file system type e.g "ex4"
start: the end value in MB of the previous partition, in my case "7153MB"
end: equal to start + size where size will be the size of the target partition. in my case in need 4GB partition so end=7153MB + 4GB =11153MB
In my case I'll type:
Code:
mkpart system-b ext4 7153MB 11153MB
set 59 msftdata on
6- create the "userdata" partition (partition number 60 in my case, start= 11153MB )
In my case I'll type:
Code:
mkpart userdata ext4 11153MB 31.3GB
set 60 msftdata on
7- get the new partition list
Code:
p free
View attachment 5775221
8- exit
Code:
quit
9- format userdata and the new system partition using "mkfs.type /dev/block/mmcblk0pxx" (in my case partition number 59 and 60). you may need to reboot before doing that or make factory reset using your recovery
Code:
adb push /path/to/mkfs.ext4 /sbin/mkfs.ext4
adb shell
chmod 777 /sbin/mkfs.ext4
mkfs.ext4 /dev/block/mmcblk0p59
mkfs.f2fs /dev/block/mmcblk0p60
10- To Boot from your new system partition > boot to twrp and run the following command
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
name 52 system-b
name 59 system
or from TWRP terminal write the following
Code:
parted -s /dev/block/mmcblk0 name 52 system-b
parted -s /dev/block/mmcblk0 name 59 system
change the number 52 and 59 according to your partition list (in my case 59: new system partion, 52 old system partition ). Then reboot TWRP and flash your new android os
11- To Boot from your old system partition > boot to twrp and run the following command
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
name 59 system-b
name 52 system
or from TWRP terminal write the following
Code:
parted -s /dev/block/mmcblk0 name 59 system-b
parted -s /dev/block/mmcblk0 name 52 system
change the number 52 and 59 according to your partition list (in my case 59: new system partion, 52 old system partition ). Then reboot
-------------------------------------------------------
You may create flashable zip or modify TWRP file to switch between the two android os easily[/CODE]
Click to expand...
Click to collapse
Is only GSI flashing possible with this method or any custom ROM?
It should work with any GSI/ROM..... It just change the name of the system partition.
Lord Sithek said:
Is only GSI flashing possible with this method or any custom ROM?
Click to expand...
Click to collapse
Abdelhay.ali said:
It should work with any GSI/ROM..... It just change the name of the system partition.
Click to expand...
Click to collapse
Well, I've tried that procedure on my secondary device but something got screwed and I ended up with the need of EDL flash. Maybe I made a mistake, idk, but it's definitely dangerous
Lord Sithek said:
Anyone else tried this? I'm courious how safe this is... Someone warned me it's very easy to brick device
Click to expand...
Click to collapse
Lord Sithek said:
Well, I've tried that procedure on my secondary device but something got screwed and I ended up with the need of EDL flash. Maybe I made a mistake, idk, but it's definitely dangerous
Click to expand...
Click to collapse
This can happen
Abdelhay.ali said:
Code:
disclaimer
/*
* Your warranty is... still valid?
*
* I am not responsible for bricked devices, dead SD cards,
*/
Hello
This Guide to make Dual-Boot for any android device that can be useful. It allows two Android os installed at the same time and switch between them almost as easily as a simple reboot.
Spoiler: General information
This done by creating a new system partition using Parted (shrink userdata partition and creat the new system partition)
To Boot from the new system partition: change the name of the new system partition to "system" and the name of old system partition to any name e.g. "system-b"
To Boot from the old system partition: change the name of the old system partition to "system" and the name of new system partition to any name e.g. "system-b"
Dual boot for P20 lite - demonstration video (I am using SHRP RECOVERY (like TWRP) with tweaks to change boot partition easily, instead of writing terminal commands. This a video shows the dual boot process)
Requirements​
TWRP
Parted (attached arm and arm64, unzip the file)
Latest fastboot and ADB commands installed
Backup all your data because you will make a factory reset and format data partition
Steps:​
Boot to TWRP
Run the following commands
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
p free
note: parted /dev/block/xxxxx according do your device
3- it will show the list of partition "save this you may use it later". remember the number of old system partition which is in my case "52"
View attachment 5772225
4- remove "userdata" partition which in my case number 59 using the following command
Code:
rm 59
5- create the new system partition (partition number 59 in my case ) using the following command
Code:
mkpart name fs_type start end
name: name of new partition e.g "system-b"
fs_type: file system type e.g "ex4"
start: the end value in MB of the previous partition, in my case "7153MB"
end: equal to start + size where size will be the size of the target partition. in my case in need 4GB partition so end=7153MB + 4GB =11153MB
In my case I'll type:
Code:
mkpart system-b ext4 7153MB 11153MB
set 59 msftdata on
6- create the "userdata" partition (partition number 60 in my case, start= 11153MB )
In my case I'll type:
Code:
mkpart userdata ext4 11153MB 31.3GB
set 60 msftdata on
7- get the new partition list
Code:
p free
View attachment 5775221
8- exit
Code:
quit
9- format userdata and the new system partition using "mkfs.type /dev/block/mmcblk0pxx" (in my case partition number 59 and 60). you may need to reboot before doing that or make factory reset using your recovery
Code:
adb push /path/to/mkfs.ext4 /sbin/mkfs.ext4
adb shell
chmod 777 /sbin/mkfs.ext4
mkfs.ext4 /dev/block/mmcblk0p59
mkfs.f2fs /dev/block/mmcblk0p60
10- To Boot from your new system partition > boot to twrp and run the following command
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
name 52 system-b
name 59 system
or from TWRP terminal write the following
Code:
parted -s /dev/block/mmcblk0 name 52 system-b
parted -s /dev/block/mmcblk0 name 59 system
change the number 52 and 59 according to your partition list (in my case 59: new system partion, 52 old system partition ). Then reboot TWRP and flash your new android os
11- To Boot from your old system partition > boot to twrp and run the following command
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/mmcblk0
name 59 system-b
name 52 system
or from TWRP terminal write the following
Code:
parted -s /dev/block/mmcblk0 name 59 system-b
parted -s /dev/block/mmcblk0 name 52 system
change the number 52 and 59 according to your partition list (in my case 59: new system partion, 52 old system partition ). Then reboot
-------------------------------------------------------
You may create flashable zip or modify TWRP file to switch between the two android os easily[/CODE]
Click to expand...
Click to collapse
look what i got
edit: appearently any name u put when u use the command mkpart doesn't register or smtg idk what's wrong tbh
edit2: i found a solution just do "name 38(in my case) userdata" and it'll name the partition
i accidentally hardbricked my xiaomi pad 5 by deleting the dbg partition (could not find any information about it online), can anybody help?
Does not the new system-b alias requires its own data partition? The new system image may not be compatible with data partition.
New Android OS requires its own data. Above approach will share the /data among different system images which is something not useful.
dual boot is nonsense because one can't share same userdata partition between ROMs
alecxs said:
dual boot is nonsense because one can't share same userdata partition between ROMs
Click to expand...
Click to collapse
Yes you can but it does not work with all apps.
I got an app in the Dualboot I made for Oneplus 6/7 series and had an app where you can choose which apps should be shared on both roms.

Categories

Resources