[SCRIPT] Fix partition table for Android 4.4


The bootloader doesn't care about system,system1,userdata and storage :)
I deleted them and could still boot into recovery.
So, does it means that we can have only one partition for system, i don't need this dual boot, for me is enough one system partition.
 
So, does it means that we can have only one partition for system, i don't need this dual boot, for me is enough one system partition.
Yes, teorically if we edit partitions, and we set bootloader to boot system0 it may boot
 
is that difficult to do? i am just a not so experienced to do such things? i would really like one system partition
 
I would recommend to not delete system1 partition. just make it very small like 1MB. This way the partition number will still be correct.
 
and system0 will automatically increase or not?
if i make it 1mb, and after i will have to use miflash, does miflash will reparation it again, or it will be a problem?
Thanks
 
miflash will only repartition the device if you use QHSUSB_DLOAD mode(bootloader brick or shortcut).
otherwise it will use fastboot which picks the correct partitions by name.

you can set system0 to sth like 840mb, system1 to 1mb and give userdata the remaining space
 
yes it is. the max would be a little but less than system+system1+cache+userdata+storage=~30GB? :p
But it doesn't make sense to go above 840MB.
 
my script can be used on all operating systems because u just need to push and execute it.
if you want a different partition table you have to change the scripts. But you have to know how parted works.
 
ok thank you for answers, it helped me a lot
only last question, how i can do it on os x?
Or ariesToolkit, but you will need that adb is on your exported path (google about this)

@everyone
DO NOT TRY TO DISABLE / RESTRIZE SYSTEM1 PARTION, EXPECIALLY IF YOU AREN'T AN EXPERT WITH LINUX AND PARTITIONS IN GENERAL!!!! YOU MAY HARD-BRICK YOUR DEVICE, AND IF YOU MAKE A MISTAKE WE MAY NOT BE ABLE TO HELP YOU, BECAUSE THE PHONE MAY BE LOST FOREVER!!!!!!!!!
 
  • Like
Reactions: xeGox
@linuxx: It's always good to warn users but I disagree about the hardbrick. We should be able to recovery ANY mi2(s) phone with miFlash+shortcut ;)
 
@M1cha Xiaomi mi2s 16 GB parted with ariesTool
Code:
user@HP-ubuntu:~$ adb shell parted -s /dev/block/mmcblk0 print
Model: MMC SEM16G (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      17.4kB  89.1MB  89.1MB  fat16        modem
2      89.1MB  178MB  89.1MB  fat16        modem1
3      178MB  179MB  524kB                sbl1
4      179MB  179MB  524kB                sbl2
5      179MB  180MB  1049kB              sbl3
6      180MB  181MB  1049kB              rpm
7      181MB  182MB  1049kB              tz
8      182MB  183MB  524kB                DDR
9      183MB  187MB  4194kB              aboot
10      187MB  188MB  1049kB              misc
11      188MB  191MB  2990kB              logo
12      191MB  192MB  799kB                m9kefs1
13      192MB  193MB  799kB                m9kefs2
14      193MB  193MB  1024B                m9kefsc
15      193MB  201MB  8501kB              bk1
16      201MB  202MB  799kB                m9kefs3
17      202MB  268MB  66.3MB              bk2
18      268MB  284MB  15.7MB              boot
19      284MB  300MB  15.7MB              boot1
20      300MB  316MB  15.7MB              recovery
21      316MB  327MB  11.5MB              bk3
22      327MB  336MB  8389kB  ext4        persist
23      336MB  1176MB  840MB  ext4        system
24      1176MB  2016MB  840MB  ext4        system1
25      2016MB  2419MB  403MB  ext4        cache
26      2419MB  5570MB  3151MB  ext4        userdata
27      5570MB  15.8GB  10.2GB  ext4        storage
system0= cm 10.2 with gapps
system1= cm 11 no gapps
 
Try Aries Toolkit I've added this Now, so you can use this without need adb and co.... This is automated, let i upload it ;)
How long does it take?
upload_2013-12-2_23-50-12.png


I've been on this screen for ever...

Edit:
Does your Ariestool only work for Miui? Eventually I continued, my phone rebooted into CWM and nothing happened. I didn't even lose my data...
 
How long does it take?
View attachment 6746

I've been on this screen for ever...

Edit:
Does your Ariestool only work for Miui? Eventually I continued, my phone rebooted into CWM and nothing happened. I didn't even lose my data...
Reboot into recovery and then execute it.

Inviato dal mio MI 2(s) utilizzando Tapatalk
 
@linuxx do you could let your script automatically reboot to recovery.
Yes, if you see sourcecode there is the commando inside it, but it doesn't wait for it. Need to add a pause ...

Inviato dal mio MI 2(s) utilizzando Tapatalk
 
Fixed, found it on mega, same directory
I've tried it again, but I doubt it worked.
1) Booted into CWM
2) Ariestool -> advanced -> extend partition -> followed instructions
3) Phone automatically rebooted intro CWM
4) I'm still able to boot builds that were installed before, I thought they should be gone?

