[6039y] **GUIDE** Repartitioning of the internal memory - Onetouch Idol 3 Android Development

Here it is as I promised.
This phone (the model with one sim card) is sold as a device with 8GB internal memory. In fact the memory chip inside is 16GB, so we can increase the available internal space.
PLEASE READ CAREFULLY AND IF SOMETHING IS NOT CLEAR DO NOT HESITATE TO ASK.
*** The data on your device will be untouched after this operation. But again please read carefully! ***
*** A good practice is always to make a backup of everything which will be changed. I do it and I've made a backup of the entire internal memory of the device before the start of the operation which is described below. ***
*** At the end of the post there is a link to a ZIP file which can be flashed through TWRP in order to perform the procedure automatically. Also includes a check for the size of the EMMC (as there are devices on which the resizing cannot be performed...their chip is smaller).***
1. You can go to this thread and to say Thanks! @meghd00t as his static build of gdisk is used in the recovery below.
2. What is needed:
- A different TWRP Recovery with gdisk inside. It can be downloaded from here twrp-2.8.7.0-idol3-6039y-with-gdisk.img - md5sum: 66b3f82a3e2e1afe14627b3b900a9319
- (Optional) An SD card for backup of the original GPT partition layout.
- Patience and careful reading.
- The Windows users probably need the drivers from this post, for access to the device in recovery mode.
3. How to do it (the output used below is from the terminal window from which I've done this operation on my device):
- reboot to bootloader:
Code:
adb reboot-bootloader
- start the recovery
Code:
fastboot -i 0x1bbb boot twrp-2.8.7.0-idol3-6039y-with-gdisk.img
- go to the device
Code:
adb shell
- unmount all partitions of the internal memory
Code:
~ # umount /cache
~ # umount /sdcard
~ # umount /and-sec
- ensure that there are no mounted partitions from mmcblk0. The output from the mount command should looks like this:
Code:
~ # mount
rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=713016k,nr_inodes=157853,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,seclabel,relatime,size=713016k,nr_inodes=157853)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
/dev/block/mmcblk1p1 on /external_sd type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
- start gdisk
Code:
~ # gdisk /dev/block/mmcblk0
all partitions can be listed by pressing 'p' but we are interested by the last two:
Code:
37 5000400 15269853 4.9 GiB FFFF userdata
38 15269854 30535646 7.3 GiB 0700 userdatabak
and their information which will be shown by pressing 'i' and entering the partition number:
Code:
Command (? for help): i
Partition number (1-38): 37
Partition GUID code: 1B81E7E6-F50D-419B-A739-2AEEF8DA3335 (Unknown)
Partition unique GUID: BDD7FA27-93D4-40BC-B266-313E074E0E87
First sector: 5000400 (at 2.4 GiB)
Last sector: 15269853 (at 7.3 GiB)
Partition size: 10269454 sectors (4.9 GiB)
Attribute flags: 0000000000000000
Partition name: 'userdata'
Command (? for help): i
Partition number (1-38): 38
Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)
Partition unique GUID: BD12CF41-10E7-BBF7-D096-5553B89882E7
First sector: 15269854 (at 7.3 GiB)
Last sector: 30535646 (at 14.6 GiB)
Partition size: 15265793 sectors (7.3 GiB)
Attribute flags: 0000000000000000
Partition name: 'userdatabak'
The information which is needed from the above output is Partition GUID code, First sector, Last sector and Partition name. You can write these somewhere (if your values are different from the above) from where can be pasted easily later (alternatively you can use the scrollback function of the terminal ).
- if you have an SD card make a backup of the partitions layout (in case that something goes wrong):
Code:
Command (? for help): b
Enter backup filename to save: /external_sd/gpt_partitions_table.backup
The operation has completed successfully.
- delete partitions 37 and 38:
Code:
Command (? for help): d
Partition number (1-38): 38
Command (? for help): d
Partition number (1-37): 37
- create a new partition 37, bigger in size with the same (as before) Partition GUID code, and the same (as before) start sector:
Code:
Command (? for help): n
Partition number (37-40, default 37): 37
First sector (34-30535646, default = 5000400) or {+-}size{KMGTP}: 5000400
Last sector (5000400-30535646, default = 30535646) or {+-}size{KMGTP}: 30535546
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 1B81E7E6-F50D-419B-A739-2AEEF8DA3335
Changed type of partition to 'Unknown'
The difference here is in the last sector of the partition 30535546.
- create a new partition 38 with same Partition GUID code, but with different First sector:
Code:
Command (? for help): n
Partition number (38-40, default 38): 38
First sector (34-30535646, default = 34) or {+-}size{KMGTP}: 30535547
Information: Moved requested sector from 30535547 to 30535548 in
order to align on 2-sector boundaries.
Use 'l' on the experts' menu to adjust alignment
Last sector (30535548-30535646, default = 30535646) or {+-}size{KMGTP}: 30535646
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
Changed type of partition to 'Microsoft basic data'
Please note that here in the output after 'n' the default first sector is 34, so you explicitly must enter the value!!! As can be seen I've entered the next available sector (after partition 37) 305355547 but it has been corrected automatically to 30535548. So you can use directly 30535548 as a start sector. The last sector is at the end of the memory 30535646.
- write the names of the new partitions:
Code:
Command (? for help): c
Partition number (1-38): 37
Enter name: userdata
Command (? for help): c
Partition number (1-38): 38
Enter name: userdatabak
- if you list the partitions again (with 'p') the end of the table should looks like this:
Code:
37 5000400 30535546 12.2 GiB FFFF userdata
38 30535548 30535646 49.5 KiB 0700 userdatabak
- now it is safe to write the changes by pressing 'w':
Code:
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/block/mmcblk0.
The operation has completed successfully.
- resize the file system:
Code:
~ # resize2fs -p /dev/block/mmcblk0p37
resize2fs 1.42.9 (28-Dec-2013)
Please run 'e2fsck -f /dev/block/mmcblk0p37' first.
... hmm ... let's run it:
Code:
~ # e2fsck -f /dev/block/mmcblk0p37
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/block/mmcblk0p37: 12519/321280 files (5.8% non-contiguous), 678615/1283425 blocks
~ # resize2fs -p /dev/block/mmcblk0p37
resize2fs 1.42.9 (28-Dec-2013)
Please run 'e2fsck -f /dev/block/mmcblk0p37' first.
... well the resize2fs have some checks and refuses to resize the file system therefore we must force the execution:
Code:
~ # resize2fs -fp /dev/block/mmcblk0p37
resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/block/mmcblk0p37 to 3191893 (4k) blocks.
The filesystem on /dev/block/mmcblk0p37 is now 3191893 blocks long.
The device now can be rebooted and its internal memory will be almost 12GB which compared to its previous size is a very nice upgrade. Screenshots before and after the repartitioning can be seen here.
Update (19.09.2015): This is a link to a flashabable zip which can be used from the TWRP to automate the process. Can be used with any TWRP recovery for 6039.
md5sum: c3f685310283bdc00cee5412fa33259c

Just tried it, and it worked like a charm. Thank you very much!

Wow ! Kudos to meghd00t and petrov.0. I just ordered this phone as a backup, waiting for my beloved Xperia Z1 Compact to be saved from watering (medium rain during less than 10min, so long Sony waterproof phones...). Can't wait to receive it and play with this extra storage !! Thank you :victory:

Here i'am, crazy thinking that if the 6039y(Single chip, SDcard and 8Gb) come with 8Gb worth of wasted money, that the 6039j dual chip and 16Gb non-SDCard version may very well come with a SDCard reader hardware worth of wasted money.
It would be like just changing the Chip Support slot thing or whatever...
Can someone support my craziness and post a picture of thi "where the chip stays" of the SDCard reader version of this phone??
Thanks a lot!!

evilinheaven said:
Here i'am, crazy thinking that if the 6039y(Single chip, SDcard and 8Gb) come with 8Gb worth of wasted money, that the 6039j dual chip and 16Gb non-SDCard version may very well come with a SDCard reader hardware worth of wasted money.
It would be like just changing the Chip Support slot thing or whatever...
Can someone support my craziness and post a picture of thi "where the chip stays" of the SDCard reader version of this phone??
Thanks a lot!!
Click to expand...
Click to collapse
Well ... I like crazy things. But is impossible just to add a chip.
The thread itself is for other things. I don't want more reminders from the moderators. So please use the general section next time.
Thank you in advance.

Here is the complete partition list for 8Gb single sim variant:
Code:
Disk /dev/block/mmcblk0: 30535680 sectors, 14.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 98101B32-BBE2-4BF2-A06E-2BB33D000C20
Partition table holds up to 40 entries
First usable sector is 34, last usable sector is 30535646
Partitions will be aligned on 2-sector boundaries
Total free space is 256464 sectors (125.2 MiB)
Number Start (sector) End (sector) Size Code Name
1 131072 262143 64.0 MiB 0700 modem
2 262144 265215 1.5 MiB FFFF tunning
3 265216 267263 1024.0 KiB FFFF traceability
4 267264 267265 1024 bytes FFFF fsc
5 267266 267281 8.0 KiB FFFF ssd
6 267282 268305 512.0 KiB FFFF sbl1
7 268306 269329 512.0 KiB 0700 sbl1bak
8 269330 270353 512.0 KiB FFFF rpm
9 270354 271377 512.0 KiB 0700 rpmbak
10 271378 272401 512.0 KiB FFFF tz
11 272402 273425 512.0 KiB 0700 tzbak
12 273426 274449 512.0 KiB FFFF hyp
13 274450 275473 512.0 KiB 0700 hypbak
14 275474 278545 1.5 MiB FFFF modemst1
15 278546 281617 1.5 MiB FFFF modemst2
16 281618 283665 1024.0 KiB FFFF simlock
17 283666 286737 1.5 MiB FFFF efsdata
18 393216 393279 32.0 KiB FFFF DDR
19 393280 396351 1.5 MiB FFFF fsg
20 396352 396383 16.0 KiB FFFF sec
21 396384 398431 1024.0 KiB FFFF aboot
22 398432 400479 1024.0 KiB 0700 abootbak
23 400480 466015 32.0 MiB FFFF boot
24 466016 531551 32.0 MiB FFFF recovery
25 531552 4306427 1.8 GiB FFFF system
26 4325376 4390911 32.0 MiB FFFF persist
27 4390912 4407295 8.0 MiB FFFF splash
28 4407296 4448255 20.0 MiB 0700 tctpersist
29 4448256 4468735 10.0 MiB 0700 hdcp
30 4468736 4468751 8.0 KiB FFFF fota
31 4468752 4993039 256.0 MiB FFFF cache
32 4993040 4995087 1024.0 KiB FFFF misc
33 4995088 4996111 512.0 KiB FFFF keystore
34 4996112 4996175 32.0 KiB FFFF config
35 4996176 4996303 64.0 KiB FFFF oem
36 4996304 5000399 2.0 MiB FFFF FactoryRP
37 5000400 15269853 4.9 GiB FFFF userdata
38 15269854 30535646 7.3 GiB 0700 userdatabak
Maybe someone can post the list for 16Gb dual sim variant?

