Related
So ivee tried lots of things to get my xt1063 running again, but it looks that dont mater what it always comes to the same point, so the las thing i want to try, as i took the phone to a shop and they couldnt fix it , i would like to wipe all of the internal memory.
Is this even posible? i know i will probably kill the phone and its ok, so i boot ir in TWRP , im using a computer with ubuntu, installed the latest adb and fastboot, got into adb shell and issue the parted print command i got this
Code:
# parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
Model: MMC SEM08G (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 67.2MB 67.1MB ext4 modem
2 67.2MB 67.8MB 524kB sbl1
3 67.8MB 67.8MB 32.8kB DDR
4 67.9MB 68.9MB 1036kB aboot
5 69.4MB 69.6MB 205kB rpm
6 69.9MB 70.4MB 410kB tz
7 70.5MB 70.5MB 32.8kB sdi
8 70.5MB 71.0MB 524kB utags
9 71.0MB 73.1MB 2097kB logs
10 73.1MB 75.5MB 2388kB padA
11 75.5MB 76.5MB 1036kB abootBackup
12 77.0MB 77.2MB 205kB rpmBackup
13 77.5MB 78.0MB 410kB tzBackup
14 78.1MB 78.1MB 32.8kB sdiBackup
15 78.1MB 78.6MB 524kB utagsBackup
16 78.6MB 79.7MB 1077kB padB
17 79.7MB 81.3MB 1573kB modemst1
18 81.3MB 82.8MB 1573kB modemst2
19 82.8MB 83.3MB 500kB hob
20 83.3MB 83.4MB 32.8kB dhob
21 83.5MB 85.1MB 1573kB ext2 fsg
22 85.1MB 85.1MB 1024B fsc
23 85.1MB 85.1MB 8192B ssd
24 85.1MB 86.1MB 1049kB sp
25 86.1MB 86.3MB 131kB cid
26 86.3MB 89.4MB 3146kB ext3 pds
27 89.4MB 93.6MB 4194kB logo
28 93.6MB 97.8MB 4194kB clogo
29 97.9MB 106MB 8389kB ext4 persist
30 106MB 107MB 524kB misc
31 107MB 117MB 10.4MB boot
32 117MB 128MB 10.5MB recovery
33 128MB 129MB 1049kB deviceinfo
34 129MB 146MB 16.8MB ext4 ftmlog
35 146MB 706MB 560MB ext4 cache
36 706MB 1863MB 1158MB ext4 system
37 1863MB 1872MB 8389kB kpan
38 1872MB 7784MB 5913MB userdata
So can anyone help to wipe, format or whatever needs to be done to wipe the internal memory. Also, do you guys see any weird partitions taht might not belong there? thanks for any help.
abispac said:
So ivee tried lots of things to get my xt1063 running again, but it looks that dont mater what it always comes to the same point, so the las thing i want to try, as i took the phone to a shop and they couldnt fix it , i would like to wipe all of the internal memory.
Is this even posible? i know i will probably kill the phone and its ok, so i boot ir in TWRP , im using a computer with ubuntu, installed the latest adb and fastboot, got into adb shell and issue the parted print command i got this
Code:
# parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
Model: MMC SEM08G (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 67.2MB 67.1MB ext4 modem
2 67.2MB 67.8MB 524kB sbl1
3 67.8MB 67.8MB 32.8kB DDR
4 67.9MB 68.9MB 1036kB aboot
5 69.4MB 69.6MB 205kB rpm
6 69.9MB 70.4MB 410kB tz
7 70.5MB 70.5MB 32.8kB sdi
8 70.5MB 71.0MB 524kB utags
9 71.0MB 73.1MB 2097kB logs
10 73.1MB 75.5MB 2388kB padA
11 75.5MB 76.5MB 1036kB abootBackup
12 77.0MB 77.2MB 205kB rpmBackup
13 77.5MB 78.0MB 410kB tzBackup
14 78.1MB 78.1MB 32.8kB sdiBackup
15 78.1MB 78.6MB 524kB utagsBackup
16 78.6MB 79.7MB 1077kB padB
17 79.7MB 81.3MB 1573kB modemst1
18 81.3MB 82.8MB 1573kB modemst2
19 82.8MB 83.3MB 500kB hob
20 83.3MB 83.4MB 32.8kB dhob
21 83.5MB 85.1MB 1573kB ext2 fsg
22 85.1MB 85.1MB 1024B fsc
23 85.1MB 85.1MB 8192B ssd
24 85.1MB 86.1MB 1049kB sp
25 86.1MB 86.3MB 131kB cid
26 86.3MB 89.4MB 3146kB ext3 pds
27 89.4MB 93.6MB 4194kB logo
28 93.6MB 97.8MB 4194kB clogo
29 97.9MB 106MB 8389kB ext4 persist
30 106MB 107MB 524kB misc
31 107MB 117MB 10.4MB boot
32 117MB 128MB 10.5MB recovery
33 128MB 129MB 1049kB deviceinfo
34 129MB 146MB 16.8MB ext4 ftmlog
35 146MB 706MB 560MB ext4 cache
36 706MB 1863MB 1158MB ext4 system
37 1863MB 1872MB 8389kB kpan
38 1872MB 7784MB 5913MB userdata
So can anyone help to wipe, format or whatever needs to be done to wipe the internal memory. Also, do you guys see any weird partitions taht might not belong there? thanks for any help.
Click to expand...
Click to collapse
my suggestion is to wipe 38 userdata and 35 cache if it doesn't reboot after that then try system (36) but only if you believe you will be able to reflash .... I still think its a corrupt userdata (38) (missing ext 3/4? ) if you can find the correct dd= (linux command ) to wipe / format / repartition this , think HTC and samsungs sometimes suffer this
http://forum.xda-developers.com/google-nexus-5/general/howto-repairing-corrupted-data-partition-t2577447 reading / maybe adaptable to fix?
http://android.stackexchange.com/questions/88277/corrupted-data-partition again more info but need to check file system etc
Thanks for the help, so acording to those links i tried
Code:
e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata
and it returned
Code:
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/block/platform/msm_sdcc.1/by-name/userdata
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
any idea why?
I think this would not wor either, i formated every single partition or file with this comand
mke2fs /dev/block/platform/msm_sdcc.1/by-name/*****
where ****** i aded the name of the all 38 partition parted tells me i have, everything seems ok i dont get erros, but at the end, same result, reboot the phone to the same state.
Please tell me a simple command ,if theres any, to format the whole internal card....please i dont care about the phone anymore, i just want to know if the internal memory can be erased
abispac said:
Thanks for the help, so acording to those links i tried
Code:
e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata
and it returned
Code:
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/block/platform/msm_sdcc.1/by-name/userdata
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
any idea why?
I think this would not wor either, i formated every single partition or file with this comand
mke2fs /dev/block/platform/msm_sdcc.1/by-name/*****
where ****** i aded the name of the all 38 partition parted tells me i have, everything seems ok i dont get erros, but at the end, same result, reboot the phone to the same state.
Please tell me a simple command ,if theres any, to format the whole internal card....please i dont care about the phone anymore, i just want to know if the internal memory can be erased
Click to expand...
Click to collapse
i dont know linux that well, i said ideas - expected you to learn commands are not for your phone , you really need to ask in moto g 1st gen and or linux forum for help as now one here has had this problem , blindly formattting every partiton will kill phone and like I said i think your userdata (data) partition should be ext4 - guessing its just lost its partition table / lable
I believe if you fix 38 userdata partition and only this you will be able to boot or reflash phone
http://forum.xda-developers.com/showthread.php?t=2557781 more ideas but adapt do NOT blindly copy
---------- Post added at 11:30 PM ---------- Previous post was at 11:10 PM ----------
http://androidforums.com/threads/cant-wipe-corrupt-data-bootloop.645860/ READ THIS
---------- Post added 21st February 2015 at 12:07 AM ---------- Previous post was 20th February 2015 at 11:30 PM ----------
Apparently if you relock boot loader then unlock again it formats data and has been used to fix this as a work around.....
http://forum.xda-developers.com/showthread.php?t=2542219&page=136
see posts 1352 and 1353 same problem
reefuge said:
http://forum.xda-developers.com/showthread.php?t=2542219&page=136
see posts 1352 and 1353 same problem
Click to expand...
Click to collapse
thank you ,will take a loo before sending it to motorola tomorrow
delete please, my mistake
im done, sending this to motocare.... thanks again for the help
My device: MotoX (ghost)
Hey guys,
Today i pushed "parted" to my /sbin, chmodded 0755 and removed/recreated my userdata partition removing 5mb of total.. (to try to solve a known encryption bug of CM). Then, i reboot.
Now MY PHONE LOOKS HARD BRICKED!
How it is possible? i just deleted/recreated the userdata partition,
yes parted create on format ext2, but the next step is to convert to ext4 > f2fs..
but my phone does not start!
Black screen
No fastboot
lsusb does not list the usb connection..
Pressing the ON = doesn't boot
Pressing vol down + power = doesn't boot
Inserting charger = doesn't boot
No Lights on.
Battery is ok (i think), i started working w/ 100%.
full log of my actions here:
Code:
$ adb push sdparted/parted /sbin
3067 KB/s (346680 bytes in 0.110s)
~/droid $ adb shell
~ # ls
boot init.qcom.sh sepolicy
cache init.rc sideload
charger init.recovery.qcom.rc supersu
data license sys
default.prop proc system
dev property_contexts tmp
etc recovery twres
file_contexts res ueventd.qcom.rc
fstab.qcom root ueventd.rc
init sbin usb-otg
init.mmi.boot.sh sdcard
init.mmi.touch.sh seapp_contexts
~ # chmod 0755 /sbin/parted
~ # parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
Model: MMC SEM16G (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 105MB 105MB ext4 modem
2 105MB 107MB 1536kB sbl1
3 107MB 108MB 1536kB sbl2
4 108MB 109MB 526kB sbl3
5 110MB 111MB 524kB aboot
6 112MB 112MB 145kB rpm
7 112MB 112MB 215kB tz
8 113MB 113MB 524kB utags
9 113MB 114MB 1049kB logs
10 114MB 117MB 3150kB padA
11 117MB 119MB 1536kB sbl2Backup
12 119MB 121MB 2097kB sbl3Backup
13 121MB 123MB 1536kB abootBackup
14 123MB 123MB 512kB rpmBackup
15 123MB 124MB 512kB tzBackup
16 124MB 124MB 524kB utagsBackup
17 124MB 126MB 1671kB padB
18 126MB 129MB 3146kB modemst1
19 129MB 132MB 3146kB modemst2
20 132MB 134MB 2097kB mbl
21 134MB 135MB 655kB hob
22 135MB 135MB 8192B dhob
23 135MB 143MB 8389kB ext4 persist
24 143MB 143MB 8192B ssd
25 143MB 147MB 3146kB ext2 fsg
26 147MB 148MB 1049kB sp
27 148MB 148MB 524kB misc
28 148MB 151MB 3146kB ext3 pds
29 151MB 151MB 131kB cid
30 151MB 156MB 4194kB logo
31 156MB 160MB 4194kB clogo
32 160MB 161MB 1049kB devtree
33 161MB 171MB 10.5MB boot
34 171MB 182MB 10.5MB recovery
35 182MB 190MB 8389kB kpan
36 190MB 1257MB 1067MB cache
37 1257MB 1258MB 1049kB padC
38 1258MB 2869MB 1611MB ext4 system
39 2869MB 2982MB 113MB customize
40 2982MB 15.8GB 12.8GB userdata
(parted) rm 40
rm 40
(parted) mkpartfs primary ext2 2982MB 15695MB
mkpartfs primary ext2 2982MB 15695MB
(parted) name 40 userdata
name 40 userdata
(parted) quit
quit
Information: You may need to update /etc/fstab.
.. and rebooted using twrp reboot/system button.
Wtf is happened?
any ideas how to solve this?
thanks.
Umm, gpt.bin corrupted.. Head towards the unbrick thread..
[Guide] Repartition Nexus5 to increase system partition - Space for Rom & Stock Gapps
Before I begin...don't do this if you don't know what you're doing. If you know what you're doing still don't do this. This is dangerous, and in general people don't even make good guides for this likely because it's SUCH a stupid thing to do. Samsung phones support PIT re partitioning, but for something like a Nexus, there is no easy guide. You can and likely will brick your phone...at best you will certainly wipe all data.
I wanted to install a nougat rom on my cracked-screen Nexus5, but in flashing it AND stock gapps would error out since there isn't enough room on the /system partition for both. The Nexus5 comes with a 1GB system partition which was fine way back in the day, but isn't really fine anymore. In order to pull space from the large userdata partition, we need to do some linux trickery. I chose to make /system 2GB, which may be overkill, but this phone is going to be a baby monitor/white noise machine for a 5 month old so who cares.
The prerequisite for this process is a TWRP recovery, and that's pretty much it. Ideally, fdisk would be baked in with busybox or the parted utility would be on the phone and you could use the resize function...every time I tried to use busybox's fdisk led to errors or commands wouldn't work, and parted's resize command can't deal with ext4.
The high-level procedure here is, since filesystems must be contiguous and in order so they can be addressed properly, we need to delete every partition inclusively from system to userdata, then recreate them with new storage offsets. To visualize this, here's the storage layout as it started out on my Nexus 5:
Code:
Model: MMC SEM32G (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 524kB 67.6MB 67.1MB fat16 modem
2 67.6MB 68.7MB 1049kB sbl1
3 68.7MB 69.2MB 524kB rpm
4 69.2MB 69.7MB 524kB tz
5 69.7MB 70.3MB 524kB sdi
6 70.3MB 70.8MB 524kB aboot
7 70.8MB 72.9MB 2097kB pad
8 72.9MB 73.9MB 1049kB sbl1b
9 73.9MB 74.4MB 524kB tzb
10 74.4MB 75.0MB 524kB rpmb
11 75.0MB 75.5MB 524kB abootb
12 75.5MB 78.6MB 3146kB modemst1
13 78.6MB 81.8MB 3146kB modemst2
14 81.8MB 82.3MB 524kB metadata
15 82.3MB 99.1MB 16.8MB misc
16 99.1MB 116MB 16.8MB ext4 persist
17 116MB 119MB 3146kB imgdata
18 119MB 142MB 23.1MB laf
19 142MB 165MB 23.1MB boot
20 165MB 188MB 23.1MB recovery
21 188MB 191MB 3146kB fsg
22 191MB 192MB 524kB fsc
23 192MB 192MB 524kB ssd
24 192MB 193MB 524kB DDR
25 193MB 1267MB 1074MB ext4 system
26 1267MB 1298MB 31.5MB crypto
27 1298MB 2032MB 734MB ext4 cache
28 2032MB 31.3GB 29.2GB ext4 userdata
29 31.3GB 31.3GB 5632B grow
Looking at that, we want to increase system (partition 25), shift crypto (partition 26), shift cache (partition 27), and shrink userdata (partition 28). If you try this on a different phone, you'll have different partitions to move.
I did this from a Debian desktop using adb, but you can use any platform that has adb. You need to download the parted binary linked below, a nexus5 Nougat rom (or any rom I guess), and a gapps package (I chose stock). Here's the commands I used:
Code:
wget http://iwf1.com/iwf-repo/parted.rar
unrar e parted.rar
sudo adb push parted /
sudo adb shell
~ # chmod +x parted
~ # ./parted /dev/block/mmcblk0 p
~ # umount /data
~ # umount /sdcard
~ # umount /cache
~ # ./parted /dev/block/mmcblk0 rm 25
~ # ./parted /dev/block/mmcblk0 rm 26
~ # ./parted /dev/block/mmcblk0 rm 27
~ # ./parted /dev/block/mmcblk0 rm 28
~ # ./parted /dev/block/mmcblk0 mkpart primary 193MB 2291MB
~ # ./parted /dev/block/mmcblk0 mkpart extended 2291MB 2322MB
~ # ./parted /dev/block/mmcblk0 mkpart primary 2322MB 3056MB
~ # ./parted /dev/block/mmcblk0 mkpart primary 3056MB 30.8GB
~ # ./parted /dev/block/mmcblk0 p
~ # ./parted /dev/block/mmcblk0 name 25 system
~ # ./parted /dev/block/mmcblk0 name 26 crypto
~ # ./parted /dev/block/mmcblk0 name 27 cache
~ # ./parted /dev/block/mmcblk0 name 28 userdata
~ # mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p25
~ # mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p27
~ # mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p28
~ # ./parted /dev/block/mmcblk0 p
~ # mount -a
~ # exit
# Download from here: http://www.androiddevs.net/downloads/
sudo adb push aosp_hammerhead-7.1-nougat-*.zip /data/
# Download from here: http://opengapps.org/
sudo adb push open_gapps-arm-7.1-stock-*.zip /data/
sudo adb reboot recovery
# Install the nougat rom through twrp...this will resize the /system partition back to 1GB!
sudo adb shell
~ # umount /system
~ # resize2fs -f /dev/block/mmcblk0p25 2000M
~ # mount -a
# Install opengapps in twrp
~ # exit
# Reboot into system through TWRP GUI
There were some logging errors with the SantoshM nougat rom I tried, but they had no impact. I am unmounting /sdcard and that's where it's trying to stash the logs, hence errors.
You can see that the offsets for the new partitions are 1024MB higher than the originals, meaning the partition will be 1GB bigger. Here's my final partition table:
Code:
Model: MMC SEM32G (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 524kB 67.6MB 67.1MB fat16 modem
2 67.6MB 68.7MB 1049kB sbl1
3 68.7MB 69.2MB 524kB rpm
4 69.2MB 69.7MB 524kB tz
5 69.7MB 70.3MB 524kB sdi
6 70.3MB 70.8MB 524kB aboot
7 70.8MB 72.9MB 2097kB pad
8 72.9MB 73.9MB 1049kB sbl1b
9 73.9MB 74.4MB 524kB tzb
10 74.4MB 75.0MB 524kB rpmb
11 75.0MB 75.5MB 524kB abootb
12 75.5MB 78.6MB 3146kB modemst1
13 78.6MB 81.8MB 3146kB modemst2
14 81.8MB 82.3MB 524kB metadata
15 82.3MB 99.1MB 16.8MB misc
16 99.1MB 116MB 16.8MB ext4 persist
17 116MB 119MB 3146kB imgdata
18 119MB 142MB 23.1MB laf
19 142MB 165MB 23.1MB boot
20 165MB 188MB 23.1MB recovery
21 188MB 191MB 3146kB fsg
22 191MB 192MB 524kB fsc
23 192MB 192MB 524kB ssd
24 192MB 193MB 524kB DDR
25 193MB 2291MB 2098MB ext4 system
26 2291MB 2322MB 31.0MB crypto
27 2322MB 3056MB 734MB ext4 cache
28 3056MB 31.3GB 28.2GB ext4 userdata
29 31.3GB 31.3GB 5632B grow
When we resize /system, we're not quite giving it the whole space...I recommend running "resize2fs /dev/block/mmcblk0p25 2048M" and seeing the error...it's easier to adjust the actual filesystem size than the partition size, so we fudge it a bit here so long as it's safe. If this test is unsuccessful, it will tell you that you're allocating more blocks than you have. If it's successful, it'll tell you to run e2fsck...this is normal, and running the resize2fs command with the -f flag overrides that warning...but it'll also allow you to allocate too many blocks, hence why you run a test first as a sanity check. For this exact procedure, 2000M is the exact maximum size.
All in all, this technique can likely be adapted to other android phones. The key is making sure you resize system by the amount you take from data, and making sure you offset all partitions in between linearly by the correct amount. I'm not sure how updates will work...anything that basically lays down a partition is gonna cause issues since it'll try to resize to the default partition size. Anything just laying down new files should be fine.
Happy hacking!
I was looking for such an option as I wanted to install a bigger gapps package then just pico. But shrinking my userdata partition is not was i had in mind. I also really do not want to loose all my data, as i am leazy
so i was thinking about just resizing /cache to a bare minimum of lets say 128mb or even less. Because as i understand /cache is just used for OTA updates - if i am mistaken here, feel free to update my knowledge.
Has anybody done this? On the Galaxy Nexus this is the way to go afaik and one would not loose things in /data.
It worked, Thank you!
What i essentially did was make a nandroid backup followed by "adb pull /sdcard/" on the computer.
Followed your instructions (just before the flashing section), pushed the sdcard data back and restored the backup.
chowned and chmodded the /sdcard directory:
Code:
chown media_rw:media_rw /sdcard
chmod 755 /sdcard
Resized the /system bit, rebooted and hoped it wouldn't 'bootloop'.
The process was nerve wracking, but now the handset is ready for a future stable ROM (I'm still on stock).
So, we need to do
Code:
resize2fs -f /dev/block/mmcblk0p25 2000M
every time we flash a new ROM?
alexeius said:
So, we need to do
Code:
resize2fs -f /dev/block/mmcblk0p25 2000M
every time we flash a new ROM?
Click to expand...
Click to collapse
surfrock66 said:
All in all, this technique can likely be adapted to other android phones. The key is making sure you resize system by the amount you take from data, and making sure you offset all partitions in between linearly by the correct amount. I'm not sure how updates will work...anything that basically lays down a partition is gonna cause issues since it'll try to resize to the default partition size. Anything just laying down new files should be fine.
Happy hacking!
Click to expand...
Click to collapse
Depends on the ROM you're installing.
Everyone must pay attention that this guide is for 32gb model........for 16gb commands are different.......pay attention else u brick seriously you phone.....
SoftWord said:
Everyone must pay attention that this guide is for 32gb model........for 16gb commands are different.......pay attention else u brick seriously you phone.....
Click to expand...
Click to collapse
Yes, this...my numbers show the methodology, but for the 16GB nexus 5 (or any other phone) you need to start by looking at the starting state of the partition table, then do the math from start to finish. I hope I've provided enough methodology and warnings that someone will either abort or do it right.
poioq said:
I was looking for such an option as I wanted to install a bigger gapps package then just pico. But shrinking my userdata partition is not was i had in mind. I also really do not want to loose all my data, as i am leazy
so i was thinking about just resizing /cache to a bare minimum of lets say 128mb or even less. Because as i understand /cache is just used for OTA updates - if i am mistaken here, feel free to update my knowledge.
Has anybody done this? On the Galaxy Nexus this is the way to go afaik and one would not loose things in /data.
Click to expand...
Click to collapse
In general I would say that's a very bad idea...however, if you're very careful and are willing to incur some risk, it could possibly work...on the N5, since the cache partition sits between system and userdata (and more importantly doesn't touch recovery) you could theoretically try it, and if it doesn't work, undo it, all while leaving your userdata partition untouched. If preserving your data is your goal...it's probably a bad idea, but that doesn't mean it isn't possible.
How about taking space from cache to userdata? 1-1,5GB'll be unused anyway and on 16gb variant it'll be nice to have some more memory to have
TL;DR
Success: Repartition of a Nexus 5 16GB
Success: Flash cm-14.1-20161028-UNOFFICIAL-hammerhead.zip
Success: Flash open_gapps-arm-7.1-stock-20161217.zip
FAIL: Getting through the Google/CM set up process (Google Play services crashes)
Success: Flash Aroma Gapps
Gapps selections:
Code:
AndroidPay=0
Books=0
CalculatorGoogle=1
CalendarGoogle=1
CalSync=0
CameraGoogle=1
Chrome=1
ClockGoogle=1
CloudPrint=0
ContactsGoogle=1
DialerFramework=1
DialerGoogle=1
DMAgent=0
Docs=0
Drive=0
Earth=0
ExchangeGoogle=0
FaceDetect=0
FaceUnlock=1
Fitness=1
GCS=1
Gmail=0
GoogleNow=0
GooglePlus=0
GoogleTTS=0
Hangouts=0
Hotword=0
Indic=0
Japanese=0
Keep=1
KeyboardGoogle=1
Korean=0
Maps=1
Messenger=0
Movies=0
Music=1
NewsStand=0
NewsWidget=0
PackageInstallerGoogle=0
Pinyin=0
PixelIcons=1
PixelLauncher=1
Photos=1
PlayGames=0
PrintServiceGoogle=0
ProjectFi=0
Sheets=0
Slides=0
Search=1
Speech=0
StorageManagerGoogle=0
Street=0
TagGoogle=0
Talkback=0
Translate=1
VRService=0
Wallpapers=1
WebViewGoogle=1
YouTube=1
Zhuyin=0
inclorexcl=1
Aim
To convert my Nexus 5 16GB into a Pixel using CM14.1 and Stock Open Gapps (I didn't want to keep flashing random pixel-experience.zip files)
Issue (strikethrough issues are with Stock Gapps)
When using Aroma Gapps:
1. Launcher3 crashes everytime the G search bar is clicked on
2. Google Now is not on the left pane despite my chosen packages
1. I couldn't Sign into my WiFi because no soft keyboard would appear (workaround: I created a password-less Hotspot on another phone)
2. I wasn't able to get past through the Google setup process; Google Play Services would crash every time I attempted to skip Tap & Go taking me back to a SIM card missing screen. On skipping this, I get taken to Tap & Go... and repeat
I've wiped all the caches (of course). If anyone has any ideas, it would be great.
Question to @surfrock66
You have a parted command that says:
Code:
~ # ./parted /dev/block/mmcblk0 mkpart primary 3056MB 30.8GB
Should this not be:
Code:
~ # ./parted /dev/block/mmcblk0 mkpart primary 3056MB 31.3GB
I may not have understood this fully
Thanks surfrock66 for the original method; my method varies slightly and is as follows:
Code:
Download and unpack parted.rar via the
# With phone in TWRP Recovery
$ sudo adb push parted /
$ sudo adb shell
~ # chmod +x parted
~ # ./parted /dev/block/mmcblk0 p
Model: MMC SEM16G (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 524kB 67.6MB 67.1MB fat16 modem
2 67.6MB 68.7MB 1049kB sbl1
3 68.7MB 69.2MB 524kB rpm
4 69.2MB 69.7MB 524kB tz
5 69.7MB 70.3MB 524kB sdi
6 70.3MB 70.8MB 524kB aboot
7 70.8MB 72.9MB 2097kB pad
8 72.9MB 73.9MB 1049kB sbl1b
9 73.9MB 74.4MB 524kB tzb
10 74.4MB 75.0MB 524kB rpmb
11 75.0MB 75.5MB 524kB abootb
12 75.5MB 78.6MB 3146kB modemst1
13 78.6MB 81.8MB 3146kB modemst2
14 81.8MB 82.3MB 524kB metadata
15 82.3MB 99.1MB 16.8MB misc
16 99.1MB 116MB 16.8MB ext4 persist
17 116MB 119MB 3146kB imgdata
18 119MB 142MB 23.1MB laf
19 142MB 165MB 23.1MB boot
20 165MB 188MB 23.1MB recovery
21 188MB 191MB 3146kB fsg
22 191MB 192MB 524kB fsc
23 192MB 192MB 524kB ssd
24 192MB 193MB 524kB DDR
25 193MB 1267MB 1074MB ext4 system
26 1267MB 1298MB 31.5MB crypto
27 1298MB 2032MB 734MB ext4 cache
28 2032MB 15.8GB 13.7GB ext4 userdata
29 15.8GB 15.8GB 5632B grow
~ # umount /data
~ # umount /sdcard
~ # umount /cache
~ # ./parted /dev/block/mmcblk0 rm 25
~ # ./parted /dev/block/mmcblk0 rm 26
~ # ./parted /dev/block/mmcblk0 rm 27
~ # ./parted /dev/block/mmcblk0 rm 28
~ # ./parted /dev/block/mmcblk0 mkpart primary 193MB 2291MB
~ # ./parted /dev/block/mmcblk0 mkpart extended 2291MB 2322MB
~ # ./parted /dev/block/mmcblk0 mkpart primary 2322MB 3056MB
~ # ./parted /dev/block/mmcblk0 mkpart primary 3056MB 15.8GB
~ # ./parted /dev/block/mmcblk0 p
~ # ./parted /dev/block/mmcblk0 name 25 system
~ # ./parted /dev/block/mmcblk0 name 26 crypto
~ # ./parted /dev/block/mmcblk0 name 27 cache
~ # ./parted /dev/block/mmcblk0 name 28 userdata
~ # mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p25
~ # mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p27
~ # mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p28
~ # ./parted /dev/block/mmcblk0 p
~ # mount -a
~ # exit
Model: MMC SEM16G (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 524kB 67.6MB 67.1MB fat16 modem
2 67.6MB 68.7MB 1049kB sbl1
3 68.7MB 69.2MB 524kB rpm
4 69.2MB 69.7MB 524kB tz
5 69.7MB 70.3MB 524kB sdi
6 70.3MB 70.8MB 524kB aboot
7 70.8MB 72.9MB 2097kB pad
8 72.9MB 73.9MB 1049kB sbl1b
9 73.9MB 74.4MB 524kB tzb
10 74.4MB 75.0MB 524kB rpmb
11 75.0MB 75.5MB 524kB abootb
12 75.5MB 78.6MB 3146kB modemst1
13 78.6MB 81.8MB 3146kB modemst2
14 81.8MB 82.3MB 524kB metadata
15 82.3MB 99.1MB 16.8MB misc
16 99.1MB 116MB 16.8MB ext4 persist
17 116MB 119MB 3146kB imgdata
18 119MB 142MB 23.1MB laf
19 142MB 165MB 23.1MB boot
20 165MB 188MB 23.1MB recovery
21 188MB 191MB 3146kB fsg
22 191MB 192MB 524kB fsc
23 192MB 192MB 524kB ssd
24 192MB 193MB 524kB DDR
25 193MB 2291MB 2098MB ext4 system
26 2291MB 2322MB 31.0MB crypto
27 2322MB 3056MB 734MB ext4 cache
28 3056MB 15.8GB 12.7GB ext4 userdata
29 15.8GB 15.8GB 5632B grow
# This didn't work for me
$ sudo adb push cm-14.1-20161028-UNOFFICIAL-hammerhead.zip /
$ sudo adb push open_gapps-arm-7.1-stock-20161217.zip /
$ sudo adb reboot recovery
# So I copied over the files once I reboot into recovery
# I had to reboot into recovery again to see my CM14.1 and Gapps files
# Flashed them using TWRP
$ sudo adb shell
~ # unmount /system/
/sbin/sh: unmount: not found
# I have no idea why this happened
~ # resize2fs -f /dev/block/mmcblk0p25 2000M
resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/block/mmcblk0p25 to 512000 (4k) blocks.
The filesystem on /dev/block/mmcblk0p25 is now 512000 blocks long.
~ # mount -a
mount: mounting /dev/block/mmcblk0p1 on /firmware failed: Invalid argument
mount: mounting /usb-otg on vfat failed: No such file or directory
# I have no idea why this happened either
~ # exit
@surfrock66 Hi, is the same way for n7 (2013) 32gb?
Thanks
Sent from my Nexus 7 using XDA-Developers mobile app
jordirpz said:
@surfrock66 Hi, is the same way for n7 (2013) 32gb?
Thanks
Click to expand...
Click to collapse
No, this is not necessarily true. You will need to use Parted to analyse the partitions and then make the relevant modifications. Again, do not try this unless you are willing to potentially brick your device.
@surfrock66
Faied copy parted to //parted : read-only file system
Whats hapend?
Sent from my Nexus 7 using XDA-Developers mobile app
jordirpz said:
@surfrock66
Faied copy parted to //parted : read-only file system
Whats hapend?
Sent from my Nexus 7 using XDA-Developers mobile app
Click to expand...
Click to collapse
In TWRP, you have to choose to mount your system as read/write, for me with TWRP 3.x it's an option right when TWRP starts. If you don't do that, you can't write to / and thus can't copy the file over.
surfrock66 said:
In TWRP, you have to choose to mount your system as read/write, for me with TWRP 3.x it's an option right when TWRP starts. If you don't do that, you can't write to / and thus can't copy the file over.
Click to expand...
Click to collapse
Ok thank you.
Other question please. Adb Shell steps, works in trwp or i need mount system and reboot system for make it? Thank you
Sent from my Nexus 7 using XDA-Developers mobile app
jordirpz said:
Ok thank you.
Other question please. Adb Shell steps, works in trwp or i need mount system and reboot system for make it? Thank you
Sent from my Nexus 7 using XDA-Developers mobile app
Click to expand...
Click to collapse
All done while in twrp.
surfrock66 said:
All done while in twrp.
Click to expand...
Click to collapse
Ok, thanks for you awesome guide.
For me works, now i have 2gb in system?
Sorry for ETA: can you in near future make a reparted file and guide for N7 2013 wifi please?
Sent from my Nexus 7 using XDA-Developers mobile app
jordirpz said:
Ok, thanks for you awesome guide.
For me works, now i have 2gb in system?
Sorry for ETA: can you in near future make a reparted file and guide for N7 2013 wifi please?
Sent from my Nexus 7 using XDA-Developers mobile app
Click to expand...
Click to collapse
I don't have that device, but the original post here should have everything you need to re-create the process for another device. You'll have to re-calculate the offsets based on what you find when you run the original partition query.
souheil said:
Depends on the ROM you're installing.
Click to expand...
Click to collapse
Just to double check.
Any ideas of what ROMs would need this?
I'm interested of the cyanogenmod in my particular case.
ricardo.adao said:
Just to double check.
Any ideas of what ROMs would need this?
I'm interested of the cyanogenmod in my particular case.
Click to expand...
Click to collapse
CM14.1 fits on the Nexus 5 /system partition WITHOUT repartitioning.
I wanted to try this because I want to flash Stock Gapps (as opposed to Nano), hoping to get a Pixel-like experience as described in my previous post (http://forum.xda-developers.com/showpost.php?p=70145560&postcount=10). However, I had lots of crashes with Stock Gapps.
Instead, I now use CM14.1 with Nano Gapps.
If you want a more Pixel-like experience, that side-loading doesn't provide (no Google Now on the left side of the Homescreen, no Pixel-like animations on clicking the G Search Bar), I have resorted to installing the Pixel Launcher and Wallpaper APKs into /system.
Instructions found: http://android.stackexchange.com/questions/76976/how-to-install-app-as-system-app
Re-flashing a ROM will require you to re-do these steps.
I got tired of installing amazing ROMs created by the talented folks here on XDA, but being held back on things like Google Apps because of the tiny /system partition we have on the Nexus 4. I looked around and found guides to increase the system space in the Nexus 5 and Nexus 7 2013, so I basically just adapted them to work on our beloved Nexus 4.
As always, do this at your OWN risk. I am not responsible for bricking your Nexus 4. I will simply list the process which I used to increase my Nexus 4's system partition (by taking a big ol' chunk from the cache partition). Remember, any sort of modification to your device of this caliber WILL void any warranty you might still have.
REQUIREMENTS:
parted (Uploaded to my Google Drive. If it downloads as a .txt, rename it to remove the extension and make it a plain file)
adb and fastboot, and preferably knowledge on how they work
Step 1: Install TWRP onto your Nexus 4 and reboot into it.
Step 2: Open up command prompt / terminal and check to see if your Nexus 4 is connected properly with "adb devices".
Step 3: Once you've confirmed that adb is fully working and your Nexus 4 is properly connected to your PC, download parted and use adb to push it to your Nexus 4 using the command:
Code:
adb push parted /
Step 4: Now enter the following command:
Code:
adb shell
and then the command:
Code:
chmod +x parted
This will enter adb shell and make the "parted" binary you pushed to your device earlier executable.
Step 5:
Now run the command
Code:
./parted /dev/block/mmcblk0 p
You should see a long list with a bunch of numbers and names in your terminal. These are the partitions on your device. parted will give you the partition number, the "start" and "end" of the partition, the size, and the name.
This is the partition layout on my device. It will probably be the same on your device, though the size of userdata may vary depending on whether you have the 8gb or 16gb Nexus 4.
Code:
~ # ./parted /dev/block/mmcblk0 p
Model: MMC 016G92 (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 524kB 67.6MB 67.1MB fat16 modem
2 67.6MB 68.2MB 524kB sbl1
3 68.2MB 68.7MB 524kB sbl2
4 68.7MB 70.8MB 2097kB sbl3
5 70.8MB 71.3MB 524kB tz
6 71.3MB 94.4MB 23.1MB boot
7 94.4MB 117MB 23.1MB recovery
8 117MB 118MB 799kB m9kefs1
9 118MB 119MB 799kB m9kefs2
10 119MB 120MB 799kB m9kefs3
11 120MB 121MB 524kB rpm
12 121MB 121MB 524kB aboot
13 121MB 122MB 524kB sbl2b
14 122MB 124MB 2097kB sbl3b
15 124MB 124MB 524kB abootb
16 124MB 125MB 524kB rpmb
17 125MB 125MB 524kB tzb
18 125MB 126MB 524kB metadata
19 126MB 143MB 16.8MB misc
20 143MB 159MB 16.8MB ext4 persist
21 159MB 1040MB 881MB ext2 system
22 1040MB 1627MB 587MB ext4 cache
23 1627MB 15.8GB 14.1GB ext4 userdata
24 15.8GB 15.8GB 524kB DDR
25 15.8GB 15.8GB 507kB grow
Step 6:
Now run the following three commands:
Code:
umount /data
umount /sdcard
umount /cache
Step 7: So, on my Nexus 4, the system partition is number 21, and cache is 22. We're kinda lucky in the fact that system and cache are right next to each other, meaning we don't have to touch any other partition.
You'll want to run these two next commands. These commands will essentially "remove" the two partitions.
Code:
./parted /dev/block/mmcblk0 rm 21
./parted /dev/block/mmcblk0 rm 22
Step 8: Now it is time to recreate these two partitions, however, when recreating them, we will make system bigger and the cache smaller. From the partitions list we got in Step 5, we can see that system starts at 159 and ends at 1040, while cache starts at 1040 and ends at 1627. The following two commands will rebuild /system starting at 159, but ending at 1590, while rebuilding cache at 1590, and ending at 1627. We are essentially stealing a large chunk from cache, since we don't really need that anymore on newer ROMs.
Code:
./parted /dev/block/mmcblk0 mkpart primary 159 1590
./parted /dev/block/mmcblk0 mkpart primary 1590 1627
Step 9: Now run this command:
Code:
./parted /dev/block/mmcblk0 p
This will bring up the partitions list, or table, again. This time, however, we'll see the new partitions where system and cache were, however, they have no names! The following two commands will name the two partitions again.
Code:
./parted /dev/block/mmcblk0 name 21 system
./parted /dev/block/mmcblk0 name 22 cache
Step 10: Great! Now the partitions should be named again! Now, we still have to format the partitions as ext4 so that we can actually use them. The following two commands will do that for you.
Code:
mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p21
mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p22
Step 11: At this point, feel free to run the command from Step 5 to take one more look at the partition table and make sure everything looks good. Now run the command
Code:
mount -a
and then type in
Code:
exit
.
Step 12: Now we are pretty much done. We've extended the system partition from approx. 881mb to 1431mb, which is a nice large chunk of memory. In the future, we could always mess with the partitions more to add even more space by stealing from userdata, but until we reach that point, I think we are pretty well set for now!
Now...
You'll want to reboot TWRP, and flash a new ROM. You can now use a much bigger Google Apps package, without any worries.
Do note, however, that flashing a ROM will "resize" system to be smaller, but this isn't a huge deal. After flashing a ROM, while still in TWRP, you'll want to go to Wipe > Advanced Wipe > check "system" then head to "Repair or Change File System", > then tap on "Resize File System." If you encounter any errors while trying to resize, try remounting system or rebooting TWRP. Afterwards, you should be able to flash your Google Apps package. I'm not sure if you need to repeat these steps after flashing things other than ROMs, but repeating this process within TWRP should work just as well.
I hope I helped y'all out and feel free to post if this guide worked for you or if you have any other comments!
CREDITS:
@surfrock66 for his Nexus 5 guide here.
@rkhat for his Nexus 7 2013 guide here.
RESERVED
Worked Thanx
It worked here on my 8 Gb mako. Here are the original parted output:
Code:
Model: MMC 008G92 (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 524kB 67.6MB 67.1MB fat16 modem
2 67.6MB 68.2MB 524kB sbl1
3 68.2MB 68.7MB 524kB sbl2
4 68.7MB 70.8MB 2097kB sbl3
5 70.8MB 71.3MB 524kB tz
6 71.3MB 94.4MB 23.1MB boot
7 94.4MB 117MB 23.1MB recovery
8 117MB 118MB 799kB m9kefs1
9 118MB 119MB 799kB m9kefs2
10 119MB 120MB 799kB m9kefs3
11 120MB 121MB 524kB rpm
12 121MB 121MB 524kB aboot
13 121MB 122MB 524kB sbl2b
14 122MB 124MB 2097kB sbl3b
15 124MB 124MB 524kB abootb
16 124MB 125MB 524kB rpmb
17 125MB 125MB 524kB tzb
18 125MB 126MB 524kB metadata
19 126MB 143MB 16.8MB misc
20 143MB 159MB 16.8MB ext4 persist
21 159MB 1040MB 881MB ext2 system
22 1040MB 1627MB 587MB ext4 cache
23 1627MB 7817MB 6190MB ext4 userdata
24 7817MB 7818MB 524kB DDR
25 7818MB 7818MB 507kB grow
I'm using Nitrogen OS 8.1 with GZR Gapps
jfsobreira said:
It worked here on my 8 Gb mako. Here are the original parted output:
Code:
Model: MMC 008G92 (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 524kB 67.6MB 67.1MB fat16 modem
2 67.6MB 68.2MB 524kB sbl1
3 68.2MB 68.7MB 524kB sbl2
4 68.7MB 70.8MB 2097kB sbl3
5 70.8MB 71.3MB 524kB tz
6 71.3MB 94.4MB 23.1MB boot
7 94.4MB 117MB 23.1MB recovery
8 117MB 118MB 799kB m9kefs1
9 118MB 119MB 799kB m9kefs2
10 119MB 120MB 799kB m9kefs3
11 120MB 121MB 524kB rpm
12 121MB 121MB 524kB aboot
13 121MB 122MB 524kB sbl2b
14 122MB 124MB 2097kB sbl3b
15 124MB 124MB 524kB abootb
16 124MB 125MB 524kB rpmb
17 125MB 125MB 524kB tzb
18 125MB 126MB 524kB metadata
19 126MB 143MB 16.8MB misc
20 143MB 159MB 16.8MB ext4 persist
21 159MB 1040MB 881MB ext2 system
22 1040MB 1627MB 587MB ext4 cache
23 1627MB 7817MB 6190MB ext4 userdata
24 7817MB 7818MB 524kB DDR
25 7818MB 7818MB 507kB grow
I'm using Nitrogen OS 8.1 with GZR Gapps
Click to expand...
Click to collapse
Awesome! Thanks for letting me know. Glad it worked for you. :good:
thank you very much !
Thx !
Thx !
Great guide works perfectly.. has anyone tried to reverse the process and go back to stock to reflash a factory image?
I just tried it on my old Nexus 4, and after resettting the partitions, and reflashing the factory image, its just a permanent bootloop. I've cleared all the cache, tried a wipe from the stock recovery, tried flashing TWRP and wiping there.. nothing seems to work. Im not too worried, but it'd be nice if it could boot again.
Thanks for your guide. It worked like a charm for my Nexus 4.
Just a small addition: To resize the system partition automatically I placed a script in /system/addon.d:
Code:
#!/sbin/sh
#
# /system/addon.d/10-resize-system.sh
#
. /tmp/backuptool.functions
case "$1" in
backup)
# Stub
;;
restore)
# Stub
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
/sbin/resize2fs /dev/block/platform/msm_sdcc.1/by-name/system
;;
post-restore)
# Stub
;;
esac
If it doesn't work for you
Thanks for this great guide!
Decided to breath some new life into an old N4 in my family and now it's going (very) strong again with LineageOS 15.1. Still had to clear a bit over 100 MB with .gapps-config from Stock-OpenGapps, but that's no biggie. I always liked to start with the big package and then remove everything that I don't need from it.
Second issue gave me some headaches at first.
"Resize File System" in TWRP apparently worked and Gapps-Install went through (~100 MB free at the end), but boot would fail and crash back to recovery.
(I'm using the daily LOS-nightlies by Milaq and Stock-Package from OpenGapps, maybe it's no problem with other ROMs and/or Gapps-Packages.)
Turns out the fix in TWRP wasn't really working, nevermind what partition size it shows for /system afterwards. It's somehow corrupted and still has the original size -> most of the gapps stuff get's written to nirvana, thus the failing boot.
I found the solution over in the Nexus5-Thread:
JekaPinsk said:
Hello guys!
Try this:
1) Install ROM
2) Backup ROM
3) Enable "Use 'rm -rf' instead of formatting" in TWRP settings
4) Format /system
4.1) Unmount /system and use 'resize2fs -f /dev/block/mmcblk0p21' in terminal (TWRP)
5) Reboot TWRP
5.1) Uncheck "Use 'rm -rf' instead of formatting" in TWRP settings
6) Restore backup
7) Install Stock OpenGapps
8) Done!
The idea behind it is that ROM installation somehow corrupt /system partition thus any write operations above normal data region silently fail.
Click to expand...
Click to collapse
at step 4.1 I already changed the partition number to 21 for Nexus4. In the original post it says mmcblk0p25, because on the Nexus 5 that's /system.
Now it works.
In theory this procedure should also work for updating the ROM without losing data, but haven't tested it yet. (Maybe throw in a wipe of /system as step 0...?)
To be clear: This isn't the fault of the guide to resize system-partition.
Problem is (at least certain) ROMs resetting size of file system to original and then TWRP failing to fix that doing it the easy way as described in OP (-> bug in TWRP?).
EDIT:
Above procedure also works for an update without data loss. Only difference was I did a normal wipe of /system first, "step 0" so to say.
No idea if all this is still necessary with TWRP 3.2.3-0, I'm not willing to risk a full wipe at this point. ^^
i need this...can't even install the smallest gapps package after oreo.... word!! thanks!
Really wanted to thank-you for this!
Two questions:
1. When you printed the partitions, system (21) was ext2. When you recreated it after resizing, you created it as ext4. Was that intentional?
2. You also made the claim that modern ROMs don't need such a big cache partition (your new one was 37MB, I wasn't so brave). Can you justify that claim or provide some technical details? It's not that I don't believe you (I trusted you enough to do this on my device!), just merely curious as to why/how this would be.
Thanks!
X:\xxx\xxx\xxx\xxx\adb>adb push parted /
487 KB/s (346680 bytes in 0.695s)
X:\xxx\xxx\xxx\xxx\adb>adb shell
~ # [6nchmod +x parted
chmod +x parted
~ # [6n./parted /dev/block/mmcblk0 p
./parted /dev/block/mmcblk0 p
Error: Can't have overlapping partitions.
~ # [6n
Please Help!!!!!!!!!!!!!!!!!!!
caliban2 said:
Thanks for this great guide!
Decided to breath some new life into an old N4 in my family and now it's going (very) strong again with LineageOS 15.1. Still had to clear a bit over 100 MB with .gapps-config from Stock-OpenGapps, but that's no biggie. I always liked to start with the big package and then remove everything that I don't need from it.
Second issue gave me some headaches at first.
"Resize File System" in TWRP apparently worked and Gapps-Install went through (~100 MB free at the end), but boot would fail and crash back to recovery.
(I'm using the daily LOS-nightlies by Milaq and Stock-Package from OpenGapps, maybe it's no problem with other ROMs and/or Gapps-Packages.)
Turns out the fix in TWRP wasn't really working, nevermind what partition size it shows for /system afterwards. It's somehow corrupted and still has the original size -> most of the gapps stuff get's written to nirvana, thus the failing boot.
I found the solution over in the Nexus5-Thread:
at step 4.1 I already changed the partition number to 21 for Nexus4. In the original post it says mmcblk0p25, because on the Nexus 5 that's /system.
Now it works.
In theory this procedure should also work for updating the ROM without losing data, but haven't tested it yet. (Maybe throw in a wipe of /system as step 0...?)
To be clear: This isn't the fault of the guide to resize system-partition.
Problem is (at least certain) ROMs resetting size of file system to original and then TWRP failing to fix that doing it the easy way as described in OP (-> bug in TWRP?).
EDIT:
Above procedure also works for an update without data loss. Only difference was I did a normal wipe of /system first, "step 0" so to say.
No idea if all this is still necessary with TWRP 3.2.3-0, I'm not willing to risk a full wipe at this point. ^^
Click to expand...
Click to collapse
I'm using TWRP 3.2.3-0 and it has this bug, too. After I followed your steps I was able to install Nitrogen OS and Open Gapps Micro in my phone without erros.
Thanks!
I believe that resize2fs step can be packaged as a flashable zip so we can batch flashing without manual intervention to it (i.e. manually resize fs on system after each rom flash) .
ivanich said:
I believe that resize2fs step can be packaged as a flashable zip so we can batch flashing without manual intervention to it (i.e. manually resize fs on system after each rom flash) .
Click to expand...
Click to collapse
Maybe then more users would dare to use this solution and could calmly install gapps on Pie.
You have a lot of experience. What do you suggest?
Hi all. I only discovered this thread after independently figuring out the partitioning scheme (plain GPT) and process.
Sadly, even after this effort, it seems L-OS upgrades won't work unless L-OS devs modify their upgrade script to make use of resize2fs. Here's what happens as of package 2018-09-11:
L-OS runs backup procedure for all addons found in the existing /system/addon.d/
The above creates files (I guess) in /tmp
The /system is unmounted
The partition is overwritten with the image in the upgrade package
The script in addon.d/ are then run to restore the addons from /tmp
The problem is, the partition image in the upgrade package is for the old partition size, and therefore step 5 fails when the free space runs out. It seems the install or restore scripts don't detect this failure, and just exit without reporting an error, with 0B free space on /system.
I'm guessing the problem can be "solved" by formatting the system partition and installing LOS and all addons from scratch, but that's ridiculous. has anyone tried to raise this issue with devs? I'm about to report this in L-OS's JIRA, as I haven't seen any relevant report there.
EDIT: If anyone wants to track: https://jira.lineageos.org/browse/BUGBASH-2306
myxal said:
Hi all. I only discovered this thread after independently figuring out the partitioning scheme (plain GPT) and process.
Sadly, even after this effort, it seems L-OS upgrades won't work unless L-OS devs modify their upgrade script to make use of resize2fs. Here's what happens as of package 2018-09-11:
L-OS runs backup procedure for all addons found in the existing /system/addon.d/
The above creates files (I guess) in /tmp
The /system is unmounted
The partition is overwritten with the image in the upgrade package
The script in addon.d/ are then run to restore the addons from /tmp
The problem is, the partition image in the upgrade package is for the old partition size, and therefore step 5 fails when the free space runs out. It seems the install or restore scripts don't detect this failure, and just exit without reporting an error, with 0B free space on /system.
I'm guessing the problem can be "solved" by formatting the system partition and installing LOS and all addons from scratch, but that's ridiculous. has anyone tried to raise this issue with devs? I'm about to report this in L-OS's JIRA, as I haven't seen any relevant report there.
EDIT: If anyone wants to track: https://jira.lineageos.org/browse/BUGBASH-2306
Click to expand...
Click to collapse
You may be able to fix that on your own by adding an add-on.d named 00-resize-system (so that's it's ran first) that just does "resize2fs /dev/block/.../system", with maybe an unmount before and a mount after. This way, LOS can just flash the full image when upgrading and the system is resized before the other addons.d scripts run.
Fif_ said:
You may be able to fix that on your own by adding an add-on.d named 00-resize-system (so that's it's ran first) that just does "resize2fs /dev/block/.../system", with maybe an unmount before and a mount after. This way, LOS can just flash the full image when upgrading and the system is resized before the other addons.d scripts run.
Click to expand...
Click to collapse
Thanks for the tip, will give that a try. Any idea where I could find an "authoritative" docs/guide to those scripts? Just looked at the one supplied by open g-apps, and I don't really see the difference between the various commands that the script is supposed to handle (which is executed when?). Also what list_file() is supposed to provide.
backup
restore
pre-backup
pre-restore
post-backup
post-restore
myxal said:
Thanks for the tip, will give that a try. Any idea where I could find an "authoritative" docs/guide to those scripts? Just looked at the one supplied by open g-apps, and I don't really see the difference between the various commands that the script is supposed to handle (which is executed when?). Also what list_file() is supposed to provide.
backup
restore
pre-backup
pre-restore
post-backup
post-restore
Click to expand...
Click to collapse
You want to put the resize2fs call in the pre-restore section.
It should look like this:
Code:
pre-restore)
unmount /system
resize2fs /dev/block/platform/.../system
mount /system
;;
This includes unmounting and remounting /system which I think are needed, but YMMV. You'll need to fill in the full path to system under /dev.
There is no authoritative resource for backup scripts that I know of, but the gapps script is a good example.
P.S.: If you make it work, please post the script for others...
Hi, when trying to install twrp, i get this message:
Code:
Sending 'recovery' (131072 KB) OKAY [ 3.060s]
Writing 'recovery' FAILED (remote: 'Error flashing partition : Volume Full')
fastboot: error: Command failed
with windows 11, i can see that i still have 53Go available but that does not help.
TRying to dig in this issue, here is what i got :
Code:
\platform-tools>adb shell df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 3.3G 3.2G 167M 96% /
tmpfs 2.6G 0.9M 2.6G 1% /dev
tmpfs 2.6G 0 2.6G 0% /mnt
tmpfs 2.6G 0 2.6G 0% /apex
/dev/block/dm-1 1.4G 1.3G 55M 97% /vendor
none 2.6G 0 2.6G 0% /sys/fs/cgroup
/dev/block/sda29 232M 4.3M 220M 2% /cache
/dev/block/sda14 4.9M 160K 4.8M 4% /dev/logfs
/dev/block/sda30 976M 728M 222M 77% /cust
/dev/block/sda31 109G 51G 58G 47% /data
/data/media 109G 51G 58G 47% /storage/emulated
Well, if i get it right, that could mean, i only have 167 Mo left on the system partition, which is ... not much..
digging further i got
Code:
adb shell df /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 3555292 3368200 170708 96% /apex/com.android.resolv
which confirms what may be an issue..
But i definitely don't know what to do
I've tried to temporarily boot on twrp using
Code:
fastboot boot twrp.img
but a black screen occurs, and that was it...
So definitely don't know what to do.
Any help would be appreciate!
The question is, how big is your recovery partition, presuming that you have one?
The image you have is 128 MB. Undoubtedly it's 30 MB of recovery, 98 MB or zeroes and a stupid AVB0 footer.
Use some tool to chop it down to 64 MB or so and try flashing it.
Or if you do Windows, try my imgutil /p /v recovery.img (on a copy of the file).
It's in the sig.
Seems like ur /system is just full. PixelOS or some other heavy Rom installed?
Other than that, when u have the balls u could repartitionate ur Phone as i had todo so on the P20 Pro, as /system was too small with <2.8gb~ for some roms. But wont recommend when u have no idea what todo.
aLcaTr4z said:
Seems like ur /system is just full. PixelOS or some other heavy Rom installed?
Other than that, when u have the balls u could repartitionate ur Phone as i had todo so on the P20 Pro, as /system was too small with <2.8gb~ for some roms. But wont recommend when u have no idea what todo.
Click to expand...
Click to collapse
I agree with the "system full" theory. I do not see anything mounted on "/" (only on subfolders of "/") on my phone. https://source.android.com/docs/core/ota/modular-system/dns-resolver
Im not 100% sure, but i think thats correct. Will do a search across the system, to check if i can find my old partion table.
Spoiler: P20 Pro stock partitions
Code:
Number Start End Size File system Name Flags
1 524kB 1049kB 524kB vrl msftdata
2 1049kB 1573kB 524kB vrl_backup msftdata
3 1573kB 10.5MB 8913kB ext4 modem_secure msftdata
4 10.5MB 15.7MB 5243kB nvme msftdata
5 15.7MB 16.8MB 1049kB certification msftdata
6 16.8MB 83.9MB 67.1MB oeminfo msftdata
7 83.9MB 117MB 33.6MB ext4 secure_storage msftdata
8 117MB 151MB 33.6MB ext4 modem_om msftdata
9 151MB 168MB 16.8MB modemnvm_factory msftdata
10 168MB 185MB 16.8MB modemnvm_backup msftdata
11 185MB 206MB 21.0MB ext4 modemnvm_img msftdata
12 206MB 222MB 16.8MB modemnvm_system msftdata
13 222MB 226MB 4194kB hisee_encos msftdata
14 226MB 228MB 1049kB veritykey msftdata
15 228MB 229MB 1049kB ddr_para msftdata
16 229MB 257MB 28.3MB reserved2 msftdata
17 257MB 341MB 83.9MB ext4 splash2 msftdata
18 341MB 343MB 2097kB bootfail_info msftdata
19 343MB 345MB 2097kB misc msftdata
20 345MB 362MB 16.8MB dfx msftdata
21 362MB 379MB 16.8MB rrecord msftdata
22 379MB 379MB 262kB fw_lpm3_a msftdata
23 379MB 383MB 3932kB reserved3_a msftdata
24 383MB 384MB 1049kB hdcp_a msftdata
25 384MB 388MB 4194kB hisee_img_a msftdata
26 388MB 392MB 4194kB hhee_a msftdata
27 392MB 401MB 8389kB ext4 hisee_fs_a msftdata
28 401MB 413MB 12.6MB fastboot_a msftdata
29 413MB 417MB 4194kB vector_a msftdata
30 417MB 419MB 2097kB isp_boot_a msftdata
31 419MB 434MB 14.7MB isp_firmware_a msftdata
32 434MB 447MB 12.6MB fw_hifi_a msftdata
33 447MB 455MB 8389kB teeos_a msftdata
34 455MB 472MB 16.8MB sensorhub_a msftdata
35 472MB 497MB 25.2MB erecovery_kernel_a msftdata
36 497MB 531MB 33.6MB erecovery_ramdisk_a msftdata
37 531MB 547MB 16.8MB erecovery_vendor_a msftdata
38 547MB 573MB 25.2MB kernel_a msftdata
39 573MB 585MB 12.6MB eng_system_a msftdata
40 585MB 619MB 33.6MB recovery_ramdisk_a msftdata
41 619MB 635MB 16.8MB recovery_vendor_a msftdata
42 635MB 657MB 22.0MB dts_a msftdata
43 657MB 665MB 7340kB dto_a msftdata
44 665MB 667MB 2097kB trustfirmware_a msftdata
45 667MB 726MB 58.7MB ext4 modem_fw_a msftdata
46 726MB 738MB 12.6MB eng_vendor_a msftdata
47 738MB 740MB 2097kB recovery_vbmeta_a msftdata
48 740MB 742MB 2097kB erecovery_vbmeta_a msftdata
49 742MB 747MB 4194kB vbmeta_a msftdata
50 747MB 763MB 16.8MB modemnvm_update_a msftdata
51 763MB 805MB 41.9MB modemnvm_cust_a msftdata
52 805MB 839MB 33.6MB reserved7 msftdata
53 839MB 872MB 33.6MB ext4 version_a msftdata
54 872MB 1871MB 998MB vendor_a msftdata
55 1871MB 1879MB 8389kB ext4 preload_a msftdata
56 1879MB 2080MB 201MB cust_a msftdata
57 2080MB 2231MB 151MB odm_a msftdata
58 2231MB 2366MB 134MB ext4 cache msftdata
59 2366MB 3683MB 1317MB preas msftdata
60 3683MB 3716MB 33.6MB preavs msftdata
61 3716MB 5453MB 1736MB product_a msftdata
62 5453MB 8061MB 2609MB ext2 system_a msftdata
63 8061MB 8271MB 210MB ext4 patch_a msftdata
64 8271MB 128GB 120GB userdata msftdata
i Think Xi might using /system_x just as around ~3gb too.
Edit²:
Code:
./parted /dev/block/sdd
is a entrypoint to dig deeper.
Well, I don't get it.
There's a bunch of people who have reported problems and gotten "volume full"'.
Most of the times they say that they were flashing the wrong thing.
The weird part is that fastboot doesn't normally have anything to do with "volumes".
It works on partitions.
So, clearly I'm missing something.
In any case imgutil /v /l whatever.img will tell you what the file you're trying to flash is.
(Don't quote the whole ramdisk! Just say if there is one.)
fastboot getvar all will also tell us what it has for a recovery partition.
Renate said:
Well, I don't get it.
There's a bunch of people who have reported problems and gotten "volume full"'.
Most of the times they say that they were flashing the wrong thing.
The weird part is that fastboot doesn't normally have anything to do with "volumes".
It works on partitions.
So, clearly I'm missing something.
Click to expand...
Click to collapse
Yes, Renate, that's what I don't understand either. I don't know much about all this, but most of what I read about this error was about a wrong img. Though the first thing I did was to download from this website the latest twrp available but again it failed.
I'll try all what you ppl adviced me to do, and will come back here to talk about the results.
Many thanks
ok, let's try to dig in:
imgutil /v /l gives me this ;
Header1: 1,648 (00000670) Kernel: 17,767,553 (010f1c81) 00001000 Payload: 17,369,640 (01090a28) DTB: 397,913 (00061259) Ramdisk: 27,351,923 (01a15b73) 010f3000 Recovery: 261,873 (0003fef1) 02b09000 Signature: 2,432 (00000980) 02b49000 Padding: 88,825,856 (054b6000) 02b4a000
fastboot getvar all returns many things but there's no recovery partition yet.
here is what I get about this twrp file (using cygwin)
file twrp.img twrp.img: Android bootimg, kernel (0x8000), ramdisk (0x1000000), page size: 4096, cmdline (androidboot.hardware=qcom androidboot.memcg=1 lpm_levels.sleep_disabled=1 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filt)
You make that hard to read:
Code:
Header1: 1,648 (00000670)
Kernel: 17,767,553 (010f1c81) 00001000
Payload: 17,369,640 (01090a28)
DTB: 397,913 (00061259)
Ramdisk: 27,351,923 (01a15b73) 010f3000
Recovery: 261,873 (0003fef1) 02b09000
Signature: 2,432 (00000980) 02b49000
Padding: 88,825,856 (054b6000) 02b4a000
Are you rooted and/or can you do any of the following commands over adb shell:
Code:
ls -l /dev/block/by-name
(We only care about recovery partition(s).)
Code:
dd if=/dev/block/by-name/recovery of=/dev/null
What does it say for numbers?
Ok, for what I understand (not much) here are the answers:
ls -l /dev/block/by-name
Code:
otal 0
lrwxrwxrwx 1 root root 16 1972-07-14 02:48 abl -> /dev/block/sde35
....
lrwxrwxrwx 1 root root 15 1972-07-14 02:48 bk51 -> /dev/block/sdf2
lrwxrwxrwx 1 root root 15 1972-07-14 02:48 bk52 -> /dev/block/sdf3
....
lrwxrwxrwx 1 root root 16 1972-07-14 02:48 rawdump -> /dev/block/sda27
lrwxrwxrwx 1 root root 16 1972-07-14 02:48 recovery -> /dev/block/sda28
lrwxrwxrwx 1 root root 14 1972-07-14 02:48 sda -> /dev/block/sda
lrwxrwxrwx 1 root root 14 1972-07-14 02:48 sdb -> /dev/block/sdb
lrwxrwxrwx 1 root root 14 1972-07-14 02:48 sdc -> /dev/block/sdc
lrwxrwxrwx 1 root root 14 1972-07-14 02:48 sdd -> /dev/block/sdd
lrwxrwxrwx 1 root root 14 1972-07-14 02:48 sde -> /dev/block/sde
lrwxrwxrwx 1 root root 14 1972-07-14 02:48 sdf -> /dev/block/sdf
lrwxrwxrwx 1 root root 15 1972-07-14 02:48 secdata -> /dev/block/sde3
lrwxrwxrwx 1 root root 16 1972-07-14 02:48 splash -> /dev/block/sda21
lrwxrwxrwx 1 root root 16 1972-07-14 02:48 spunvm -> /dev/block/sde41
lrwxrwxrwx 1 root root 15 1972-07-14 02:48 ssd -> /dev/block/sda2
lrwxrwxrwx 1 root root 16 1972-07-14 02:48 storsec -> /dev/block/sde11
lrwxrwxrwx 1 root root 15 1972-07-14 02:48 switch -> /dev/block/sda1
lrwxrwxrwx 1 root root 16 1972-07-14 02:48 system -> /dev/block/sde54
...
I then tried to launch dd if=/dev/block/by-name/recovery of=/dev/null
But I got only errors:
from cygwin terminal, in platform tools folder I launched everything I could but for no avail...
Code:
$ adb shell dd if=/dev/block/by-name/recovery of=/dev/null
dd: /dev/block/by-name/recovery: Permission denied
**I tried to replace "recovery" with sda28
Code:
/platform-tools
$ adb shell dd if=/dev/block/by-name/sda28 of=/dev/null
dd: /dev/block/by-name/sda28: No such file or directory
dunno what to do...
Cyjam said:
Code:
lrwxrwxrwx 1 root root 16 1972-07-14 02:48 recovery -> /dev/block/sda28
Click to expand...
Click to collapse
Ok, so you have a nice recovery partition. We still don't know how big it is.
You can chop down (a copy of) your image to something smaller and try that.
Eventually we'll find something that fits. Whether it works is a different question.
The current source code for fastboot doesn't have any error that has "volume" in it. That's one reason that I'm confused.
I wasn't really expecting dd to work, that's usually only for root.
So do that imgutil /p copy-of and try to flash it.
Some questions...
Really sweet or sweetin?
TWRP (recovery partition) doesn't equal with system, system full was shown in flashing recovery?
Which recovery was tried to flash?
Tried completely clean flash?
Tried to flash stock with miflash?
Hi laptapper, thanks for trying to help. Unfo, I'm a real noob and unsure about any of your questions:
Really sweet or sweetin? what's the difference?
TWRP (recovery partition) doesn't equal with system, system full was shown in flashing recovery?
Which recovery was tried to flash? the last one available, TWRP-3.6.2_12.1-sweet-20220705
Tried completely clean flash? don't know what "clean flash" is, but I guess i didn't try it, meaning, I did not swipe my phone. I'd be happy to flash it without totally reseting it.
Tried to flash stock with miflash? never heard about this.
Cyjam said:
Hi laptapper, thanks for trying to help. Unfo, I'm a real noob and unsure about any of your questions:
Really sweet or sweetin? what's the difference?
TWRP (recovery partition) doesn't equal with system, system full was shown in flashing recovery?
Which recovery was tried to flash? the last one available, TWRP-3.6.2_12.1-sweet-20220705
Tried completely clean flash? don't know what "clean flash" is, but I guess i didn't try it, meaning, I did not swipe my phone. I'd be happy to flash it without totally reseting it.
Tried to flash stock with miflash? never heard about this.
Click to expand...
Click to collapse
Sweet or sweetin means I wanna know if it's a Redmi note 10 pro and which variant.
First get orange fox 12.1.3 and try to flash
Complete clean flash means format data with yes (almost necessary)
I suggest to read more in this forum....to get more knowledge
I was trying to use a 120mb twrp then I downloaded a smaller one of 60mb from the official website and it worked