So how can I check if it worked or not?
 
Hello guys,
Can I ask if there is any problem with this?
Code:
check environment
/sbin/mount
/sbin/umount
/sbin/parted
/sbin/tune2fs
/sbin/e2fsck
dump old table
__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!
unmount partitions
umount: can't umount /system: Invalid argument
umount: can't umount /system1: No such file or directory
umount: can't umount /data: Invalid argument
change partition table
parted: delete
parted: create
parted: name
format partitions
format: /dev/block/mmcblk0p23
tune2fs 1.41.14 (22-Dec-2010)
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or
0 days, whichever comes first.  Use tune2fs -c or -i to override.
e2fsck 1.41.14 (22-Dec-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/block/mmcblk0p23: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p23: 11/410464 files (0.0% non-contiguous), 68023/820758 block
s
tune2fs 1.41.14 (22-Dec-2010)
e2fsck 1.41.14 (22-Dec-2010)
Adding dirhash hint to filesystem.

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/block/mmcblk0p23: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p23: 11/410464 files (0.0% non-contiguous), 68023/820758 block
s
format: /dev/block/mmcblk0p24
tune2fs 1.41.14 (22-Dec-2010)
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or
0 days, whichever comes first.  Use tune2fs -c or -i to override.
e2fsck 1.41.14 (22-Dec-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/block/mmcblk0p24: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p24: 11/410464 files (0.0% non-contiguous), 68023/820312 block
s
tune2fs 1.41.14 (22-Dec-2010)
e2fsck 1.41.14 (22-Dec-2010)
Adding dirhash hint to filesystem.

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/block/mmcblk0p24: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p24: 11/410464 files (0.0% non-contiguous), 68023/820312 block
s
format: /dev/block/mmcblk0p25
tune2fs 1.41.14 (22-Dec-2010)
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or
0 days, whichever comes first.  Use tune2fs -c or -i to override.
e2fsck 1.41.14 (22-Dec-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/block/mmcblk0p25: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p25: 11/196608 files (0.0% non-contiguous), 32935/393217 block
s
tune2fs 1.41.14 (22-Dec-2010)
e2fsck 1.41.14 (22-Dec-2010)
Adding dirhash hint to filesystem.

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/block/mmcblk0p25: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p25: 11/196608 files (0.0% non-contiguous), 32935/393217 block
s
format: /dev/block/mmcblk0p26
tune2fs 1.41.14 (22-Dec-2010)
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or
0 days, whichever comes first.  Use tune2fs -c or -i to override.
e2fsck 1.41.14 (22-Dec-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/block/mmcblk0p26: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p26: 11/384768 files (9.1% non-contiguous), 28498/769295 block
s
tune2fs 1.41.14 (22-Dec-2010)
e2fsck 1.41.14 (22-Dec-2010)
Adding dirhash hint to filesystem.

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/block/mmcblk0p26: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p26: 11/384768 files (9.1% non-contiguous), 28498/769295 block
s
Done.

After I have rebooted the recovery, I chose reboot system.
Then it asked for grant root. At first I chose back, but it still asked for grant root.
Then I selected yes, but now I cannot boot to my rom.
I am stuck at the white MI logo.

Edit:
Before I attempted to repartition, I have installed the latest CWM(for 4.4).
Update:
The white MI logo has not moved for about 10minutes, then I have plugged out the battery and boot straight to CWM.
I cleared cache partition and dalvik.
I enabled True Dual Boot and reboot to ROM.
Then it asked to grant root 2 times. This time I accept both requests.
But I am still stuck at white MI logo.
 
Last edited: