WARNING
Code:
This process is extremely dangerous. You may brick your device.
Do it only if you know what you are doing!
I am not responsible of bricked devices or dead sdcards.
Hello guys,
I've decided to write this guide since this seems to be the only way to resize system partition to install larger GSIs.
Before starting remember to always make a backup since you will loose all your data.
Also DO NOT DO a simple copy-paste compare with yours first and if you have any doubts write in the comments before enter the doubtful command. Prevention is better than cure!!
This process has been tested on my own device but it has not been tested restoring stock firmware.
(You can also join the telegram group to ask for help https://t.me/MotorolaOneAction)
Requirements
Latest TWRP downloaded (to be booted through fastboot later)
Parted arm64 static binary (attached below)
Latest fastboot and ADB commands installed
Patience
Process
Boot to TWRP from fastboot
Run the following commands:
Code:
adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/sda
p free
Now parted will list your partition table which should be like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Save the output of the command above (this is very important to restore original partition table if you will run into issues in the next parts)
Now with extreme attention type
Code:
rm partition_number
replacing partition_number with the number of the partition following the reverse order until you reach system_b partition removing it too . In my case I'll type:
Code:
rm 42
rm 41
rm 40
rm 39
Once you removed these partition it's time to recreate them following the original order but increasing the target partition size, in our case system_b. Type
Code:
mkpart name fs_type start end
replacing name with the original partition name (refer to the command output you saved at point 5), fs_type with original file system type, start with the end value in MB of the previous partition, and end with start + size, where size will be the size of the target partition (size is the original size of the partition except for system_b which I've decided to change to 4221MB, 1000MB larger than original one). If it says that the partition isn't aligned, type Ignore. In my case I'll type:
Code:
mkpart system_b ext4 5630MB 9851MB
mkpart oem_a ext2 9851MB 9918.1MB
mkpart oem_b ext2 9918.1MB 9985.3MB
mkpart userdata ext4 9985.3MB 128GB
Now restore the partition flags typing
Code:
set partition_number msftdata on
replacing partition_number with the number of the partition. In my case I'll type:
Code:
set 39 msftdata on
set 40 msftdata on
set 41 msftdata on
set 42 msftdata on
Now type again
Code:
p free
and compare the output with the original table saved before, they should be quite identical.
Type:
Code:
quit
exit
Reboot to bootloader and boot again into TWRP
If in the logs you see lot of red lines saying it could not mount oem partition and userdata partition don't panic, it is normal since they have not been formatted yet (they are registered into fstab with a different file system type). Type:
Code:
adb shell
mkfs.fs_type /dev/block/sdapartition_number
replacing fs_type with original file system type, partition_number with the number of the partition. In my case I'll type:
Code:
adb shell
mkfs.ext4 /dev/block/sda39
mkfs.ext2 /dev/block/sda40
mkfs.ext2 /dev/block/sda41
mkfs.f2fs /dev/block/sda42
Now reboot to bootloader and again into TWRP. Logs now should be free of red lines and you should be able to mount all partitions again.
You have done it!! Now you are able to flash larger GSI (I suggest you doing it from TWRP since fastboot may have some problem recognizing the resized partition size, also remember to change the active slot to the resized one, in my case the slot b)
Reserved
Why this?
GSI running like Havoc, Dotos...
Is this for running Android 12?
Vanilla GSIs will work without this. But larger GSIs that include Gapps will not because they are larger than system partition (like Pixel Experience, dotOS with Gapps, etc.). You can still flash vanilla build and Gapps zip of course to avoid doing this.
Regarding Android 12 I have not tried it yet.
please someone port postmarketos to this device, kane has a lot of potential
edit: i'm talking about pmos, because this resizing process has sense only for postmarket, if any other roms are bigger than system part, than they are just bloated worthless ****s.
sorry to bother you.
i found your post after long time of searching. I'm noob for installing GSI,to do so i need to resize system partition.but i have zero idea about resizing and also seems like its very critical,and if i made any mistake to resizing it i may have to lost my phone forever.
I'm here to make a request to you that if you help me out to resize partition by a easiest way .i hope you won't reject me. I'm really fed up about resizing.here is my device details
phone: mi 8 pro
codename: equuleus
Rom : 128 GB
Default system partition size : 2.74GB
Hope you will help me
shahrair said:
sorry to bother you.
i found your post after long time of searching. I'm noob for installing GSI,to do so i need to resize system partition.but i have zero idea about resizing and also seems like its very critical,and if i made any mistake to resizing it i may have to lost my phone forever.
I'm here to make a request to you that if you help me out to resize partition by a easiest way .i hope you won't reject me. I'm really fed up about resizing.here is my device details
phone: mi 8 pro
codename: equuleus
Rom : 128 GB
Default system partition size : 2.74GB
Hope you will help me
Click to expand...
Click to collapse
what did you do wrong?
my device does not have /sda, any solution?
Sammm77 said:
my device does not have /sda, any solution?
Click to expand...
Click to collapse
it might be mmcblk0
lol.mam said:
it might be mmcblk0
Click to expand...
Click to collapse
Yep, but partitions like /system /vendor /system_ext and product do not appear, is it because of super partition?
Some phones also need system_a resized. I couldn't install a bigger GSI on One Action/troika and resizing system_a fixed it.
as partições ( parted /dev/block/mmcblk0 )e (parted /dev/block/sda) não contém partições, mas as
(parted /dev/block/sdb) (parted /dev/block/sde) (parted /dev/block/sdf) contém as partiçoes. posso trabalhar nelas??
SDF (parted) parted /dev/block/sdf
Number Start End Size File system Name Flags
1 131kB 655kB 524kB aop_b
2 655kB 4850kB 4194kB tz_b
3 4850kB 5374kB 524kB hyp_b
4 5374kB 5505kB 131kB storsec_b
5 5505kB 5636kB 131kB devcfg_b
6 5636kB 6160kB 524kB keymaster_b
7 6160kB 6685kB 524kB cmnlib_b
8 6685kB 7209kB 524kB cmnlib64_b
9 7209kB 7471kB 262kB prov_b
10 7471kB 8520kB 1049kB abl_b
11 8520kB 8602kB 81.9kB qupfw_b
12 8651kB 10.7MB 2097kB uefisecapp_b
13 10.7MB 10.8MB 32.8kB multiimgoem_b
14 10.8MB 10.8MB 32.8kB multiimgqti_b
15 10.8MB 10.9MB 65.5kB vbmeta_b
16 10.9MB 36.0MB 25.2MB ext2 fsg_b
17 36.0MB 183MB 147MB ext2 modem_b
18 183MB 216MB 33.6MB ext4 dsp_b
19 216MB 217MB 1049kB ext2 bluetooth_b
20 217MB 251MB 33.6MB logo_b
21 251MB 318MB 67.1MB boot_b
22 318MB 343MB 25.2MB dtbo_b
23 343MB 1149MB 805MB ext2 vendor_b
24 1149MB 4638MB 3490MB ext2 system_b
25 4638MB 4949MB 310MB ext2 oem_b
SDB parted /dev/block/sdb
Number Start End Size File system Name Flags
1 131kB 139kB 8192B ssd
2 262kB 33.8MB 33.6MB ext4 persist
3 33.8MB 42.2MB 8389kB ext4 prodpersist
4 42.2MB 43.3MB 1049kB misc
5 43.3MB 43.8MB 524kB keystore
6 43.8MB 44.3MB 524kB frp
7 44.3MB 44.8MB 524kB utags
8 44.8MB 45.4MB 524kB utagsBackup
9 45.4MB 45.5MB 131kB cid
10 45.5MB 62.3MB 16.8MB metadata
11 62.3MB 70.6MB 8389kB kpan
12 70.6MB 79.0MB 8389kB sp
13 79.0MB 95.8MB 16.8MB carrier
14 95.8MB 97.9MB 2097kB modemst1
15 97.9MB 100MB 2097kB modemst2
16 100MB 100MB 131kB fsc
17 100MB 100MB 32.8kB dhob
18 100MB 100MB 4096B devinfo
19 100MB 109MB 8389kB logfs
20 109MB 109MB 262kB apdp
21 109MB 117MB 8389kB spunvm
22 117MB 118MB 524kB uefivarstore
23 118MB 118GB 118GB userdata
SDE (parted) parted /dev/block/sde
Number Start End Size File system Name Flags
1 131kB 655kB 524kB aop_a
2 655kB 4850kB 4194kB tz_a
3 4850kB 5374kB 524kB hyp_a
4 5374kB 5505kB 131kB storsec_a
5 5505kB 5636kB 131kB devcfg_a
6 5636kB 6160kB 524kB keymaster_a
7 6160kB 6685kB 524kB cmnlib_a
8 6685kB 7209kB 524kB cmnlib64_a
9 7209kB 7471kB 262kB prov_a
10 7471kB 8520kB 1049kB abl_a
11 8520kB 8602kB 81.9kB qupfw_a
12 8651kB 10.7MB 2097kB uefisecapp_a
13 10.7MB 10.8MB 32.8kB multiimgoem_a
14 10.8MB 10.8MB 32.8kB multiimgqti_a
15 10.8MB 10.9MB 65.5kB vbmeta_a
16 10.9MB 36.0MB 25.2MB ext2 fsg_a
17 36.0MB 183MB 147MB ext2 modem_a msftdata
18 183MB 216MB 33.6MB ext4 dsp_a
19 216MB 217MB 1049kB ext2 bluetooth_a
20 217MB 251MB 33.6MB logo_a
21 251MB 318MB 67.1MB boot_a
22 318MB 343MB 25.2MB dtbo_a
23 343MB 1149MB 805MB ext2 vendor_a
24 1149MB 4638MB 3490MB ext2 system_a
25 4638MB 4949MB 310MB ext2 oem_a
My device: SM-A528B
Hello, I need to increase the partition for GSI. Could you please help me? Which section should I enlarge and what commands should I enter? (I tried to do everything according to the instructions, but I had questions and nothing happened)
1. I put the file (parted) in the root of the disk (C) and wrote (adb push C:/parted /sbin/ parted) is that correct?
2. What should I enter in (fs_type), (msftdata) if I have spaces here?
3. After the second input (p free), I lost the names of the modified sections.
4. The red lines in TWRP did not disappear anywhere and I could not boot into the system.
Sammm77 said:
Yep, but partitions like /system /vendor /system_ext and product do not appear, is it because of super partition?
Click to expand...
Click to collapse
Were you able to figure out how to expand the system partition with a super partition?
For fastboot to take the partition names use the following parted command:
Code:
name <partition-number> <partition-name>
On some devices this helps a lot, consider adding it to the main thread ^^
Some devices also use /dev/block/mmcblk0 instead of /dev/block/sda
Hi, how can i add partition like product and vbmeta, tried to add using "mkpart PRODUCT ext4 start end" then "mkpart VBMETA space start end" it added but cant flash using twrp, tried on fastboot "Fastboot flash product product.img" then same with vbmeta. but nothing works, zip files cant mount those. Please help
Related
I have an SGH-I747m that I believe is on Bell that I bought used from Ebay. I was assured it was working but when I got it it wouldn't turn on. When I plug it in with the battery in a red light will flash for a second and when I pull the battery with the phone plugged in the red light will be steady even after I replace the battery but go out when I hold the power button. Also, if I pull and replace the battery with the phone unplugged the camera light will flash. Other than that it does nothing. I've tried various debrick images in hopes of getting my phone to download mode both using a 16 and 32 GB class 10 card but it does nothing. I'm not believing that the image is copying right from what I've seen from other people's debrick cards. I've used both dd on linux and win32disk imager on Windows 7. Also a note that when I plug the phone to the computer nothing shows up in device manager. Though that could be that this phone has never been used on my computer so no drivers installed for it.
Using sudo parted /dev/sdd print in Lubuntu 15.04 this is what my debrick SD looks like using a 32GB card.
Code:
Model: Generic- SD/MMC (scsi)
Disk /dev/sdd: 32.0GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 4194kB 67.1MB 62.9MB modem msftdata
2 67.1MB 67.2MB 131kB sbl1
3 67.2MB 67.5MB 262kB sbl2
4 67.5MB 68.0MB 524kB sbl3
5 68.0MB 70.1MB 2097kB aboot
6 70.1MB 70.6MB 524kB rpm
7 70.6MB 81.1MB 10.5MB boot
8 81.1MB 81.7MB 524kB tz
9 81.7MB 82.2MB 524kB pad
10 82.2MB 92.7MB 10.5MB param
11 92.7MB 107MB 14.3MB efs
12 107MB 110MB 3146kB modemst1
13 110MB 113MB 3146kB modemst2
14 113MB 1686MB 1573MB system
15 1686MB 14.8GB 13.1GB userdata
16 14.8GB 14.8GB 8389kB persist
17 14.8GB 15.7GB 881MB cache
18 15.7GB 15.7GB 10.5MB recovery
19 15.7GB 15.7GB 10.5MB fota
20 15.7GB 15.7GB 6291kB backup
21 15.7GB 15.7GB 3146kB fsg
22 15.7GB 15.7GB 8192B ssd
23 15.7GB 15.8GB 5243kB grow
I can't post images so I can't show what it looks like in Windows, but all the partitions are marked unknown save the first one that is FAT16 and contains a folder named image that has a number of files including various dsps, modem and other names. Can anyone help me figure this out to hopefully make a debrick card that works?
OK, I am no noob at rooting, but have drawn a blank with this one. Would very much appreciate some advice.
I have 2 x LG G3 D855s, both running Cloudy G3 ROM. Both have been successfully downgraded to Android 4.4.2 (10L), rooted with purple drake, and Cloudy Lollipop installed. Perfect.
BUT whilst doing a Titanium restore on an app, one of them rebooted this evening, and is now bricked.
- Normal boot - never does anything other than initial LG boot logo;
- TWRP takes about 5 minutes on the splash screen before reaching the main TWRP screen (but has errors, see later);
- LG download mode only shows the initial logo on the phone but the PC does not 'see' it upon cable connection, and the phone never kicks into full download mode. Connecting my other d855 fires up download mode correctly, so PC drivers are OK.
Because download mode never fully starts, I am unable to restore to stock using the kdz / LG flash.
When TWRP DOES start, it is unable to mount /data, /cache, and the log has the following errors:
E: Could not mount /data and unable to find crypto folder
E: Unable to mount /data
E: Unable to recreate /data/media folder
E: Unable to mount /cache
E: Unable to mount storage
... etc.
Within TWRP Internal Storage is shown as (0MB), and /data and /cache are not mounted. My external_sd is mounted OK.
With TWRP running, a device is seen by my PC (Google Nexus ADB Interface) but 'adb devices' shows nothing. This is the same behaviour as the phone that works, so I assume that at least is normal.
I am unable to mount /data manually, or repair within TWRP.
With /data not mounted, I am unable to proceed any further...
So my question - how do I rebuild the screwed up partitions? Or am I barking up the wrong tree?
Some more troubleshooting.
Trying to mount manually in terminal in TWRP gives me a mount unknown error 150.
Running a non-invasive e2fsck gives me:
Code:
e2fsck 1.41.14 (22-Dec-2010)
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Inode 7, i_size is 3082895360, should be 3087097856. Fix? no
Inode 245415, i_blocks is 704, should be 712. Fix? no
Deleted inode 261925 has zero dtime. Fix? no
Pass 2: Checking directory structure
Entry 'net.dinglisch.android.taskerm' in /data (244801) references inode 342934 found in group 42's unused inodes area.
Fix? no
Entry 'net.dinglisch.android.taskerm' in /data (244801) has deleted/unused inode 342934. Clear? no
Entry 'base.apk' in /app/net.dinglisch.android.taskerm-1 (342899) references inode 342932 found in group 42's unused inodes area.
Fix? no
Entry 'base.apk' in /app/net.dinglisch.android.taskerm-1 (342899) has deleted/unused inode 342932. Clear? no
Entry 'lib' in /app/net.dinglisch.android.taskerm-1 (342899) references inode 342933 found in group 42's unused inodes area.
Fix? no
Entry 'lib' in /app/net.dinglisch.android.taskerm-1 (342899) has deleted/unused inode 342933. Clear? no
Entry 'net.dinglisch.android.taskerm' in /dalvik-cache/profiles (1020002) references inode 1020523 found in group 125's unused inodes area.
Fix? no
Entry 'net.dinglisch.android.taskerm' in /dalvik-cache/profiles (1020002) has deleted/unused inode 1020523. Clear? no
Entry '[email protected]@[email protected]@classes.dex' in /dalvik-cache/arm (1020003) references inode 1020522 found in group 125's unused inodes area.
Fix? no
Entry '[email protected]@[email protected]@classes.dex' in /dalvik-cache/arm (1020003) has deleted/unused inode 1020522. Clear? no
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Inode 244801 ref count is 227, should be 226. Fix? no
Inode 342899 ref count is 3, should be 2. Fix? no
Pass 5: Checking group summary information
Block bitmap differences: -(1389467--1390267) -3348514
Fix? no
Free blocks count wrong for group #25 (293, counted=292).
Fix? no
Free blocks count wrong for group #37 (4806, counted=4853).
Fix? no
Free blocks count wrong for group #42 (20629, counted=19028).
Fix? no
Free blocks count wrong (5806109, counted=5471235).
Fix? no
Inode bitmap differences: -261925 -(342932--342935) -(1020522--1020523)
Fix? no
Free inodes count wrong for group #32 (7338, counted=7337).
Fix? no
Free inodes count wrong for group #42 (7950, counted=7945).
Fix? no
Directories count wrong for group #42 (57, counted=58).
Fix? no
Free inodes count wrong for group #125 (7639, counted=7637).
Fix? no
Free inodes count wrong (1692439, counted=1689847).
Fix? no
/dev/block/mmcblk0p43: ********** WARNING: Filesystem still has errors **********
/dev/block/mmcblk0p43: 4841/1697280 files (8.7% non-contiguous), 988001/6794110 blocks
Parted gives me this:
Code:
Model: MMC SDW32G (sd/mmc)
Disk /dev/block/mmcblk0: 31.3GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 16.8MB 83.9MB 67.1MB fat16 modem
2 83.9MB 84.9MB 1049kB sbl1
3 84.9MB 85.5MB 524kB dbi
4 85.5MB 86.0MB 524kB DDR
5 86.0MB 88.1MB 2097kB aboot
6 88.1MB 89.1MB 1049kB rpm
7 89.1MB 90.2MB 1049kB tz
8 90.2MB 90.2MB 4096B pad
9 90.2MB 91.2MB 1049kB sbl1b
10 91.2MB 91.8MB 524kB dbibak
11 91.8MB 92.8MB 1049kB rpmbak
12 92.8MB 93.9MB 1049kB tzbak
13 93.9MB 94.9MB 1049kB rpmf
14 94.9MB 95.9MB 1049kB tzf
15 95.9MB 96.5MB 524kB sdif
16 96.5MB 98.6MB 2097kB abootf
17 98.6MB 101MB 2093kB spare1
18 101MB 117MB 16.8MB boot
19 117MB 151MB 33.6MB ext4 persist
20 151MB 168MB 16.8MB recovery
21 168MB 171MB 3146kB modemst1
22 171MB 174MB 3146kB modemst2
23 174MB 174MB 4096B pad1
24 174MB 177MB 3146kB fsg
25 177MB 178MB 524kB fsc
26 178MB 178MB 524kB ssd
27 178MB 178MB 4096B pad2
28 178MB 179MB 524kB encrypt
29 179MB 179MB 524kB eksst
30 179MB 179MB 8192B rct
31 179MB 185MB 5226kB spare2
32 185MB 201MB 16.8MB misc
33 201MB 235MB 33.6MB laf
34 235MB 268MB 33.6MB fota
35 268MB 285MB 16.8MB spare3
36 285MB 294MB 8389kB ext4 drm
37 294MB 302MB 8389kB ext4 sns
38 302MB 336MB 33.6MB ext4 mpt
39 336MB 369MB 33.6MB factory
40 369MB 2533MB 2164MB ext4 system
41 2533MB 3171MB 638MB ext4 cache
42 3171MB 3439MB 268MB ext4 cust
43 3439MB 31.3GB 27.8GB ext4 userdata
44 31.3GB 31.3GB 513kB grow
Whenever I try and write, repair, or delete the partitions parted tells me:
Code:
Error: Input/output error during write on /dev/block/mmcblk0
I can read partitions. I have backed up EFS and /boot. For what it's worth
I can't delete partitions:
Code:
/ # dd if=/dev/zero of=/dev/block/mmcblk0 bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512B) copied, 0.247840 seconds, 2.0KB/s
/ # parted /dev/block/mmcblk0 print
Model: MMC SDW32G (sd/mmc)
Disk /dev/block/mmcblk0: 31.3GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 16.8MB 83.9MB 67.1MB fat16 modem
2 83.9MB 84.9MB 1049kB sbl1
3 84.9MB 85.5MB 524kB dbi
4 85.5MB 86.0MB 524kB DDR
5 86.0MB 88.1MB 2097kB aboot
6 88.1MB 89.1MB 1049kB rpm
7 89.1MB 90.2MB 1049kB tz
8 90.2MB 90.2MB 4096B pad
...
etc...
So it looks like the whole filesystem has gone read only??? Any way to force reset it? I'd have thought dd would have worked.
How to repartition your Xperia s
The old thread is actually easy but many he not understood
So I he posted YouTube links from which you can understand
How to repartition
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!
YouTube Link https://m.youtube.com/watch?v=ZZqJIY-ITwg
One of a kind rom look https://m.youtube.com/watch?v=lwOxauZBP-Q
Xperia S 6.0.1 look https://m.youtube.com/watch?v=j0_7fZyLf8s
Thanks
He*--have. ...sorry for misspelled words
www.youtube.com/c/Nabeelgm
Subscribe for more
Hi, I've got a question, I asked in other repartition thread too. The question is, will I able to install OneOfAKind 5.1.1 again after this repartitioning ? I've read on one of this threads that it only may work with nAOSP and Im a lil' bit confused now :C
How to revert and leave the internal memory as in the original xperia s?
---------- Post added at 05:39 PM ---------- Previous post was at 04:49 PM ----------
I managed to **** my xperia s in inimaginavis ways
First: I tried to partition my internal memory and disappeared from the mmcblk0p12 to mmcblk0p15
How to fix this?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Second: meu celular entrou em loop ao tentar inciar o Twrp.
So I had the brilliant idea of deleting the Cache, System and Data by Adb...
The loop was solved but ...
Is there a solution or can I use my xperia as paper weight? xD
gmnabeel said:
How to repartition your Xperia s
The old thread is actually easy but many he not understood
So I he posted YouTube links from which you can understand
How to repartition
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!
YouTube Link https://m.youtube.com/watch?v=ZZqJIY-ITwg
One of a kind rom look https://m.youtube.com/watch?v=lwOxauZBP-Q
Xperia S 6.0.1 look https://m.youtube.com/watch?v=j0_7fZyLf8s
Thanks
Click to expand...
Click to collapse
My device doesnt work anymore, i tried 2 times but when i try to format using TWRP it says:
Failed to mount '/cache' and '/data' (No such device)
Disk /dev/block/mmcblk0: 31.9 GB, 31910264832 bytes
4 heads, 16 sectors/track, 973824 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 65 2048 f0 Linux/PA-RISC boot
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 * 65 81 512 4d Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 129 768 20480 48 Unknown
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 769 954240 30511104 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 785 800 512 46 Unknown
/dev/block/mmcblk0p6 833 928 3072 4a Unknown
/dev/block/mmcblk0p7 961 1056 3072 4b Unknown
/dev/block/mmcblk0p8 1089 1184 3072 58 Unknown
/dev/block/mmcblk0p9 1217 1376 5120 70 Unknown
/dev/block/mmcblk0p10 1409 1664 8192 83 Linux
/dev/block/mmcblk0p11 1665 2176 16384 f0 Linux/PA-RISC boot
/dev/block/mmcblk0p12 2177 34944 1048576 83 Linux
/dev/block/mmcblk0p13 34945 42944 256000 83 Linux
/dev/block/mmcblk0p14 42945 954240 29161464 83 Linux
Sorry
AnisErrais said:
My device doesnt work anymore, i tried 2 times but when i try to format using TWRP it says:
Failed to mount '/cache' and '/data' (No such device)
Disk /dev/block/mmcblk0: 31.9 GB, 31910264832 bytes
4 heads, 16 sectors/track, 973824 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 65 2048 f0 Linux/PA-RISC boot
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 * 65 81 512 4d Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 129 768 20480 48 Unknown
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 769 954240 30511104 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 785 800 512 46 Unknown
/dev/block/mmcblk0p6 833 928 3072 4a Unknown
/dev/block/mmcblk0p7 961 1056 3072 4b Unknown
/dev/block/mmcblk0p8 1089 1184 3072 58 Unknown
/dev/block/mmcblk0p9 1217 1376 5120 70 Unknown
/dev/block/mmcblk0p10 1409 1664 8192 83 Linux
/dev/block/mmcblk0p11 1665 2176 16384 f0 Linux/PA-RISC boot
/dev/block/mmcblk0p12 2177 34944 1048576 83 Linux
/dev/block/mmcblk0p13 34945 42944 256000 83 Linux
/dev/block/mmcblk0p14 42945 954240 29161464 83 Linux
Click to expand...
Click to collapse
I just don't have it anymore sorry
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.
!!!!!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)