Ok, I bit the bullet and resized the "userdata" partition. Only that I did not create the smaller #38 partition, I did not see any reason to do it (if any update tries to store something inside it, will fail anyway; this partition does not look special, all *bak partitions have the same GUID). Plus there isn't any "userdatabak" partition on 16Gb models. Instead I made partition #37 up to the latest available sector (30535646). The phone is working just fine.

rioachim said:
Ok, I bit the bullet and resized the "userdata" partition. Only that I did not create the smaller #38 partition, I did not see any reason to do it (if any update tries to store something inside it, will fail anyway; this partition does not look special, all *bak partitionshave the same GUID). Plus there isn't any "userdatabak" partition on 16Gb models. Instead I made partition #37 up to the latest available sector (30535646). The phone is working just fine.
Click to expand...
Click to collapse
OK. But don't be fulled by the GUID. Most of the bak partitions contain data which is equivalent to the data in the primary ones (aboot, rpm, sbl1 etc.). The data is patched in both partitions with the same patch during an upgrade.

Script to repartition "internal memory"
Hello petrov.0, all
Is it possible to create a shell for all thoses commands ?
In this case if partitions are lost (upgrade, patchs....) we could apply it easily.
And nice discovered.
Regards
Google99

google99 said:
Hello petrov.0, all
Is it possible to create a shell for all thoses commands ?
In this case if partitions are lost (upgrade, patchs....) we could apply it easily.
And nice discovered.
Regards
Google99
Click to expand...
Click to collapse
No it is not:
Code:
GPT fdisk (aka gdisk) is a text-mode menu-driven program for creation and manipulation of partition tables.

Hi petrov.0 great news and thanks.
Just a doubt, a friend of mine will receive Idol 3 4,7" 8 GB tomorrow, he can made OTA update (that I think are available for security reasons as "stagefright" and another I know Alcatel get users a way to set SD as main memory) and then use your guide to expand memory t 16 Gb or for this operation is better been in a fresh unchained device not updated?
Because in this second option device become 16 Gb Rom but will be afected by stagefright and for the rest of his life
Thanks!

Romagnolo1973 said:
Hi petrov.0 great news and thanks.
Just a doubt, a friend of mine will receive Idol 3 4,7" 8 GB tomorrow, he can made OTA update (that I think are available for security reasons as "stagefright" and another I know Alcatel get users a way to set SD as main memory) and then use your guide to expand memory t 16 Gb or for this operation is better been in a fresh unchained device not updated?
Because in this second option device become 16 Gb Rom but will be afected by stagefright and for the rest of his life
Thanks!
Click to expand...
Click to collapse
It shouldn't be updated. The official updates for 6039 removes the fastboot commands therefore you will not be able to do the repartitioning nor to root the device. Give me the update file and will modify it in a way which will preserve the commands (there is a risk for a broken device after it though ... I wish to try such modification first on my phone, but unfortunately I still do not have official update for it with which to test).

petrov.0 said:
It shouldn't be updated. The official updates for 6039 removes the fastboot commands therefore you will not be able to do the repartitioning nor to root the device. Give me the update file and will modify it in a way which will preserve the commands (there is a risk for a broken device after it though ... I wish to try such modification first on my phone, but unfortunately I still do not have official update for it with which to test).
Click to expand...
Click to collapse
By the way is there any hope (other than getting Alcatel to push an update to put fastboot commands back in, cause is anyone that optimistic?) for people who have indeed updated to recover those?
Sent from my 6039Y using Tapatalk

Rorshan said:
By the way is there any hope (other than getting Alcatel to push an update to put fastboot commands back in, cause is anyone that optimistic?) for people who have indeed updated to recover those?
Sent from my 6039Y using Tapatalk
Click to expand...
Click to collapse
If you find a way to root the device after the update then may be there is a hope.

petrov.0 said:
It shouldn't be updated. The official updates for 6039 removes the fastboot commands therefore you will not be able to do the repartitioning nor to root the device. Give me the update file and will modify it in a way which will preserve the commands (there is a risk for a broken device after it though ... I wish to try such modification first on my phone, but unfortunately I still do not have official update for it with which to test).
Click to expand...
Click to collapse
Understood the problem is new update that remove some action from fastboot needed for repartioning. Idol 3 was received and he resize rom from 8 to 16 with no issue with your guide, after that he made OTA update and they are working perfectly, no issue with the new partitioning size and device is working well.

Romagnolo1973 said:
Understood the problem is new update that remove some action from fastboot needed for repartioning. Idol 3 was received and he resize rom from 8 to 16 with no issue with your guide, after that he made OTA update and they are working perfectly, no issue with the new partitioning size and device is working well.
Click to expand...
Click to collapse
Not some but all fastboot commands are removed. Glad to see that you have made it though. The OTA update however is a mistake. Now you can't get root access nor the fastboot commands are available.

petrov.0 said:
Not some but all fastboot commands are removed. Glad to see that you have made it though. The OTA update however is a mistake. Now you can't get root access nor the fastboot commands are available.
Click to expand...
Click to collapse
Yes, it was risky but probably he is not interested in root, I only inform you that new partitioning with OTA is still there, I think is a goodnews and a base to start, now the perfect situation is if Alcatel made a future OTA as soon as possible with fastboot perfectly working.

Romagnolo1973 said:
Yes, it was risky but probably he is not interested in root, I only inform you that new partitioning with OTA is still there, I think is a goodnews and a base to start, now the perfect situation is if Alcatel made a future OTA as soon as possible with fastboot perfectly working.
Click to expand...
Click to collapse
There is nothing wrong with the fastboot commands prior the update. I have doubts that they will be returned. Thanks for the info though (despite that I already know this by looking in the update files). I can't live without root access however therefore there is no option to loose it.

I'm kinda confused here. Are all the steps done from a terminal on the computer or is some of that to be typed inside the TWRP terminal? Because as soon as I boot TWRP with gdisk I get a device not found from typing adb shell. I'm pretty sure I have all the drivers mentioned in the linked post (and even more too). Any kind soul to explain how stupid I am being (because I know that's the solution in the end, I'm a fool)

Rorshan said:
I'm kinda confused here. Are all the steps done from a terminal on the computer or is some of that to be typed inside the TWRP terminal? Because as soon as I boot TWRP with gdisk I get a device not found from typing adb shell. I'm pretty sure I have all the drivers mentioned in the linked post (and even more too). Any kind soul to explain how stupid I am being (because I know that's the solution in the end, I'm a fool)
Click to expand...
Click to collapse
Everything after adb shell must be done directly on the device. The VID & PID of the device are different in the recovery and you don't have the necessary drivers. Try to install the drivers mentioned in the first post (- The Windows users probably need the drivers from this post, for access to the device in recovery mode).

Related

[GUIDE][ACRO S] nAOSP 6.0 Full Flashing Guide. ULTIMATE N00B GUIDE! (ROM+Repartition)

Hi Everyone,
You might have seen my last Guide about Flashing BPaul's 5.0 and 5.1.1
Here's my another Guide for Mickybart's nAOSP 6.0 for ACRO S
Credits:
@mickybart (Developer)
I see people complaining about the Guide available by mickybart is too BIG and Complicated.
Actually it looks Big but it's not!
Hope this Guide HELPS YOU ALL. I made it as simple as I can.
I REQUEST EVERYONE TO PLEASE READ FULL GUIDE
EVEN A GUY WHO KNOWS NOTHING, CAN FOLLOW THIS GUIDE!
(Atleast he/she must have a BRAIN)
Just REMEMBER, for Marshmallow we'll merge /data + /sdcard INTO ONE and change file-system from ext4 to f2fs.
That means, before we were getting 11.2GB of Internal memory AND 2GB for APPS.
Now after Repartition it'll become 13.2GB
NOTE: I'm NOT responsible if you damage your phone while caring out any process. As a NewBie or a N00B can make many silly mistakes. DO AT YOUR OWN RISK
Click to expand...
Click to collapse
We'll cover below major steps:
1. Repartitioning
2. File-System to f2fs
3. Flashing nAOSP 6.0
Pre-Requirities: (Download ALL and Keep in your PC)
Downloads:
nAOSP 6.0 ROM (Download 6.0)
Minimal ADB and Fastboot
OpenGapps ARM-6.0 (Download ARM -> 6.0 -> Mini)
Here We Begin:
First of all BACK-UP everything and save it to PC.
Install Minimal ADB and Fatboot into your Windows PC.
Now Switch off your Phone (ACRO S) and
Connect Phone in Fastboot Mode (Power button + Connect USB to PC)
(If phone shows BLUE LED lighten, then everything is going right! IF NOT then Check for Fastboot drivers into your PC)
Now IN PC Open nAOSP.zip and Extract recovery.img to Minimal ADB and Fastboot folder.
(must be installed in c:/program files (x86)/minimal adb and fastboot/keep here)
Open Minimal ADB and Fastboot and type below commands;
~fastboot devices
~fastboot flash boot recovery.img
~fastboot reboot
(Now your phone will restart in TWRP recovery)
----------REPARTITIONING:----------
NOW ACTUAL REPARTITIONING STARTS:
In TWRP GoTo Mount -> uncheck everything (system,data,cache etc)
In PC in Minimal ADB and fastboot type below;
~adb shell
~fdisk -l /dev/block/mmcblk0
Now You'll see some information-table, just copy everything and keep safe. It'll help you.
NOW CONCENTRATE ON LAST TWO ROWS IN THAT INFO-TABLE
/dev/block/mmcblk0p14 49247 261695 7000024 83 Linux
/dev/block/mmcblk0p15 261696 954240 22161424 83 Linux
(Values for your phone may differ)
NOW type below command; (make sure VALUES IN SAME COLOR MATCHES ACCORDING TO YOURS)
fdisk /dev/block/mmcblk0
Command (m for help): p
Command (m for help): d
Partition number (1-15): 15
Command (m for help): d
Partition number (1-15): 14
Command (m for help): n
First Cylender (769-954240, default 769): 49247
Last cylinder or +size or +sizeM or +sizeK (49247-954240, default 954240): 954240
Command (m for help): t
Partition number (1-14): 14
Hex code (type L to list codes): 83
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table
YOU'll SEE A ERROR, JUST IGNORE IT
Once partition is Done. Just reboot device. JUST REBOOT!
DONE!
----------Changing File-Syatem to f2fs----------
Into TWRP:
Wipe
Advanced Wipe
Select Data
Repair or Change File system
Change File System
F2FS
Swipe to Change
GO back and do SAME for /cache to change File-System to f2fs
Once it's Done. Just reboot device. JUST REBOOT!
If you see 0MB or any wrong value for data after the reboot, try to format data (Wipe/Format Data).
In Extreme case, convert data to ext4 and convert back to f2fs. It'll hopefully work for you.
DONE!
----------Flashing nAOSP ROM 6.0----------
Copy the Downloaded nAOSP.zip AND OpenGapps.zip in Memory Card
IN TWRP:
Install
Select nAOSP.zip
Add more Zips (IMP)
Select OpenGapps.zip (IMP)
Swipe to Change
(after it's done)
Clear Cache and Dalvic Cache
Reboot
DONE!
(For the first time it can take a long to boot-up. So just don't worry and sit back!)
If you Found Above Post Helpful, There's a Thumbs UP Button Below, Don't Forget To Click It.
Regards,
hitman-xda
hi hitman thanks for your explaination . but im a bit confused about the repartition on the last cylinder. is it need to change 954240 because mine just 400k++
First Cylender (769-954240, default 769): 49247
Last cylinder or +size or +sizeM or +sizeK (49247-954240, default 954240): 954240
adiawie said:
hi hitman thanks for your explaination . but im a bit confused about the repartition on the last cylinder. is it need to change 954240 because mine just 400k++
First Cylender (769-954240, default 769): 49247
Last cylinder or +size or +sizeM or +sizeK (49247-954240, default 954240): 954240
Click to expand...
Click to collapse
Please post the whole table?
I can't understand your problem.
hitman-xda said:
Please post the whole table?
I can't understand your problem.
Click to expand...
Click to collapse
im not save the installation table logs . i flashed back to stock rom because internal storage and sd card not detect. maybe i miss something
i'll try flash again later
@Hitman is it your acro works fine with this new rom or unstable?
Hi hitman
My problem is the same as adiawie
Im save the installation table logs :
~ # fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 15.9 GB, 15925772288 bytes
4 heads, 16 sectors/track, 486016 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 477120 15243264 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
/dev/block/mmcblk0p14 42945 108480 2097152 83 Linux
/dev/block/mmcblk0p15 108481 477120 11796480 c Win95 FAT32 (LBA)
~ #
........
Command (m for help): d
Partition number (1-15): 15
Command (m for help): d
Partition number (1-14): 14
Command (m for help): n
First cylinder (769-477120, default 769): 49247
Last cylinder or +size or +sizeM or +sizeK (49247-477120, default 477120): 954240
Value is out of range
.........
Thank you for your help
adiawie said:
im not save the installation table logs . i flashed back to stock rom because internal storage and sd card not detect. maybe i miss something
i'll try flash again later
@Hitman is it your acro works fine with this new rom or unstable?
Click to expand...
Click to collapse
I can't tell anything what went wrong for you, without seeing the table.
Is your stock ROM running well?
And yes my Acro S is running well and almost stable with this ROM.
jamis66 said:
Hi hitman
My problem is the same as adiawie
Im save the installation table logs :
~ # fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 15.9 GB, 15925772288 bytes
4 heads, 16 sectors/track, 486016 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 477120 15243264 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
/dev/block/mmcblk0p14 42945 108480 2097152 83 Linux
/dev/block/mmcblk0p15 108481 477120 11796480 c Win95 FAT32 (LBA)
~ #
........
Command (m for help): d
Partition number (1-15): 15
Command (m for help): d
Partition number (1-14): 14
Command (m for help): n
First cylinder (769-477120, default 769): 49247
Last cylinder or +size or +sizeM or +sizeK (49247-477120, default 477120): 954240
Value is out of range
.........
Thank you for your help
Click to expand...
Click to collapse
Well, I think I can fix you!
USE below values while repartitioning and rest of the procedure is same.
For the FIRST CYLINDER : 42945
For LAST CYLINDER: 477120
Regards,
hitman-xda
hitman-xda said:
I can't tell anything what went wrong for you, without seeing the table.
Is your stock ROM running well?
And yes my Acro S is running well and almost stable with this ROM.
Click to expand...
Click to collapse
yes on stock rom everything run well.
this is the best way to get your partition back.
I tried bpaul 5.1.1 rom but internal storage and sd card still not detect
hitman-xda said:
Well, I think I can fix you!
USE below values while repartitioning and rest of the procedure is same.
For the FIRST CYLINDER : 42945
For LAST CYLINDER: 477120
Regards,
hitman-xda
Click to expand...
Click to collapse
Thanks for the help.
Successfully installed.
Very good work this. nAOSP 6.0 rom
Thank again!
adiawie said:
yes on stock rom everything run well.
this is the best way to get your partition back.
I tried bpaul 5.1.1 rom but internal storage and sd card still not detect
Click to expand...
Click to collapse
Thats nice!
Internal storage and sd card not detected? Do you mean it does not show in any file explorer? Also stock ROM is installed and running successfully?
jamis66 said:
Thanks for the help.
Successfully installed.
Very good work this. nAOSP 6.0 rom
Thank again!
Click to expand...
Click to collapse
That's Good! Enjoy MarshMallow!
hitman-xda said:
Install Minimal ADB and Fatboot into your Windows PC.
Now Switch off your Phone (ACRO S) and
Connect Phone in Fastboot Mode (Power button + Connect USB to PC)
(If phone shows BLUE LED lighten, then everything is going right! IF NOT then Check for Fastboot drivers into your PC)
Now IN PC Open nAOSP.zip and Extract recovery.img to Minimal ADB and Fastboot folder.
(must be installed in c:/program files (x86)/minimal adb and fastboot/keep here)
Open Minimal ADB and Fastboot and type below commands;
~fastboot devices
~fastboot flash boot recovery.img
~fastboot reboot
(Now your phone will restart in TWRP recovery)
[/B]
Click to expand...
Click to collapse
Thankyou for this guide Hitman, I am excited to try this on my XAS! I am getting stuck in the early stages of the guide though. I have 2x Acro S running BPaul 5.1.1. I have installed minimal ADB but when I run it the command prompt does not have a '~' symbol. I have tried to connect both phones in fastboot mode by holding the volume up key or also the power key but neither seems to work. I can get a blue light for a few seconds then the phone proceeds to boot to Google logo and battery indicator. I have tried running the first command '~fastboot devices' on both phones but nothing happens, no error message, no attempt or otherwise, it just goes to a new line of the command prompt. I have installed flashtool adb drivers. I am running Windows 10.
Do you have any idea what may be going wrong here?
Thanks!
glenb83 said:
Thankyou for this guide Hitman, I am excited to try this on my XAS! I am getting stuck in the early stages of the guide though. I have 2x Acro S running BPaul 5.1.1. I have installed minimal ADB but when I run it the command prompt does not have a '~' symbol. I have tried to connect both phones in fastboot mode by holding the volume up key or also the power key but neither seems to work. I can get a blue light for a few seconds then the phone proceeds to boot to Google logo and battery indicator. I have tried running the first command '~fastboot devices' on both phones but nothing happens, no error message, no attempt or otherwise, it just goes to a new line of the command prompt. I have installed flashtool adb drivers. I am running Windows 10.
Do you have any idea what may be going wrong here?
Thanks!
Click to expand...
Click to collapse
You don't have to write ' ~ ' symbol. That's not the part of the code.
Blue LED light for few seconds and phone boots! That's means you have to install fastboot drivers to your PC.
If some cases, try connecting USB to different ports of your PC.
You said you're using BPaul's 5.1.1
You should have know this. Still if you don't, check my below link for installing fastboot drivers;
http://forum.xda-developers.com/showpost.php?p=61045126&postcount=4
hitman-xda said:
You don't have to write ' ~ ' symbol. That's not the part of the code.
Blue LED light for few seconds and phone boots! That's means you have to install fastboot drivers to your PC.
If some cases, try connecting USB to different ports of your PC.
You said you're using BPaul's 5.1.1
You should have know this. Still if you don't, check my below link for installing fastboot drivers;
http://forum.xda-developers.com/showpost.php?p=61045126&postcount=4
Click to expand...
Click to collapse
Thanks,
I followed your guide but get the message "Google, Inc (WinUSB) - Install Failed" every time I try. If I look in device manager for the few seconds that the blue light is on I have a device under portable devices with an exclamation that says "S1Boot Fastboot".
It definitely seems to be a driver issue but I can't seem to get it resolved. I have tried pointing the driver directly but it says driver not found.
I will try from another computer in the next day or so.
hitman-xda said:
Thats nice!
Internal storage and sd card not detected? Do you mean it does not show in any file explorer? Also stock ROM is installed and running successfully?
That's Good! Enjoy MarshMallow!
Click to expand...
Click to collapse
now im enjoying MarshMallow.. thanks @mickybart and @hitman-xda
glenb83 said:
Thanks,
I followed your guide but get the message "Google, Inc (WinUSB) - Install Failed" every time I try. If I look in device manager for the few seconds that the blue light is on I have a device under portable devices with an exclamation that says "S1Boot Fastboot".
It definitely seems to be a driver issue but I can't seem to get it resolved. I have tried pointing the driver directly but it says driver not found.
I will try from another computer in the next day or so.
Click to expand...
Click to collapse
Better do it on windows 7/8.
Win10 is crap!
hitman-xda said:
Better do it on windows 7/8.
Win10 is crap!
Click to expand...
Click to collapse
it works for me in win10
@hitman-xda this rom running well on my acro but when connecting to pc internal storage & sd card not detect.
adiawie said:
@hitman-xda this rom running well on my acro but when connecting to pc internal storage & sd card not detect.
Click to expand...
Click to collapse
When you connect your phone to PC, at that time unlock your phone and drop down notification drawer and click on "USB for Charging" then click on "File Transfers".
hitman-xda said:
When you connect your phone to PC, at that time unlock your phone and drop down notification drawer and click on "USB for Charging" then click on "File Transfers".
Click to expand...
Click to collapse
many thanks to u... perfecto
hitman-xda said:
NOW ACTUAL REPARTITIONING STARTS:
In TWRP GoTo Mount -> uncheck everything (system,data,cache etc)
In PC in Minimal ADB and fastboot type below;
~adb shell
~fdisk-l /dev/block/mmcblk0
Now You'll see some information-table, just copy everything and keep safe. It'll help you.
NOW CONCENTRATE ON LAST TWO ROWS IN THAT INFO-TABLE
/dev/block/mmcblk0p14 49247 261695 7000024 83 Linux
/dev/block/mmcblk0p15 261696 954240 22161424 83 Linux
(Values for your phone may differ)
NOW type below command; (make sure VALUES IN SAME COLOR MATCHES ACCORDING TO YOURS)
fdisk /dev/block/mmcblk0
Command (m for help): p
Command (m for help): d
Partition number (1-15): 15
Command (m for help): d
Partition number (1-15): 14
Command (m for help): n
First Cylender (769-954240, default 769): 49247
Last cylinder or +size or +sizeM or +sizeK (49247-954240, default 954240): 954240
Command (m for help): t
Partition number (1-14): 14
Hex code (type L to list codes): 83
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table
YOU'll SEE A ERROR, JUST IGNORE IT
Once partition is Done. Just reboot device. JUST REBOOT!
DONE!
Click to expand...
Click to collapse
Hi Hitman,
I tried on an older Vista machine and I was able to boot to fastboot mode and install recovery, so that is progress! I have come across another problem now though... I have followed the guide and gone to recovery and unticked all mounted partitions, then when I type "adb shell" on the PC with the phone connected I get the error:
"error: device 'null' not found"
Have I missed something here?

softbrick Fire Tv in EDL/QDLoader 9008 mode

So I've got bricked AFTV 1st gen. It stuck on amazon logo then reboot in to black /grey flickering board .White led blink slowly . ADB via USB A-to-A adapter is not responding. USB keyboard didn't work. Few times It boot to QDLoader 9008 but no to QDLoader 9006 that was described on many occasions . I have downloaded 5.0.5 stock and 5.2.1.2 rooted .Also I did install qualcomm drivers and QFIL tool. Any steps to unbrick this box ?
steps should be like this https://forum.xda-developers.com/go...ualcomm-hs-t3043301/post59154061#post59154061 as I dint found any way to use QFIL . I assume that partition table and rawprogram0.xml will be needed exacly for 5.0.5 firmware .
Found Fire TV partition table
[[email protected]:~]$ sudo gdisk -l /dev/mmcblk0
GPT fdisk (gdisk) version 0.8.10
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/mmcblk0: 15269888 sectors, 7.3 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 98101B32-BBE2-4BF2-A06E-2BB33D000C20
Partition table holds up to 20 entries
First usable sector is 34, last usable sector is 15269854
Partitions will be aligned on 2-sector boundaries
Total free space is 0 sectors (0 bytes)
Number Start (sector) End (sector) Size Code Name
1 34 16417 8.0 MiB 8300 persist
2 16418 32801 8.0 MiB 8300 goldpersist
3 32802 65569 16.0 MiB 0700 modem
4 65570 65825 128.0 KiB FFFF sbl1
5 65826 66337 256.0 KiB FFFF sbl2
6 66338 67361 512.0 KiB FFFF sbl3
7 67362 68385 512.0 KiB FFFF tz
8 68386 69409 512.0 KiB FFFF rpm
9 69410 71457 1024.0 KiB FFFF aboot
10 71458 91937 10.0 MiB FFFF boot
11 91938 112417 10.0 MiB FFFF recovery
12 112418 177953 32.0 MiB 8300 diag
13 177954 180513 1.2 MiB 8300 splash480p
14 180514 186017 2.7 MiB 8300 splash720p
15 186018 198305 6.0 MiB 8300 splash1080p
16 198306 198321 8.0 KiB FFFF ssd
17 198322 200369 1024.0 KiB FFFF misc
18 200370 1773233 768.0 MiB 8300 system
19 1773234 3346097 768.0 MiB 8300 cache
20 3346098 15269854 5.7 GiB 8300 userdata
Click to expand...
Click to collapse
rawprogram0.xml is missing and need to be created manually . rawprogram0.xml and readable_partition.txt is an example of nexus 5 16GB implementation from above thread
does anyone with rooted 5.0.5 can provide me with files and confirm partition table ? I have some of those files from official 5.0.5 firmware package
I it possible to flash whole flash this way?
Is BoardDiag compatible to the fire TV? What AP Chipset are you going to select? My previous attempts with the software always gave me an error with partition.txt, although I've used a AFTV pt.bin..
Very curious to see the results of your attempts!
Any positive update on your attempts? I've tried so many things already, but unfortunately, I can't achieve any success. So many tutorials for unbricking Qualcomm chips, but so far, I haven't got a single advance with reflashing it or exiting the 9008 state.. :crying:
nicefile said:
steps should be like this https://forum.xda-developers.com/go...ualcomm-hs-t3043301/post59154061#post59154061 as I dint found any way to use QFIL . I assume that partition table and rawprogram0.xml will be needed exacly for 5.0.5 firmware .
Found Fire TV partition table
rawprogram0.xml is missing and need to be created manually . rawprogram0.xml and readable_partition.txt is an example of nexus 5 16GB implementation from above thread
does anyone with rooted 5.0.5 can provide me with files and confirm partition table ? I have some of those files from official 5.0.5 firmware package
I it possible to flash whole flash this way?
Click to expand...
Click to collapse
walkabouts said:
Any positive update on your attempts? I've tried so many things already, but unfortunately, I can't achieve any success. So many tutorials for unbricking Qualcomm chips, but so far, I haven't got a single advance with reflashing it or exiting the 9008 state.. :crying:
Click to expand...
Click to collapse
sorry to resurrect an old thread same here. I am on the same situation. any of you able to successfully recover or no chance of it? off all the devices in youtube and everywhere with unbricking tutorials and QFIL versions the fire tv is the only one missing. :-/
Its nearly 2019, and after all this time, there are - not to my knowledge - any instructions on how to ressucitate the original FTV on a 9008 state... Which is sad, because its still a very competent piece of hardware..
walkabouts said:
Its nearly 2019, and after all this time, there are - not to my knowledge - any instructions on how to ressucitate the original FTV on a 9008 state... Which is sad, because its still a very competent piece of hardware..
Click to expand...
Click to collapse
I've replaced my with stick 4k that can be found for 35Euro here . No need to look back . Also old 1st gen remote works great so don't have pull the plug from kids room

GUIDE: How to repartition for vendor and how to use GSIs

Guide to repartition your LG V30 to have a vendor partition
This guide is for people who are willing to repartition their V30 (Tested so far on my H930).
It will make your system partition smaller by 512MB, and create a vendor partition instead.
You will still have enough space for (full) stock ROMs too (they just ignore the new partition then)
Code:
#include "std_disclaimer.h"
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*/
What you need:
The scripts attached in the zip file
TWRP
A PC with working ADB (I doubt you wanna write everything in the TWRP command line)
Oreo firmware recommended (for LOS and GSIs)
Bravery
(should be quite safe though, as I did it myself, and know other people who did it)
Steps
Read this carefully before you execute it, twice! Make sure you understand every step. Learn it to the point of when i wake you up in the middle of the night, and ask you questions about it, you can answer instantly.
Boot into TWRP!!!
Make a backup of EVERYTHING on your phone (system, boot, recovery, data and so on)
Code:
The script will format system again, its important to backup!
Copy the contents of the .zip file to your phone
Open a command line/terminal on your PC (wherever you have access to ADB)
Connect your Phone to your PC
Everything now in command line/terminal
adb shell
cd /path/to/the/script/folder
Code:
e.g.
cd /external_sd/repartition/
./backup_gpt.sh
Code:
This will create a backup of your current gpt table on /external_sd/GPT_orig.bin
Code:
Todo this manually execute:
sgdisk /dev/block/sda --b=/path/to/GPT_orig.bin
./make_vendor.sh
Code:
Follow instructions on screen if you really wanna do this!
To apply the changes, remove the --pretend from the sgdisk commands! Otherwise it will just pretend to apply the changes (so you can check if it would fail or not)
(not an automatic script incase something goes wrong)
Reboot into recovery again
Restore your previous backup
How to revert the changes?
Do everything till step 7
./restore_gpt.sh
Code:
This will take the backup of your gpt table on /external_sd/GPT_orig.bin
Code:
Todo this manually execute:
sgdisk --load-backup=/path/to/GPT_orig.bin /dev/block/sda
Wipe system again
Flash a .kdz (Instructions case be found on XDA)
How to use a GSI (Generic System Image)
Make a backup of EVERYTHING on your phone (system, boot, recovery, data and so on)
Flash treble enabled lineage build: link
Wipe data (if it isnt)
Reboot into bootloader
in commandline/terminal:
fastboot flash system <name_of_gsi>.img
OPTIONAL:
fastboot boot <twrp>.img
Code:
fastboot doesnt provide a way to reboot to recovery directly, you can also optionally do the button dance
flash magisk/gapps
fastboot reboot
Thanks for the original script from here
what happens if it is partitioned and we flash a kdz using lg up (without reverting the partitions)?
iRS_ said:
what happens if it is partitioned and we flash a kdz using lg up (without reverting the partitions)?
Click to expand...
Click to collapse
I believe that it just changes the gpt to its original state, so if everything goes right, nothing will happen except you losing the vendor partition
Will this allow my US998 to be supported by the treble project?
AutinDroid said:
I believe that it just changes the gpt to its original state, so if everything goes right, nothing will happen except you losing the vendor partition
Click to expand...
Click to collapse
Yep, it should do that. The kdz rewrites your GPT, atleast it should. Doesnt contain that for nothing i suppose?
liushangrong said:
Will this allow my US998 to be supported by the treble project?
Click to expand...
Click to collapse
It should work also on your US998 to create a new partition. The treblelized ROM isnt yet built for the US998 though. Dont have any testers that could have tried it out on the US998.
SGCMarkus said:
Yep, it should do that. The kdz rewrites your GPT, atleast it should. Doesnt contain that for nothing i suppose?.
Click to expand...
Click to collapse
so if i make the changes i can safely flash a kdz and revert everything back to stock?
iRS_ said:
so if i make the changes i can safely flash a kdz and revert everything back to stock?
Click to expand...
Click to collapse
Should do the trick
Or, less hassle, you restore the GPT that you should backup before anyway (see guide) ^^
That also works.
i'm trying to repartition my v30+ (h930g).
i've succesfull backup my gpt, but i've problem when trying to format vendor. i have the following error:
/external_sd/repartition # make_ext4fs /dev/block/sda23
filesystem size too small
Click to expand...
Click to collapse
here is complete output:
/external_sd # cd repartition/
/external_sd/repartition #
/external_sd/repartition #
/external_sd/repartition # ./make_vendor.sh
/vendor missing
*********Resize /system to 1505792 = 1585541 - 79750 + 1 (inclusize) = 1505792
To really repartition, copy the following commands, and execute them
e2fsck -f /dev/block/bootdevice/by-name/system
resize2fs /dev/block/bootdevice/by-name/system 1505792
Setting name!
partNum is 17
REALLY setting name!
Setting name!
partNum is 22
REALLY setting name!
Disk /dev/block/sda: 31137792 sectors, 118.8 GiB
Logical sector size: 4096 bytes
Disk identifier (GUID): 98101B32-BBE2-4BF2-A06E-2BB33D000C20
Partition table holds up to 32 entries
First usable sector is 6, last usable sector is 31137786
Partitions will be aligned on 2-sector boundaries
Total free space is 0 sectors (0 bytes)
Number Start (sector) End (sector) Size Code Name
1 6 12293 48.0 MiB FFFF laf
2 12294 24581 48.0 MiB FFFF lafbak
3 24582 32773 32.0 MiB FFFF mpt
4 32774 35333 10.0 MiB FFFF drm
5 35334 36869 6.0 MiB FFFF sns
6 36870 37125 1024.0 KiB FFFF misc
7 37126 45317 32.0 MiB FFFF ftm
8 45318 62213 66.0 MiB FFFF factory
9 62214 62341 512.0 KiB FFFF encrypt
10 62342 62469 512.0 KiB FFFF eksst
11 62470 62597 512.0 KiB FFFF rct
12 62598 62725 512.0 KiB FFFF ssd
13 62726 62853 512.0 KiB FFFF keystore
14 62854 71045 32.0 MiB FFFF persist
15 71046 73093 8.0 MiB FFFF srtc
16 73094 79237 24.0 MiB FFFF qni
17 79238 79749 2.0 MiB FFFF pstore
18 79750 1585541 5.7 GiB 8300 system
19 1716614 1847685 512.0 MiB FFFF cache
20 1847686 1935749 344.0 MiB 0700 OP
21 1935750 31137785 111.4 GiB FFFF userdata
22 31137786 31137786 4.0 KiB FFFF grow
23 1585542 1716613 512.0 MiB 8300 vendor
sgdisk --pretend --delete=18 --new=18:79750:1585541 --change-name=18:system --new=23:1585542:1716613 --change-name=23:vendor --print /dev/block/sda
This will format system and vendor again, so it can be used
make_ext4fs /dev/block/sda18
make_ext4fs /dev/block/sda23
/external_sd/repartition # e2fsck -f /dev/block/bootdevice/by-name/system
e2fsck 1.43.3 (04-Sep-2016)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
system: 9726/403200 files (0.0% non-contiguous), 1229698/1611326 blocks
/external_sd/repartition # resize2fs /dev/block/bootdevice/by-name/system 1505792
resize2fs 1.43.3 (04-Sep-2016)
Resizing the filesystem on /dev/block/bootdevice/by-name/system to 1505792 (4k) blocks.
The filesystem on /dev/block/bootdevice/by-name/system is now 1505792 (4k) blocks long.
/external_sd/repartition # sgdisk --pretend --delete=18 --new=18:79750:1585541 --change-name=18:system --new=23:1585542:1716613 --change-name=23:vendor --print /dev/block/sda
Setting name!
partNum is 17
REALLY setting name!
Setting name!
partNum is 22
REALLY setting name!
Disk /dev/block/sda: 31137792 sectors, 118.8 GiB
Logical sector size: 4096 bytes
Disk identifier (GUID): 98101B32-BBE2-4BF2-A06E-2BB33D000C20
Partition table holds up to 32 entries
First usable sector is 6, last usable sector is 31137786
Partitions will be aligned on 2-sector boundaries
Total free space is 0 sectors (0 bytes)
Number Start (sector) End (sector) Size Code Name
1 6 12293 48.0 MiB FFFF laf
2 12294 24581 48.0 MiB FFFF lafbak
3 24582 32773 32.0 MiB FFFF mpt
4 32774 35333 10.0 MiB FFFF drm
5 35334 36869 6.0 MiB FFFF sns
6 36870 37125 1024.0 KiB FFFF misc
7 37126 45317 32.0 MiB FFFF ftm
8 45318 62213 66.0 MiB FFFF factory
9 62214 62341 512.0 KiB FFFF encrypt
10 62342 62469 512.0 KiB FFFF eksst
11 62470 62597 512.0 KiB FFFF rct
12 62598 62725 512.0 KiB FFFF ssd
13 62726 62853 512.0 KiB FFFF keystore
14 62854 71045 32.0 MiB FFFF persist
15 71046 73093 8.0 MiB FFFF srtc
16 73094 79237 24.0 MiB FFFF qni
17 79238 79749 2.0 MiB FFFF pstore
18 79750 1585541 5.7 GiB 8300 system
19 1716614 1847685 512.0 MiB FFFF cache
20 1847686 1935749 344.0 MiB 0700 OP
21 1935750 31137785 111.4 GiB FFFF userdata
22 31137786 31137786 4.0 KiB FFFF grow
23 1585542 1716613 512.0 MiB 8300 vendor
/external_sd/repartition # make_ext4fs /dev/block/sda18
Creating filesystem with parameters:
Size: 6704594944
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 25576
Label:
Blocks: 1636864
Block groups: 50
Reserved block group size: 399
Created filesystem with 11/409600 inodes and 54888/1636864 blocks
/external_sd/repartition #
/external_sd/repartition #
/external_sd/repartition # make_ext4fs /dev/block/sda23
filesystem size too small
Click to expand...
Click to collapse
what i'm wrong?
Having the same issue here
HD1999 said:
Having the same issue here
Click to expand...
Click to collapse
do you own a h930(64gb) or h930g(128gb)?
I own a H930
ah ok, so this happen on 64gb version too
Hmm...
Ok, forgot to add a message to the script ?
you have to remove the --pretend from the commands, otherwise it will just do like it does it, without actually doing it (to see if everything will work the way it should before actually applying the changes)
sorry about that
SGCMarkus said:
Hmm...
Ok, forgot to add a message to the script
you have to remove the --pretend from the commands, otherwise it will just do like it does it, without actually doing it (to see if everything will work the way it should before actually applying the changes)
sorry about that
Click to expand...
Click to collapse
EDIT: i reboted into recovery again and i was able to format /vendor. is normal that i can see vendor partition in backup section of twrp?
now i'm going to flash yoru los
hi markus, i figure it reading the script, but same error here!
this is the comannd ì execute after run ./make_vendor.sh:
e2fsck -f /dev/block/bootdevice/by-name/system
resize2fs /dev/block/bootdevice/by-name/system 1505792
sgdisk --delete=18 --new=18:79750:1585541 --change-name=18:system --new=23:1585542:1716613 --change-name=23:vendor --print /dev/block/sda
make_ext4fs /dev/block/sda18
make_ext4fs /dev/block/sda23
i ran the script and the command above ehn the phone are in twrp(assuming is right to do this!)
okaiuz said:
EDIT: i reboted into recovery again and i was able to format /vendor. is normal that i can see vendor partition in backup section of twrp?
now i'm going to flash yoru los
Click to expand...
Click to collapse
Will also add this, to reboot into recovery again then
Glad it worked. And ehhm, i dont think its normal that TWRP sees it for backups? But if it does, no need for a new TWRP (tbh, during all my testings, i didnt check this, or didnt look if vendor is there or not)
i restore the original gpt and i start from ascratch.
iin restore_gpt.sh you have to change "external_SD" to "external_sd"
don't think need to rebbot, after restoring original gpt, and execute above command, formatting /vendor work on first run!
another problem...i'm trying to flash your los(non treblelized) but i receive:
Updater process ended with ERROR: 7
I:Install took 0 second(s).
Error installing zip file '/sdcard/Download/lineage-15.1-20180516-UNOFFICIAL-h930.zip'
Updating partition details...
Failed to mount '/system' (Invalid argument)
full log attached
okaiuz said:
i restore the original gpt and i start from ascratch.
iin restore_gpt.sh you have to change "external_SD" to "external_sd"
don't think need to rebbot, after restoring original gpt, and execute above command, formatting /vendor work on first run!
another problem...i'm trying to flash your los(non treblelized) but i receive:
Updater process ended with ERROR: 7
I:Install took 0 second(s).
Error installing zip file '/sdcard/Download/lineage-15.1-20180516-UNOFFICIAL-h930.zip'
Updating partition details...
Failed to mount '/system' (Invalid argument)
full log attached
Click to expand...
Click to collapse
EDIT: maybe related to content of META-INF/com/google/android/updater-script file?
i see this :
assert(getprop("ro.product.device") == "v30" || getprop("ro.build.product") == "v30" ||
getprop("ro.product.device") == "joan" || getprop("ro.build.product") == "joan" ||
getprop("ro.product.device") == "h930" || getprop("ro.build.product") == "h930" || abort("E3004: This package is for device: v30,joan,h930; this device is " +
Click to expand...
Click to collapse
my device is h930g, same as h930 but with 128gb of rom (also called v30+). i check with adb and my device show this values:
[ro.build.product]: [joan]
[ro.product.device]: [joan]
okaiuz said:
i restore the original gpt and i start from ascratch.
iin restore_gpt.sh you have to change "external_SD" to "external_sd"
don't think need to rebbot, after restoring original gpt, and execute above command, formatting /vendor work on first run!
another problem...i'm trying to flash your los(non treblelized) but i receive:
Updater process ended with ERROR: 7
I:Install took 0 second(s).
Error installing zip file '/sdcard/Download/lineage-15.1-20180516-UNOFFICIAL-h930.zip'
Updating partition details...
Failed to mount '/system' (Invalid argument)
full log attached
Click to expand...
Click to collapse
Seems like you need to reboot inbetween, or try to format /system before flashing?
I dont encounter that problem :/
SGCMarkus said:
Seems like you need to reboot inbetween, or try to format /system before flashing?
I dont encounter that problem :/
Click to expand...
Click to collapse
i've made several test on it...wiping system data cache & art, reflash your recovery,format system in recovery & via adb..
The only thoing i haven't tested is to flash full kdz and then repartition.
i don't know if this can be useful for debugging,but when i've switched to oreo i don't flash full kdz, but the twrp flashable rom found on v30 section of xda
okaiuz said:
i've made several test on it...wiping system data cache & art, reflash your recovery,format system in recovery & via adb..
The only thoing i haven't tested is to flash full kdz and then repartition.
i don't know if this can be useful for debugging,but when i've switched to oreo i don't flash full kdz, but the twrp flashable rom found on v30 section of xda
Click to expand...
Click to collapse
Hm... that shouldnt matter actually. Its a weird behaviour though you have there. Can you "tick" system in the mount options of TWRP? if no, send me a log of that too. This seems really weird to me.

Unable to Fastboot flash system.img

Tried two offical Xiaomi fastboot Pie images, and system.img doesn't flash. Other smaller in size system images I flashed to see what would happen do go through, but they don't work. Pie image is 2.1 GB. Other partitions are all flashed.
Each attempt via Xiaomi flash tool ends with: Chunk data size exceeds partition size.
Log:
$fastboot -s 08f97d930705 flash system_a C:\XiaoMi\XiaoMiFlash\Source\ThirdParty\Google\Android\daisy_global_images_V10.0.10.0.PDLMIXM_9.0\\images\system.img ||
[10:26:06 AM 08f97d930705]:target reported max download size of 534773760 bytes
[10:26:06 AM 08f97d930705]:sending sparse 'system_a' 1/3 (462332 KB)...
[10:26:06 AM 08f97d930705]KAY [ 59.062s]
[10:26:06 AM 08f97d930705]:writing 'system_a' 1/3...
[10:26:06 AM 08f97d930705]:error:FAILED (remote: Chunk data size exceeds partition size)
[10:26:06 AM 08f97d930705]:flashSuccess False
Fastboot flash_all.bat gives:
fastboot getvar product 2>&1 | findstr /r /c:"^product: *d
aisy" ||
The system cannot find message text for message number 0x8 in the message file f
or System.
Fastboot flash system sends sparse chunks and gives:
data too large
So, what gives? Any ideas greatly appreciated.
MarkR7 said:
Tried two offical Xiaomi fastboot Pie images, and system.img doesn't flash. Other smaller in size system images I flashed to see what would happen do go through, but they don't work. Pie image is 2.1 GB. Other partitions are all flashed.
Each attempt via Xiaomi flash tool ends with: Chunk data size exceeds partition size.
Log:
$fastboot -s 08f97d930705 flash system_a C:\XiaoMi\XiaoMiFlash\Source\ThirdParty\Google\Android\daisy_global_images_V10.0.10.0.PDLMIXM_9.0\\images\system.img ||
[10:26:06 AM 08f97d930705]:target reported max download size of 534773760 bytes
[10:26:06 AM 08f97d930705]:sending sparse 'system_a' 1/3 (462332 KB)...
[10:26:06 AM 08f97d930705]KAY [ 59.062s]
[10:26:06 AM 08f97d930705]:writing 'system_a' 1/3...
[10:26:06 AM 08f97d930705]:error:FAILED (remote: Chunk data size exceeds partition size)
[10:26:06 AM 08f97d930705]:flashSuccess False
Fastboot flash_all.bat gives:
fastboot getvar product 2>&1 | findstr /r /c:"^product: *d
aisy" ||
The system cannot find message text for message number 0x8 in the message file f
or System.
Fastboot flash system sends sparse chunks and gives:
data too large
So, what gives? Any ideas greatly appreciated.
Click to expand...
Click to collapse
It could be an error from the tool or maybe you need to delete some logs that can cause a conflict anyway did you try using just fastboot command to flash just system? if not trying finding which is your current slot and then flash it directly to it.
I guess size image support is around 2,5GB.
SubwayChamp said:
It could be an error from the tool or maybe you need to delete some logs that can cause a conflict anyway did you try using just fastboot command to flash just system? if not trying finding which is your current slot and then flash it directly to it.
I guess size image support is around 2,5GB.
Click to expand...
Click to collapse
I direct fastboot flashed system multiple times, also flash all bat, I also restored Oeeo from TWRP backup multiple timea, Oreo working fine, now that I think of it, Mi Flash tool seems to be from 2017 and it seems old to me, I got it from their link somewhere, but could the newest one be that old? Need to check that.
MarkR7 said:
I direct fastboot flashed system multiple times, also flash all bat, I also restored Oeeo from TWRP backup multiple timea, Oreo working fine, now that I think of it, Mi Flash tool seems to be from 2017 and it seems old to me, I got it from their link somewhere, but could the newest one be that old? Need to check that.
Click to expand...
Click to collapse
This seems to be the latest stable version https://c.mi.com/thread-1329226-1-0.html and although this is newer use the tool from 2017 but ever worked for me https://xiaomifirmware.com/downloads/mif anyway you have too the option to flash through edl
I think someone had a problem due to fastboot being too old.
The partition should be 2.5Gb so unless you or someone else resized partitions, it should be large enough.
I can use fdisk from a running phone to print partition info. If you can't boot, perhaps you can check from twrp?
Code:
# fdisk /dev/block/mmcblk0
Found valid GPT with protective MBR; using GPT
Command (m for help): p
Disk /dev/block/mmcblk0: 122142720 sectors, 2296M
Logical sector size: 512
Disk identifier (GUID): 98101b32-bbe2-4bf2-a06e-2bb33d000c20
Partition table holds up to 60 entries
First usable sector is 34, last usable sector is 122142686
Number Start (sector) End (sector) Size Name
1 34 49 8192 fsc
2 50 65 8192 ssd
3 66 81 8192 dpo
4 82 113 16384 sec
5 114 145 16384 bk1
6 146 185 20480 bk2
7 186 249 32768 DDR
8 250 313 32768 limits
9 314 377 32768 config
10 378 505 65536 bk3
11 506 761 128K lksecapp
12 762 1017 128K lksecappbak
13 1018 1529 256K devcfg_a
14 1530 2041 256K devcfg_b
15 2042 2553 256K apdp
16 2554 3065 256K msadp
17 3066 4089 512K sbl1_a
18 4090 5113 512K sbl1_b
19 5114 6137 512K rpm_a
20 6138 7161 512K rpm_b
21 7162 8185 512K mota
22 8186 9209 512K keystore
23 9210 10233 512K syscfg
24 10234 12281 1024K cmnlib_a
25 12282 14329 1024K cmnlib_b
26 14330 16377 1024K cmnlib64_a
27 16378 18425 1024K cmnlib64_b
28 18426 20473 1024K keymaster_a
29 20474 22521 1024K keymaster_b
30 22522 24569 1024K misc
31 24570 26617 1024K aboot_a
32 26618 28665 1024K aboot_b
33 28666 30713 1024K dip
34 30714 32761 1024K bk4
35 32762 36857 2048K tz_a
36 36858 40953 2048K tz_b
37 40954 49145 4096K mcfg
38 49146 65529 8192K devinfo
39 65530 81913 8192K fsg
40 81914 98297 8192K modemst1
41 98298 114681 8192K modemst2
42 114682 131065 8192K bk5
43 131066 163833 16.0M splash
44 163834 196601 16.0M dsp_a
45 196602 229369 16.0M dsp_b
46 229370 262137 16.0M bk6
47 262138 327673 32.0M mdtp_a
48 327674 393209 32.0M mdtp_b
49 393210 458745 32.0M persist
50 458746 524281 32.0M persistbak
51 524288 655359 64.0M boot_a
52 655360 786431 64.0M boot_b
53 786432 917503 64.0M logdump
54 917504 1179647 128M modem_a
55 1179648 1441791 128M modem_b
56 1441792 6684671 2560M system_a
57 6684672 11927551 2560M system_b
58 11927552 13500415 768M vendor_a
59 13500416 15073279 768M vendor_b
60 15073280 122142686 51.0G userdata
Command (m for help): q
a1291762 said:
I think someone had a problem due to fastboot being too old.
The partition should be 2.5Gb so unless you or someone else resized partitions, it should be large enough.
I can use fdisk from a running phone to print partition info. If you can't boot, perhaps you can check from twrp?
Code:
# fdisk /dev/block/mmcblk0
Found valid GPT with protective MBR; using GPT
Command (m for help): p
Disk /dev/block/mmcblk0: 122142720 sectors, 2296M
Logical sector size: 512
Disk identifier (GUID): 98101b32-bbe2-4bf2-a06e-2bb33d000c20
Partition table holds up to 60 entries
First usable sector is 34, last usable sector is 122142686
Number Start (sector) End (sector) Size Name
1 34 49 8192 fsc
2 50 65 8192 ssd
3 66 81 8192 dpo
4 82 113 16384 sec
5 114 145 16384 bk1
6 146 185 20480 bk2
7 186 249 32768 DDR
8 250 313 32768 limits
9 314 377 32768 config
10 378 505 65536 bk3
11 506 761 128K lksecapp
12 762 1017 128K lksecappbak
13 1018 1529 256K devcfg_a
14 1530 2041 256K devcfg_b
15 2042 2553 256K apdp
16 2554 3065 256K msadp
17 3066 4089 512K sbl1_a
18 4090 5113 512K sbl1_b
19 5114 6137 512K rpm_a
20 6138 7161 512K rpm_b
21 7162 8185 512K mota
22 8186 9209 512K keystore
23 9210 10233 512K syscfg
24 10234 12281 1024K cmnlib_a
25 12282 14329 1024K cmnlib_b
26 14330 16377 1024K cmnlib64_a
27 16378 18425 1024K cmnlib64_b
28 18426 20473 1024K keymaster_a
29 20474 22521 1024K keymaster_b
30 22522 24569 1024K misc
31 24570 26617 1024K aboot_a
32 26618 28665 1024K aboot_b
33 28666 30713 1024K dip
34 30714 32761 1024K bk4
35 32762 36857 2048K tz_a
36 36858 40953 2048K tz_b
37 40954 49145 4096K mcfg
38 49146 65529 8192K devinfo
39 65530 81913 8192K fsg
40 81914 98297 8192K modemst1
41 98298 114681 8192K modemst2
42 114682 131065 8192K bk5
43 131066 163833 16.0M splash
44 163834 196601 16.0M dsp_a
45 196602 229369 16.0M dsp_b
46 229370 262137 16.0M bk6
47 262138 327673 32.0M mdtp_a
48 327674 393209 32.0M mdtp_b
49 393210 458745 32.0M persist
50 458746 524281 32.0M persistbak
51 524288 655359 64.0M boot_a
52 655360 786431 64.0M boot_b
53 786432 917503 64.0M logdump
54 917504 1179647 128M modem_a
55 1179648 1441791 128M modem_b
56 1441792 6684671 2560M system_a
57 6684672 11927551 2560M system_b
58 11927552 13500415 768M vendor_a
59 13500416 15073279 768M vendor_b
60 15073280 122142686 51.0G userdata
Command (m for help): q
Click to expand...
Click to collapse
I don't know what the hell is going on. Just tried to flash again with newer late 2018 Xiaomi Flash tool and included fastboot. This time the thing didn't run erase commands before flashing partitions and ended up with the same Chunk Size Data exceeds partition size error. I restored to Oreo from my TWRP backups. TWRP shows partition size as normal 2.5 GB. Never touched the partition table. Smaller GSI images flash in there. Oreo is 1.7 GB, I think, it restores. On Oreo everything works, encryption disabler, Magisk. Just can't flash the lousy official Pie system, tried 10.0.03.0 Whatever, tried 10.0.10 from June, same thing. Somebody suggested I convert to ext4 image, but why the hell does it not just work? Like it can't handle the size of the system image somehow. Will try your commands, thanks. Maybe even newer Xiaomi tool. Damn
Thanks for help.
What is really bloody funny is I have puny Redmi Go running Lineage 16 and all set up without any trouble. Just hilarious.
MarkR7 said:
I don't know what the hell is going on. Just tried to flash again with newer late 2018 Xiaomi Flash tool and included fastboot. This time the thing didn't run erase commands before flashing partitions and ended up with the same Chunk Size Data exceeds partition size error. I restored to Oreo from my TWRP backups. TWRP shows partition size as normal 2.5 GB. Never touched the partition table. Smaller GSI images flash in there. Oreo is 1.7 GB, I think, it restores. On Oreo everything works, encryption disabler, Magisk. Just can't flash the lousy official Pie system, tried 10.0.03.0 Whatever, tried 10.0.10 from June, same thing. Somebody suggested I convert to ext4 image, but why the hell does it not just work? Like it can't handle the size of the system image somehow. Will try your commands, thanks. Maybe even newer Xiaomi tool. Damn
Thanks for help.
What is really bloody funny is I have puny Redmi Go running Lineage 16 and all set up without any trouble. Just hilarious.
Click to expand...
Click to collapse
Try the latest rom http://bigota.d.miui.com/V10.0.12.0...0.PDLMIXM_20190717.0000.00_9.0_59368ef014.tgz and try it using edl, edl is a lower level than fastboot and probably might work better.
edl flash fail - identical to fastboot
SubwayChamp said:
Try the latest rom http://bigota.d.miui.com/V10.0.12.0...0.PDLMIXM_20190717.0000.00_9.0_59368ef014.tgz and try it using edl, edl is a lower level than fastboot and probably might work better.
Click to expand...
Click to collapse
This thing is impossible. EDL flash fails the same way, at about the same time in the flash process. Just says error and maybe the device got disconnected. It did not.
Since I got the phone recently, I never run any OTA updates on it and it's on the lastest Oreo 9.6.11 before 10.0.2.0 Pie. System partition is actually 2.4 GB and Vendor is also slightly smaller than a1291762's partition size. Could it be they increased partitio sizes during 10.0.2.0 Pie update and not applying/skipping that update causes the trouble? Honestly I have no idea, anybody who can make something out of this? Should I run 10.0.2.0 to see if it changes partitions? Or does skipping that update cause trouble for some other unfathomable reason? I will just try OTA sooner or later, I guess.
Here's the output:
daisy_sprout:/ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/block/mmcblk0p56 2.4G 1.6G 751M 70% /system_root
tmpfs 1.7G 1.4M 1.7G 1% /sbin
tmpfs 1.7G 712K 1.7G 1% /dev
/dev/block/mmcblk0p58 744M 555M 174M 77% /vendor
tmpfs 1.7G 0 1.7G 0% /mnt
/dev/block/mmcblk0p49 27M 2.7M 24M 11% /persist
/dev/block/mmcblk0p54 128M 81M 47M 63% /firmware
/dev/block/mmcblk0p44 12M 6.9M 4.5M 61% /dsp
/sbin/.magisk/block/data 50G 808M 49G 2% /sbin/.magisk/modules
/data/media 50G 808M 49G 2% /storage/emulated
/mnt/media_rw/0403-0201 29G 28G 712M 98% /storage/0403-0201
daisy_sprout:/ $ df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/block/mmcblk0p56 2539312 1754068 768860 70% /system_root
tmpfs 1821960 1500 1820460 1% /sbin
tmpfs 1821960 712 1821248 1% /dev
/dev/block/mmcblk0p58 761776 567948 178100 77% /vendor
tmpfs 1821960 0 1821960 0% /mnt
/dev/block/mmcblk0p49 28144 2772 24720 11% /persist
/dev/block/mmcblk0p54 131008 82464 48544 63% /firmware
/dev/block/mmcblk0p44 12016 7072 4620 61% /dsp
/sbin/.magisk/block/data 52562448 827192 51718872 2% /sbin/.magisk/modules
MarkR7 said:
This thing is impossible. EDL flash fails the same way, at about the same time in the flash process. Just says error and maybe the device got disconnected. It did not.
Since I got the phone recently, I never run any OTA updates on it and it's on the lastest Oreo 9.6.11 before 10.0.2.0 Pie. System partition is actually 2.4 GB and Vendor is also slightly smaller than a1291762's partition size. Could it be they increased partitio sizes during 10.0.2.0 Pie update and not applying/skipping that update causes the trouble? Honestly I have no idea, anybody who can make something out of this? Should I run 10.0.2.0 to see if it changes partitions? Or does skipping that update cause trouble for some other unfathomable reason? I will just try OTA sooner or later, I guess.
Here's the output:
daisy_sprout:/ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/block/mmcblk0p56 2.4G 1.6G 751M 70% /system_root
tmpfs 1.7G 1.4M 1.7G 1% /sbin
tmpfs 1.7G 712K 1.7G 1% /dev
/dev/block/mmcblk0p58 744M 555M 174M 77% /vendor
tmpfs 1.7G 0 1.7G 0% /mnt
/dev/block/mmcblk0p49 27M 2.7M 24M 11% /persist
/dev/block/mmcblk0p54 128M 81M 47M 63% /firmware
/dev/block/mmcblk0p44 12M 6.9M 4.5M 61% /dsp
/sbin/.magisk/block/data 50G 808M 49G 2% /sbin/.magisk/modules
/data/media 50G 808M 49G 2% /storage/emulated
/mnt/media_rw/0403-0201 29G 28G 712M 98% /storage/0403-0201
daisy_sprout:/ $ df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/block/mmcblk0p56 2539312 1754068 768860 70% /system_root
tmpfs 1821960 1500 1820460 1% /sbin
tmpfs 1821960 712 1821248 1% /dev
/dev/block/mmcblk0p58 761776 567948 178100 77% /vendor
tmpfs 1821960 0 1821960 0% /mnt
/dev/block/mmcblk0p49 28144 2772 24720 11% /persist
/dev/block/mmcblk0p54 131008 82464 48544 63% /firmware
/dev/block/mmcblk0p44 12016 7072 4620 61% /dsp
/sbin/.magisk/block/data 52562448 827192 51718872 2% /sbin/.magisk/modules
Click to expand...
Click to collapse
Eventually a failed update can do some weird things like this but is unusual or rarely heard.
Don´t wait that OTA comes to your device, choose one from the official site to be flashed through stock recovery if you have some hope that this help.
Also then to try this in TWRP there is an option to restore system partition (I´m not sure if this really works)
And as a last resource maybe you might to re-adjust the size partition http://en.miui.com/thread-183258-1-1.html
OTA ROM update
Thanks for all advice, really appreciated. I got a zillion backups thru TWRP and those not working fastboot ROMs. I am on a crappy limited mobile connection right now and need to get wifi to get all the ROMs, so preferred to store them locally on a laptop, but should have just run an OTA straight away. Anyway, am back on original stock Oreo, fully stock boot system everything. Have last August 10.13 OTA rom zip and wonder how the hell to try that one. Nothing under system update that would let me use locally stored OTA ROM. Renaming it to update.zip and putting in root of internal storage doesn't seem to work for stock recovery.
Never mind. found a way. Still craps out. Says error in package zip Status 1 whatever the hell that is. Thanks anyway.
MarkR7 said:
Thanks for all advice, really appreciated. I got a zillion backups thru TWRP and those not working fastboot ROMs. I am on a crappy limited mobile connection right now and need to get wifi to get all the ROMs, so preferred to store them locally on a laptop, but should have just run an OTA straight away. Anyway, am back on original stock Oreo, fully stock boot system everything. Have last August 10.13 OTA rom zip and wonder how the hell to try that one. Nothing under system update that would let me use locally stored OTA ROM. Renaming it to update.zip and putting in root of internal storage doesn't seem to work for stock recovery.
Never mind. found a way. Still craps out. Says error in package zip Status 1 whatever the hell that is. Thanks anyway.
Click to expand...
Click to collapse
Update from internal storage and from adb sideload are available on stock recovery. Unfortunately TWRP can´t flash stock updates like on other Xiaomi devices using Miui.
Probably you might try the Miui rom ported available in this forum https://forum.xda-developers.com/mi-a2-lite/development/9-miui-rom-t3960704, system image has almost 2,40GB (version 1.1)
Stocl Recovery
SubwayChamp said:
Update from internal storage and from adb sideload are available on stock recovery. Unfortunately TWRP can´t flash stock updates like on other Xiaomi devices using Miui.
Probably you might try the Miui rom ported available in this forum https://forum.xda-developers.com/mi-a2-lite/development/9-miui-rom-t3960704, system image has almost 2,40GB (version 1.1)
Click to expand...
Click to collapse
You don't unserstand. I DO have stock recovery om both slots, everything as stock as possible. Had Full backups and restored them, boot images also. It is stock recovery that gives the error. Supposedly Status 1 has sth to do with setting permissions, but thanks anyway.
EDL finally worked, many thanks for help
:laugh:
SubwayChamp said:
Update from internal storage and from adb sideload are available on stock recovery. Unfortunately TWRP can´t flash stock updates like on other Xiaomi devices using Miui.
Probably you might try the Miui rom ported available in this forum https://forum.xda-developers.com/mi-a2-lite/development/9-miui-rom-t3960704, system image has almost 2,40GB (version 1.1)
Click to expand...
Click to collapse
:fingers-crossed:
After some fails, EDL flash finally worked and the phone is now on Pie. Many thanks for the suggestion. For some seconds after flash I thought it was a total brick, but I think it must have been exiting EDL. Normal fastboot flash of system.img failed each time.
Again, many thanks for help and time you took.

How To Guide Resize internal storage on Xiaomi Pad 5 (nabu) and install PostmarketOS Preview

!!!!!DISCLAIMER!!!!!! --- below info is provided as is without any warranty, do it on your own risk
!!!BACKUP!!! !!!BACKUP!!! !!!BACKUP!!!
This procedure alter your userdata partition and you will lose anything if you do not do a backup.
_______________________________
Donate a coffee to support development:
Donate via PayPal to serdeliuk
Please carefully read all steps twice and be sure you understand them, the last part explains why you may want to have some free/unused space in the end.
0. Your device should be unlocked with Xiaomi
1. Developer options should be enabled
2. Check your MIUI version and download a stock image to have at hand all the original images in case you may need them.
For example is easy to forget to switch the slot a/b and write the wrong slot and break your device boot to android.
3. Reboot to OrangeFOX
- Download OrangeFOX image, please read this thread [UNOFFICIAL] Xiaomi Pad 5 nabu OrangeFox/TWRP recovery
- adb reboot bootloader
- fastboot boot xiaomi-nabu-orangefox.img
- adb shell
- review your partitions: ls -la /dev/block/bootdevice/by-name/
- we are interested in userdata partition location, in the below output we can see that is on /dev/block/sda device and it is the 31th partition on that device.
Code:
sh-5.0# ls -l /dev/block/bootdevice/by-name/ | grep userdata
lrwxrwxrwx 1 root root 16 1970-04-30 14:11 userdata -> /dev/block/sda31
4. Use parted against the /dev/block/sda device and print some info about partitions
Code:
sh-5.0# parted /dev/block/sda
GNU Parted 3.3
Using /dev/block/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
At the parted prompt, type print to see partitions on /dev/block/sda
Code:
(parted) print
print
Model: SAMSUNG KLUDG4UHDC-B0E1 (scsi)
Disk /dev/block/sda: 126GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 24.6kB 32.8kB 8192B switch
2 32.8kB 65.5kB 32.8kB ssd
3 65.5kB 98.3kB 32.8kB dbg
4 98.3kB 131kB 32.8kB bk01
5 131kB 262kB 131kB bk02
6 262kB 524kB 262kB bk03
7 524kB 1049kB 524kB bk04
8 1049kB 1573kB 524kB keystore
9 1573kB 2097kB 524kB frp
10 2097kB 4194kB 2097kB countrycode
11 4194kB 8389kB 4194kB misc
12 8389kB 12.6MB 4194kB vm-data
13 12.6MB 16.8MB 4194kB bk06
14 16.8MB 25.2MB 8389kB logfs
15 25.2MB 33.6MB 8389kB ffu
16 33.6MB 50.3MB 16.8MB oops
17 50.3MB 67.1MB 16.8MB devinfo
18 67.1MB 83.9MB 16.8MB oem_misc1
19 83.9MB 101MB 16.8MB ext4 metadata
20 101MB 134MB 32.9MB bk08
21 134MB 168MB 34.2MB splash
22 168MB 201MB 33.6MB bk09
23 201MB 9328MB 9127MB super
24 9328MB 9328MB 131kB vbmeta_system_a
25 9328MB 9328MB 131kB vbmeta_system_b
26 9328MB 9396MB 67.1MB logdump
27 9396MB 9530MB 134MB minidump
28 9530MB 9664MB 134MB rawdump
29 9664MB 10.7GB 1074MB ext4 cust
30 10.7GB 10.9GB 134MB ext4 rescue
31 10.9GB 126GB 115GB userdata
5. Remove userdata partition, double check the partition's number THIS COMMAND DO NOT ASK FOR CONFIRMATION, BE SURE YOU DID A BACKUP OF YOUR DATA
Code:
(parted) rm 31
rm 31
And check the result
Code:
(parted) print
print
Model: SAMSUNG KLUDG4UHDC-B0E1 (scsi)
Disk /dev/block/sda: 126GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 24.6kB 32.8kB 8192B switch
2 32.8kB 65.5kB 32.8kB ssd
3 65.5kB 98.3kB 32.8kB dbg
4 98.3kB 131kB 32.8kB bk01
5 131kB 262kB 131kB bk02
6 262kB 524kB 262kB bk03
7 524kB 1049kB 524kB bk04
8 1049kB 1573kB 524kB keystore
9 1573kB 2097kB 524kB frp
10 2097kB 4194kB 2097kB countrycode
11 4194kB 8389kB 4194kB misc
12 8389kB 12.6MB 4194kB vm-data
13 12.6MB 16.8MB 4194kB bk06
14 16.8MB 25.2MB 8389kB logfs
15 25.2MB 33.6MB 8389kB ffu
16 33.6MB 50.3MB 16.8MB oops
17 50.3MB 67.1MB 16.8MB devinfo
18 67.1MB 83.9MB 16.8MB oem_misc1
19 83.9MB 101MB 16.8MB ext4 metadata
20 101MB 134MB 32.9MB bk08
21 134MB 168MB 34.2MB splash
22 168MB 201MB 33.6MB bk09
23 201MB 9328MB 9127MB super
24 9328MB 9328MB 131kB vbmeta_system_a
25 9328MB 9328MB 131kB vbmeta_system_b
26 9328MB 9396MB 67.1MB logdump
27 9396MB 9530MB 134MB minidump
28 9530MB 9664MB 134MB rawdump
29 9664MB 10.7GB 1074MB ext4 cust
30 10.7GB 10.9GB 134MB ext4 rescue
6. Note the end of the last partition in the above list, 10.9GB, this number will be used as the start of the new userdata partition, followed by the end of the partition.
Let say that we want to make an approx 40GB userdata partititon using the following command:
NOTE, between userdata and 10.9GB are 3 spaces, one of them replace the partition type flag, it is important to use 3 spaces at this step.
Code:
(parted) mkpart userdata 10.9GB 50GB
7. Use print described at step 5 and see the result
Code:
(parted) print
Then exit/quit parted
Code:
(parted) quit
8. Reboot to Android and let the OS do the job fixing and formatting the userdata on the new size, will take a while to boot first time after resize, so grab a coffee, a beer, or else, note, it is important to keep the original partition name "userdata"
Code:
sh-5.0# reboot
9. Reboot to OrangeFOX again as described at step 3 and now create the PostmarketOS partition, I will name the partition as pmos:
print the actual partitions
Code:
(parted) print
Number Start End Size File system Name Flags
.....
31 10.9GB 50.0GB 39.1GB userdata
Use the last end as the start of the new partition and for end the desired extra size for your partition, let pretend we want a 20GB pmos partition as ext4 (minimum partition size is 4GB)
Code:
(parted) mkpart pmos ext4 50.0GB 70GB
The remaining free space, if any, can be used for future OSes, let say you want to have Windows and/or Ubuntu along your Android and PostmarketOS in the near future, think twice and partition wise your device and keep some free space if you think you will need it.
After each command you can check the free/available space with following command
Code:
(parted) print free
10. At this point your Android should be running well with the new userdata partition and you are ready to install the PostmarketOS nabu preview.
- Download preview images, please read this thread [INFO] PostmarketOS Linux boot on Xiaomi Pad 5 (nabu)
(NOTE THE IMAGES ARE NOT YET AVAILABLE I WILL UPDATE THE ABOVE POST IN THE NEXT FEW DAYS WHEN I AM DONE WITH THEM)
- Reboot to fastboot and check from which slot is your android booted
Code:
:~$ fastboot getvar current-slot
current-slot: a
finished. total time: 0.005s
Keep in mind that your current version of Android use slot A in above case, slot B is temporarily unused and we can take advantage to install our boot loader. Please note, if you update your Android version the new version will use the unused slot to install updates and our images will be lost, i am talking about 3 partitions involved to properly boot PostmarketOS, boot, vbmeta and dtbo partitions.
In order to flash and boot PostmarketOS you should change the active slot, because above the Android slot was A i am changing the slot to B
Code:
:~$ fastboot set_active b
Setting current slot to 'b'...
OKAY [ 0.046s]
finished. total time: 0.046s
11. Write PostmarketOS preview images.
Flash the new vbmeta with disabled verified boot, more info in PostmarketOS Wiki at Android_Verified_Boot_(AVB)
Code:
:~$ fastboot flash vbmeta_b vbmeta_disabled.img
Erase Android DTBO partition, we do not need it, but if present will be loaded and will prevent our boot
Code:
:~$ fastboot erase dtbo_b
Flash PostmarketOS boot.img
Code:
:~$ fastboot flash boot_b boot.img
Flash PostmarketOS image, please use the partition name you created for PostmarketOS at step 9, this process will takew a while, grab another beer
Code:
:~$ fastboot flash pmos xiaomi-nabu.img
Now you are ready to boot your PostmarketOS preview
Code:
:~$ fastboot reboot
You can switch from PostmarketOS to Android via changing active slots with fastboot, out there are some android/linux apps that can change the active slot while rebooting, you may need to search for them and test if they work.
The last step is to use the free space somehow, by creating one or more new partitions, in order to be able to do that you need to alter the GPT size limit, by default the limit is 32 and if you try to add a new partition you will get a similar error as the following one
Code:
(parted) mkpart WIN ntfs 50.5GB 126GB
mkpart WIN ntfs 50.5GB 126GB
Error: Too many primary partitions.
If you are on slot B to use PostmarketOS you need to switch to slot A to boot my OrangeFOX again:
Code:
:~$ fastboot set_active a
:~$ fastboot boot xiaomi-nabu-orangefox.img
To overcome the limit you will need to use the sgdisk tool, the following command should do the job:
Code:
sh-5.0# sgdisk -S 54 /dev/block/sda
Adjusting GPT size from 54 to 64 to fill the sector
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
sh-5.0#
Now you can use parted to create new partitions, up to 64.
Enjoy
Thanks @Vagelis1608 for reminding me to add the last part about increasing the GPT limit.
P.S.
This thread is about how to repartition your device and install PostmarketOS preview images, if you want to discuss about my PostmarketOS please use this thread [INFO] PostmarketOS Linux boot on Xiaomi Pad 5 (nabu)
I would recommend to mount the "extra space" that's left until you need it for something else.
Either for something non vital ( cache/dalvik-cache ? ) or, better yet, simple storage.
I will look into mounting it as a "virtual SD card".
But yeah, this is exciting and I can't wait for you to release the images.
Vagelis1608 said:
I would recommend to mount the "extra space" that's left until you need it for something else.
Either for something non vital ( cache/dalvik-cache ? ) or, better yet, simple storage.
I will look into mounting it as a "virtual SD card".
But yeah, this is exciting and I can't wait for you to release the images.
Click to expand...
Click to collapse
Indeed, this is a way to use it, but there cannot be added a new partition without some extra work to alter the GPT itself and increase the limit of 32 partitions.... an operation that require a few extra steps.
serdeliuk said:
Indeed, this is a way to use it, but there cannot be added a new partition without some extra work to alter the GPT itself and increase the limit of 32 partitions.... an operation that require a few extra steps.
Click to expand...
Click to collapse
Oh, yeah, I forgot about that.
But still, that will have to be done for a 3rd OS, as you mentioned
Though the user won't have to wipe their data again, which is good
Vagelis1608 said:
Oh, yeah, I forgot about that.
But still, that will have to be done for a 3rd OS, as you mentioned
Though the user won't have to wipe their data again, which is good
Click to expand...
Click to collapse
If the space is left unused/free as suggested there is actually an easy step to alter the GPT later and add one or more partitions without losing anything. I just omitted the step as i thought is not related to the scope of this HowTo.
My OrangeFOX image contains a proper version of sgdisk that is able to alter the GPT size.
Actually i think i can add the extra steps at the end of the post #1 indeed, thanks for suggestion.
serdeliuk said:
If the space is left unused/free as suggested there is actually an easy step to alter the GPT later and add one or more partitions without losing anything. I just omitted the step as i thought is not related to the scope of this HowTo.
My OrangeFOX image contains a proper version of sgdisk that is able to alter the GPT size.
Actually i think i can add the extra steps at the end of the post #1 indeed, thanks for suggestion.
Click to expand...
Click to collapse
I find that it's better to do all the work at once.
Helps to not forget something important.
Good thing your sgdisk is ready and it doesn't need any extra tools.
Optional steps, for sure, but still good to have.
Just don't go over 8192 partitions. Things seem to be bugged after that, from what I read.
Vagelis1608 said:
I find that it's better to do all the work at once.
Helps to not forget something important.
Good thing your sgdisk is ready and it doesn't need any extra tools.
Optional steps, for sure, but still good to have.
Just don't go over 8192 partitions. Things seem to be bugged after that, from what I read.
Click to expand...
Click to collapse
I have added the last missing steps, thanks.
When i started to write the HowTo i didn't realized that will be that huge, is too long to read )))
serdeliuk said:
When i started to write the HowTo i didn't realized that will be that huge, is too long to read )))
Click to expand...
Click to collapse
It's fine, don't worry about it.
It's not like ordinary users will follow it. It's for advanced users
Did anyone do it? Do you have Some screenshots or video review?
denis3509 said:
Did anyone do it? Do you have Some screenshots or video review?
Click to expand...
Click to collapse
I did it on my nabu, i do not have any screenshots or videos, but i have doubts that will help more than what is in the first post, if you have any doubts do not do it, read more, study more, ask questions before do anything, this way you will avoid a soft brick.
I've tried to follow your steps for partitioning, and the pmos guide of porting a new device. I used the map220v kernel, and using pmbootstrap i build and solved some configs error. After i've extracted boot.img and xiaomi-nabu.img, flashed vbmeta_disabled, and then the other images. But when i try boot the slot b, it will redirect to fastboot. How can i solve it?
DTBO? You need to erase dtbo on the slot you are using pmos with.
sparky98 said:
I've tried to follow your steps for partitioning, and the pmos guide of porting a new device. I used the map220v kernel, and using pmbootstrap i build and solved some configs error. After i've extracted boot.img and xiaomi-nabu.img, flashed vbmeta_disabled, and then the other images. But when i try boot the slot b, it will redirect to fastboot. How can i solve it?
Click to expand...
Click to collapse
Also you need to disable AVB in vbmeta too and be sure you have the Postmarketos on the right slot.
Yes i did what you all said before flashing on boot_b and pmos, but maybe i'm doing that wrong.
I erased dtbo_b like this guide, and i've generated the disabled vbmeta with
Bash:
avbtool make_vbmeta_image --flags 2 --padding_size 4096 --output vbmeta_disabled.img
and flashed this image on vbmeta_b
sparky98 said:
Yes i did what you all said before flashing on boot_b and pmos, but maybe i'm doing that wrong.
I erased dtbo_b like this guide, and i've generated the disabled vbmeta with
Bash:
avbtool make_vbmeta_image --flags 2 --padding_size 4096 --output vbmeta_disabled.img
and flashed this image on vbmeta_b
Click to expand...
Click to collapse
Then this HowTo guide reached his scope, you had successfully resized your internal storage, why your OS does not boot is out of scope of this thread, you may need to seek assistance from the developer of your packages. At first glance i can say that your kernel is not properly configured and your DTB is not complete, but please ask the developer of your sources to debug his work and maybe to help you with your issues. Or watch my other threads about PostmarketOS on nabu as soon I will make my sources available as well as some prebuild images.
The preview images of my PostmarketOS port for nabe are available now, check post this thread [INFO] PostmarketOS Linux boot on Xiaomi Pad 5 (nabu)

Categories

Resources