[GUIDE][ROOT] Resizing emulated SD card and userdata partitions - Android General

I originally created this guide for Sony Xperia T/TL/TX/V and have since discovered that the method works for other devices, too. So I present the universal guide to getting rid of that annoyingly tiny allocation of space for internal storage in devices that have plenty of it.
Kudos to @teidus for pointing me to this long-forgotten method.
Screenshots of proof are attached to my original post.
WARNING: You will lose a lot of data if you don't follow this guide!
WARNING: These operations require a rooted device. If you are running unrooted Android 4.3 or newer, you cannot proceed.
NOTE: All of these changes will be reversed if you flash a factory image that contains a partition table.
DISCLAIMER: I'm not responsible for bricked devices and data loss from power surges, hardware damage, or changes to the linked software. Always check the native manuals for all the tools listed here!
I'm also not responsible for your curiosity and desire to resize other partitions. I haven't tried that because messing with /system and /cache can lead to unexpected results.
Requirements:
1. Your device must currently have root access, CMW recovery v6.0.4.6 or later, less than 50% allocated to internal storage, emulated SD card (usually, it's /storage/sdcard0), and at least 8GB of total onboard memory. If you answered "No" to at least one of these, this guide won't help you. To check whether you have an emulated SD card, remove your physical SD card, go into a file manager app, and see whether you still have some sdcard listed.
2. A factory image flashing software for your device unzipped and/or installed on your computer. Look in the relevant forums for downloads.
3. ADB from either Android SDK or your device's flashing tool. Look in the relevant forums for instructions.
4. For locked bootloaders, factory firmware image with Android v4.1.2 or v4.0.x saved on your computer (consult your flashing tool's manual for the default location) - nearly 100% of these have root exploits. Look in the relevant forums for downloads.
5. Root exploit with Superuser or SuperSU installer for your device unzipped on your computer. Look in the relevant forums for downloads.
6. CMW recovery installer v6.0.4.6 or later compatible with your device and the factory firmware version obtained in step 4 unzipped on your computer. Look in the relevant forums for downloads.
7. File system utilities (attached) unzipped to a folder on your device's physical SD card you'll remember (I'll be using /fs-utils in this guide).
8. For Windows 8 users, ADB drivers for your device.​
The Guide (skip all the way to the bottom for the short list of ADB commands):
1. Back up all data stored on internal storage:
Option 1: Connect your device to the computer and save it to a computer drive.
Option 2: Open a file manager on the device and copy it to a physical SD card (/sdcard1).​2. Back up your current installation with either Online Nandroid or your current recovery and remove the SD card for safety.
3. Flash your device with basic 4.1.2 install.
Refer to the documentation for your tool.​4. Connect your device to the computer and let the computer recognize it.
5. Enable USB debugging.
5.1 Go to (System) Settings -> Developer options and flip the switch in the top-right corner of the screen.
5.2 Look a bit down (toward the middle of the screen) and check USB debugging.​6. Root your device.
Refer to the documentation for your tool.​7. Install recovery on your device.
Refer to the documentation for your tool.​8. Boot into CMW recovery.
Depending on the device, reboot into recovery may be available in the power menu, or you'll need to press/hold a button during the power on sequence. Refer to the documentation for your recovery.​9. After the device boots into recovery, connect it to the computer.
10. Start ADB shell in command prompt.
Navigate to the folder where adb.exe resides, hold SHIFT, right click the mouse, and select Open command window here, then type adb shell in the command prompt and press ENTER.​11. Execute the following commands one-by-one (you can copy & paste, hit enter, and wait for the output):
Code:
umount /storage
parted /dev/block/mmcblk0
print
These commands unmount all drives, launch parted utility for mmcblk0 (onboard flash storage), and display the partition table on your screen.​12. Write down the info from the following columns for partitions Userdata and SDCard (or Media). Usually, they are the last 2 partitions.
Column 1 - Number, Column 2 - Start, Column 3 - End, Column 5 - File system, Column 6 - Name. The start of the first partition and the end of the second partition are the limits, within which your new partitions will be created. The numbers are in megabytes (MB) unless specified. Make sure the name is recorded just as it appears in the partition table - Andorid is case-sensitive.​13. Remove the 2 partitions by executing the following commands:
Adjust the numbers according to your system.​
Code:
rm 14
rm 15
14. Calculate the new start and end point for both partitions.
For the first partition, the start point will be the same. For the second partition, the end point will be the same. The end point of the first partition is the start point of the second partition.
Take the end number for the first partition you recorded in step 12, add more space to get the new end. Alternatively, if your first partition is actually the emulated storage, subtract the reallocated space to get the new end point. I advise to add at least 2GB (2048MB) to Userdata feel safe about having enough storage for apps. DON'T TRY TO REMOVE EMULATED STORAGE ALTOGETHER BY ALLOCATING ALL OF THE AVAILABLE SPACE TO USERDATA! Emulated storage is coded into OS environment and requires additional modifications to work properly.​15. Create and name new partitions by executing the following commands (don't copy the text in parentheses):
The system might throw several errors in the process. When prompted, just type ignore and hit ENTER.​
Code:
mkpartfs logical ext2 OLD_START NEW_END (change ext2 to fat32 if the first partition had that file system)
name 14 Userdata (change the number and the name according to your environment)
mkpartfs logical ext2 NEW_START OLD_END (change ext2 to fat32 if the second partition had that file system; make sure to include GB as the designation of the end point in order to stretch the partition to the end of the onboard storage)
name 15 SDCard (change the number and the name according to your environment)
quit
These commands create the partitions with ext2 file system and given beginning and end parameters, rename them as required, and close parted.​16. "Damage" the internal, emulated SD card so that it could be formatted properly later. REMOVE YOUR PHYSICAL SD CARD BEFORE THIS STEP TO AVOID WIPING THE WRONG CARD!!!
Tap Mounts and storage -> Format /storage/sdcard0 -> default and confirm the operation.​17. Insert the physical SD card (sdcard1) that you removed in step 2 back into the device.
Make sure it's mounted by going to Mounts and storage and checking its status (it should say unmount /storage/sdcard1/). If not, mount it by executing on the appropriate option.​18. Execute the following commands one-by-one in the ADB command prompt:
Code:
cd /storage/sdcard1/fs-utils (the directory name will be different if you didn't follow my conventions)
tune2fs -j /dev/block/mmcblk0p14 (change the number in mmcblk0pXX according to your environment - that's the partition that need to have file system ext4 - refer to your notes from step 12)
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p14 (change the number in mmcblk0pXX according to your environment)
e2fsck -fpDC0 /dev/block/mmcblk0p14 (change the number in mmcblk0pXX according to your environment)
These commands convert Userdata partition into the appropriate ext4 filesystem, which is not supported natively in the recovery environment. If you receive any errors while executing these commands, reboot recovery.​19. Reboot the device into full Android.
19.1 Remove the physical SD card for safety.
19.2 Go to the top menu level of recovery. Then select the top option Reboot the device.​20. When Android loads fully, you'll notice a notification about storage file system. Tap it and follow the prompts to format it.
21. Insert the physical SD card and reboot into the recovery to restore the backup from step 2.
Backup and Restore -> Restore from /storage/sdcard1.​22. Reboot back into full Android and copy the files saved from internal storage back into it. Then reboot again so that apps recognize the data.
DONE!​
Short guide/list of ADB commands and other events (*enclosed in asterisks*) if you know the safety drill & bash-based parted utility:
Code:
*flash 4.1.2 & install recovery*
*boot recovery*
adb shell
umount /storage
parted /dev/block/mmcblk0
print
*record start point of Userdata and end point of SDCard*
rm 15 (change the number according to your environment)
rm 14 (change the number according to your environment)
mkpartfs logical ext2 1621 7865 (change the numbers according to your environment)
name 14 Userdata (change the number and the name according to your environment)
mkpartfs logical ext2 7865 15.6GB (change the numbers according to your environment)
name 15 SDCard (change the number and the name according to your environment)
*remove physical SD card*
*Mounts and storage -> Format /storage/sdcard0 -> default -> confirm*
*insert physical SD card*
*Mounts and storage -> Mount /storage/sdcard1*
cd /storage/sdcard1/fs-utils
tune2fs -j /dev/block/mmcblk0p14 (change the number in mmcblk0pXX according to your environment)
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p14 (change the number in mmcblk0pXX according to your environment)
e2fsck -fpDC0 /dev/block/mmcblk0p14 (change the number in mmcblk0pXX according to your environment)
*remove physical SD card*
*reboot*
*format emulated SD card*
*reboot recovery*
*restore backup*
*reboot*
*restore sdcard0/*
*reboot*

FAQ
Will it work with Android 4.2/4.3/4.4 or an older version of recovery?
So far I have tested with the versions mentioned in the guide. You can test whether this method will work for your setup without jeopardizing any data by completing step 7 of requirements and executing the following commands in ADB shell after booting into your recovery:
Code:
parted /dev/block/mmcblk0
print *wait for output*
quit
cd /storage/sdcard1 *change if your physical sdcard is sdcard0*
tune2fs *no parameters*
e2fsck *no parameters*
No errors indicate the method works for you. Please make sure to tell me about your setup in the comments - I'll update the compatibility list.

Tested devices
Did it work on your device or did you fail? Leave a comment and I'll update the list!
Barnes & Noble
- Nook Tablet 16GB
Sony
- Xperia T/TL/TX

Links to tools and recoveries
Reserved

Sorry for bumping an old thread, but is there any way to remove the emulated SD card ? Or, at least point the physical SD Card as the primary SD Card.
I have searched everywhere but I can't seem to do it. If you know a way, it will help a LOT of people, because a lot of people have this problem and the solutions is not working. I tried to use the app from playstore, didn't work. Tried to find vold.fstab, no vold.fstab available in CM11. My device is XIaomi Redmi 1s running CM11.

derpotato said:
Sorry for bumping an old thread, but is there any way to remove the emulated SD card ? Or, at least point the physical SD Card as the primary SD Card.
I have searched everywhere but I can't seem to do it. If you know a way, it will help a LOT of people, because a lot of people have this problem and the solutions is not working. I tried to use the app from playstore, didn't work. Tried to find vold.fstab, no vold.fstab available in CM11. My device is XIaomi Redmi 1s running CM11.
Click to expand...
Click to collapse
As far as I could understand in Xperia environment settings, "internal storage" is a required location for OS. I think it's possible to emulate that access on an SD card but it would require decompiling and recompiling environment data or something else with a high risk of failing since you'd need to modify the OS instead of just the partition table.

bsined said:
As far as I could understand in Xperia environment settings, "internal storage" is a required location for OS. I think it's possible to emulate that access on an SD card but it would require decompiling and recompiling environment data or something else with a high risk of failing since you'd need to modify the OS instead of just the partition table.
Click to expand...
Click to collapse
Oh I see.. that's too bad. Well, thanks for the information

ignore this

does this method work on Xperia ZR stock 4.4.4 with NUT's dual recovery installed?
in the step where phone has to be booted in recovery mode n connected to pc via USB, nothing happens as I connect. when I type adb shell, error message returns as device not found.
Is there any work around or guide for this?

sourabhp said:
does this method work on Xperia ZR stock 4.4.4 with NUT's dual recovery installed?
in the step where phone has to be booted in recovery mode n connected to pc via USB, nothing happens as I connect. when I type adb shell, error message returns as device not found.
Is there any work around or guide for this?
Click to expand...
Click to collapse
I think there are separate drivers for ADB to work in recovery mode. Sorry that I forgot about them and I'm not sure whether they're included with FlashTool. My best suggestion is to search the forums.

bsined said:
I think there are separate drivers for ADB to work in recovery mode. Sorry that I forgot about them and I'm not sure whether they're included with FlashTool. My best suggestion is to search the forums.
Click to expand...
Click to collapse
I searched with google for ADB drivers in recovery mode and found one but even after that device was not detected in recovery mode.
I tried uninstalling and re-installing drivers but no luck. may be need more research

bsined said:
Code:
cd /storage/sdcard1/fs-utils (the directory name will be different if you didn't follow my conventions)
tune2fs -j /dev/block/mmcblk0p14 (change the number in mmcblk0pXX according to your environment - that's the partition that need to have file system ext4 - refer to your notes from step 12)
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p14 (change the number in mmcblk0pXX according to your environment)
e2fsck -fpDC0 /dev/block/mmcblk0p14 (change the number in mmcblk0pXX according to your environment)
These commands convert Userdata partition into the appropriate ext4 filesystem, which is not supported natively in the recovery environment. If you receive any errors while executing these commands, reboot recovery.​[/code][/hide]
[/size]
Click to expand...
Click to collapse
Thanx bro. I have successfully partitioned my device (Xperia L).
But when I checked the file system, it is ext3 not ext4.
Still my device is running well.
Will it effect the performance of my device?

Is it possible using this method to shirk down the size of SYSTEM partition too?
Any extra caution need to take k?

jjiiaa said:
Is it possible using this method to shirk down the size of SYSTEM partition too?
Any extra caution need to take k?
Click to expand...
Click to collapse
First off, SYSTEM partition isn't that big - less than 1GB, so you won't gain much from shrinking it. Secondly, I'm not sure where recovery is written. You're risking bricking your phone. Lastly, if you shrink the partition too tightly, you'll effectively remove the ability to upgrade your device's firmware because all ROMs have various sizes.

I have installed Bliss Pop Lollipop 5.0.2 ROM on my Xperia L, will this make any difference? Should this work?

israfild said:
I have installed Bliss Pop Lollipop 5.0.2 ROM on my Xperia L, will this make any difference? Should this work?
Click to expand...
Click to collapse
I think Android 4.4+ utilizes the entire internal storage as a single block, so the guide is pointless. If that's not the case on your device and you're willing to be the guinea pig, please do attempt the repartitioning and report on the results.
Sent from my LT30p using XDA Free mobile app

@bsined i follow the steps but now i stay with a corrupt table and ia cant start my phone XPERIA L i follow the step i dont know what i did bad can you help me?

zero995 said:
@bsined i follow the steps but now i stay with a corrupt table and ia cant start my phone XPERIA L i follow the step i dont know what i did bad can you help me?
Click to expand...
Click to collapse
Just double-checking that you had downgraded to 4.1 before resizing. You should be able to recover your device by flashing any FTF with Flashtool.

i try with 4.1 and 4.2.2 by ftf but no my phone doesnt start now i'm tired i got leave that perhaps i'm gonna buy a new phone pfff :c

zero995 said:
i try with 4.1 and 4.2.2 by ftf but no my phone doesnt start now i'm tired i got leave that perhaps i'm gonna buy a new phone pfff :c
Click to expand...
Click to collapse
If the phone doesn't start at all, that doesn't sound like it's related to partition tables. If the screen, the vibrator, and the LED turn on, the phone is in a soft brick and should be recoverable. You should ask in the FTF threads if you get any errors in flashtool.

Related

[REF] Fix internal SD partitions

DISCLOSURE: Not responsible for you being retarded and breaking what doesn't need fixed.
DISCLOSURE 2: Do not use this on the O2x as it has a slightly different partition table.
Here is my step by step for repairing the internalsd Partitions... I don't think I've forgotten anything in this. If anyone knows how to write this into a .zip for flash via CWR it would be great. Credit goes to TeamWhiskey for helping me out when I screwed my partition table up...
WARNING: This can destory your internalSD card partitions. If it's not broke don't fix it!
ALL ENTRIES ARE IN RED
I am not responsible for any damage you do to your phone.
I did this same thing to my phone... I was still able to get into recovery though. You can repair the internal partitions through ADB if you can still get into recovery.
Steps to recreate partitions.
Boot into recovery
from your PC open cmd prompt
change to your ADB directory
run adb shell
mkfs /dev/block/mmcblk0
fdisk -H 1 /dev/block/mmcblk0
if the above fails try fdisk -l /dev/block/mmcblk0
then fdisk -H 1 /dev/block/mmcblk0
once in the fdisk of ../mmcblk0 you might as well delete all the partitions if you believe that they are corrupted
d
1
repeat for partition 2-8
one all of your partitions are gone you now have a blank internal SD and will need to execute the following to restore all the proper partition sizes
Partition 1
n
p
1
First Cylinder start 129
First Cylinder stop 55168
We will repeat this for partitions 2 and 3
Partition 2
n
p
2
Start 55169
Stop 63360
Partition 3
n
p
3
Start 63361
Stop 63616
On to partition 4 which will be extended (this is the last partion you will choose primary or extended)
Partition 4
n
e
4
Start 63617
Stop 975424
Now onto partition 4-8 which are automatically selected as logicall partions (no option is given)
Partition 5
n
Start 63681
Stop 64704
Partition 6
n
Start 64769
Stop 65088
Partition 7
n
Start 65153
Stop 261760
Partition 8
n
Start 261825
Stop 975424
Once you have done this the partitions are ready to be written to the internalSD
I would recommend choosing the command p to verify that all of your start and stop blocks are correct.
From this point you have the option to either quit without saving changes "q" or to write the partition table itself "w". Once you are sure that you have entered all of your partitions correctly you can choose the command w
At this point you have recreated all the partitions on your InternalSD card. If you have a nandroid backup at this point you should be able to restore it without a problem once you copy it over to the internal or external (depending on which CWR you are running).
I didn't have to go through the format portion of the fdisk as I had a nandroid backup which formats all the partitions itself.
If I've forgotten any steps please feel free to comment and include them.
Thanks to TeamWhiskey for helping me resolve this issue when I had it...
Don't forget to click the Thanks button if this helped...
When i get to
Code:
fdisk -h 1 /dev/block/mmcblk0
I get
Code:
unknown option -- hBusyBox v1.16.2androidminimal (2010-03-28 22:34:51 EDT) multi
-call binary.
Did i do anything wrong ?
exPos3D said:
When i get to
Code:
fdisk -h 1 /dev/block/mmcblk0
I get
Code:
unknown option -- hBusyBox v1.16.2androidminimal (2010-03-28 22:34:51 EDT) multi
-call binary.
Did i do anything wrong ?
Click to expand...
Click to collapse
My apologies it is the correct code but should be
Code:
fdisk -H 1 /dev/block/mmcblk0
"I sometimes forget linux commands are case sensitive"
After doing all the steps
When its time to write the tables by executing the "w" command i get this error
Code:
Command (m for help): w
w
The partition table has been altered!
Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses old table: D
evice or resource busy
exPos3D said:
After doing all the steps
When its time to write the tables by executing the "w" command i get this error
Code:
Command (m for help): w
w
The partition table has been altered!
Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses old table: D
evice or resource busy
Click to expand...
Click to collapse
seems as if I may have forgotten a step but I don't think that I did....
before doing the fdisk command try
Code:
mkfs /dev/block/mmcblk0
if that doesn't work goin into your adb shell and do an
Code:
fdisk -l /dev/block/mmcblk0
and
Code:
fdisk -H 1 /dev/block/mmcblk0
p
and paste the output
It worked thanks but now my sdcard still wont mount for any of my apps, or camera. I can add items to my sd card and install to it, but it still wont mount
I'm not in this area so i do not know where to find files ADB on my computer. If you have time, can you be more detailed instructions to help me ? thank you very much . I waiting for your answer,.
chulun9999 said:
I'm not in this area so i do not know where to find files ADB on my computer. If you have time, can you be more detailed instructions to help me ? thank you very much . I waiting for your answer,.
Click to expand...
Click to collapse
Please use the search function....
http://www.xda-developers.com/android/adb-easy-tutorial/
So I can boot into CWM, but when I try to use ADB it says "Device not found" ...
The phone will boot into the o2x OS, but I get no cell signal. When it boots into the OS, ADB finds it no problem.
Any suggestions?? Does ADB work with all versions of CWM??
Thanks so much for the partition table info!
Try this ... Stock nandroid
Command in windows
Can you post the command you mentioned for linux , to do it in windows . Am using windows 7 . LG update tool screwed my mobile and i have to proceed only with restoring the partition tables .
casper200519 said:
DISCLOSURE: Not responsible for you being retarded and breaking what doesn't need fixed.
DISCLOSURE 2: Do not use this on the O2x as it has a slightly different partition table.
Here is my step by step for repairing the internalsd Partitions... I don't think I've forgotten anything in this. If anyone knows how to write this into a .zip for flash via CWR it would be great. Credit goes to TeamWhiskey for helping me out when I screwed my partition table up...
WARNING: This can destory your internalSD card partitions. If it's not broke don't fix it!
ALL ENTRIES ARE IN RED
I am not responsible for any damage you do to your phone.
I did this same thing to my phone... I was still able to get into recovery though. You can repair the internal partitions through ADB if you can still get into recovery.
Steps to recreate partitions.
Boot into recovery
from your PC open cmd prompt
change to your ADB directory
run adb shell
fdisk -h 1 /dev/block/mmcblk0
once in the fdisk of ../mmcblk0 you might as well delete all the partitions if you believe that they are corrupted
d
1
repeat for partition 2-8
one all of your partitions are gone you now have a blank internal SD and will need to execute the following to restore all the proper partition sizes
Partition 1
n
p
1
First Cylinder start 129
First Cylinder stop 55168
We will repeat this for partitions 2 and 3
Partition 2
n
p
2
Start 55169
Stop 63360
Partition 3
n
p
3
Start 63361
Stop 63616
On to partition 4 which will be extended (this is the last partion you will choose primary or extended)
Partition 4
n
e
4
Start 63617
Stop 975424
Now onto partition 4-8 which are automatically selected as logicall partions (no option is given)
Partition 5
n
Start 63681
Stop 64704
Partition 6
n
Start 64769
Stop 65088
Partition 7
n
Start 65153
Stop 261760
Partition 8
n
Start 261825
Stop 975424
Once you have done this the partitions are ready to be written to the internalSD
I would recommend choosing the command p to verify that all of your start and stop blocks are correct.
From this point you have the option to either quit without saving changes "q" or to write the partition table itself "w". Once you are sure that you have entered all of your partitions correctly you can choose the command w
At this point you have recreated all the partitions on your InternalSD card. If you have a nandroid backup at this point you should be able to restore it without a problem once you copy it over to the internal or external (depending on which CWR you are running).
I didn't have to go through the format portion of the fdisk as I had a nandroid backup which formats all the partitions itself.
If I've forgotten any steps please feel free to comment and include them.
Thanks to TeamWhiskey for helping me resolve this issue when I had it...
Click to expand...
Click to collapse
Can you post the commands to do it from windows ?
bibinkalarikkal said:
Can you post the commands to do it from windows ?
Click to expand...
Click to collapse
Read and go step by step, these are for windows
Sent from my LG-P999 using XDA Premium App
Is there a way to use this app to create one partition just for user app storage? I don't want or need an internal sdcard partition!
Sent from my LG-P999 using xda premium
DUDE!!
Thanks to your instructions and one hour of simple restoration work and my G2X was back in the game. This is for those not faint of heart, but if you've made it far enuff to delete your Internal partitions...Then you could handle these instructions...
PROPZ!!!!
I couldn't do it.When I wrote fdisk -h 1 /dev/block/mmcblk0 to adb shell there was 4 different options.
Usage:fdisk [-ull] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b DISK
Change partition table
-u Starts and End are in sectors <instead of cylinders>
-l Show partition table for each DISK, then EXIT
-b 2048 <for certain MO disks>use 2048-byte sectors
-C CYLINDERS Set number of cylinders/heads/sectors
-H HEADS
-S SECTORS
~ #
I don't know what to do.Can you please help me with this?
I tried this because my device was failing while OneClickRecoveryFlash. NVError 0x120000
I'm about to get a g2x, however I have a question..
What causes bad partitioning table? Or messed up partition table?
nitrogen618 said:
I'm about to get a g2x, however I have a question..
What causes bad partitioning table? Or messed up partition table?
Click to expand...
Click to collapse
Flashing a G2X or WIND Optimus 2X which are the same LG-P999 handset with anything for the Optimus 2X (O2X) which is the LG-P990. They use the same internal hardware except for the cell radio modem and use different partition tables so their firmware and ROMs are incompatible. When the LG-P999 is flashed with LG-P990 stuff the LG-P999 will boot as an LG-P990 but there won't be any cell services.
Another reason is an incomplete flashing with LG-P999 firmware.
Core Memory said:
Flashing a G2X or WIND Optimus 2X which are the same LG-P999 handset with anything for the Optimus 2X (O2X) which is the LG-P990. They use the same internal hardware except for the cell radio modem and use different partition tables so their firmware and ROMs are incompatible. When the LG-P999 is flashed with LG-P990 stuff the LG-P999 will boot as an LG-P990 but there won't be any cell services.
Another reason is an incomplete flashing with LG-P999 firmware.
Click to expand...
Click to collapse
Ah, so basically they flashed a p990 rom on a p999.
Another question, when flashing a new rom on cwm you do
-clear data/factory reset
-clear cache partition
-clear dalvik cache
-install rom from sd
Right?

[GUIDE][Using loop devices to workaround corrupt eMMC partitions]

Introduction
This workaround is for those of us (may only be me at this point?) who have bricked your Skyrocket by formatting a partition in an ICS-based kernel. This is where the kernel performed an MMC ERASE command and due to a bug in the eMMC firmware, the wear leveling data was corrupted.
The result is that accessing the affected section of eMMC causes the device to lock up. If we could find a way to avoid accessing those areas, the device might be usable again.
To further complicate matters, it seems that writing to the eMMC causes the problem to move around--probably because the eMMC tries to update the wear leveling data. As a result, any workaround needs to assume that no portion of the eMMC can be used for writable scratch space. That means it can't be used for /data, /cache, /tombstone, or "internal sd".
In this workaround, I create image files for the data, cache, and tombstone partitions on the external SD card. Then I modify the ramdisk to use the loop devices to mount these images as /data, /cache and /tombstone. The result is a bootable system.
The system obviously runs slower, but it is definitely tolerable. Usually the delay is noticed when opening an app for the first time. Another downside is that the "internal sd card" is gone and the "external sd card" is not USB mass storage mountable (since loop files are on it and therefore cannot be unmounted).
Thanks to seedub for the brainstorming session where we came up with this approach. I appreciate his Linux-fu.
Identifying If Important Partitions Work
On Skyrocket, for this workaround to be successful, we need at least the first 24 partitions to be okay. A few tests you should run:
Can you boot into download mode?
Can you boot into recovery mode?
In recovery, run "adb shell dd if=/dev/block/mmcblk0pX of=/dev/null" where X is 1-24. Do these all complete without error?
In recovery, can you install a ROM zip (e.g. CM9) without the device rebooting? (This is to test whether you can write to /system)
If the answer is "yes" to ALL of the questions above, then you are a candidate for this workaround.
Btw, always pull the battery and remove the USB cable before starting the above tests. Once the eMMC is locked up, it needs to be power cycled before it works again.
Creating The Image Files
You will need 1.5GB free. You can adjust the size of the data image to your liking. Boot into recovery and run the following commands in an "adb shell":
Code:
# Create an area on your SD card for the image files
mount /sdcard
cd /sdcard
mkdir emmc_workaround
cd emmc_workaround
# Create the data image file (1 GB - normally on /dev/block/mmcblk0p25)
dd if=/dev/zero of=/sdcard/emmc_workaround/data.img bs=1024 count=1048576
busybox losetup /dev/block/loop0 /sdcard/emmc_workaround/data.img
mkfs.ext4 -m 1 /dev/block/loop0
busybox losetup -d /dev/block/loop0
# Create the cache image file (297 MB - normally on /dev/block/mmcblk0p26)
dd if=/dev/zero of=/sdcard/emmc_workaround/cache.img bs=1024 count=304128
busybox losetup /dev/block/loop1 /sdcard/emmc_workaround/cache.img
mkfs.ext4 -m 1 /dev/block/loop1
busybox losetup -d /dev/block/loop1
# Create the tombstone image file (64 MB - normally on /dev/block/mmcblk0p27)
dd if=/dev/zero of=/sdcard/emmc_workaround/tombstone.img bs=1024 count=65536
busybox losetup /dev/block/loop2 /sdcard/emmc_workaround/tombstone.img
mkfs.ext4 -m 1 /dev/block/loop2
busybox losetup -d /dev/block/loop2
umount /sdcard
Modifying a ROM
We have to modify the ROM to make this work. With a lot of effort you might be able to modify a stock ROM, but I would recommend only modifying a built-from-source ROM. I used CM9 since, well, I am most familiar with it.
Here is the outline of the changes:
Disable the internal SD card on partition 28
Make the external SD card non-removable and disable USB mass storage for it
Rework the init scripts to mount the external SD card, attach the images to loop devices, and mount /cache, /data and /tombstone on their new loop devices
Apply patch #0001 (which is attached) to the device/samsung/skyrocket tree of CM9. See these build instructions: http://forum.xda-developers.com/showpost.php?p=25363482&postcount=3
Apply path #0002 if you want to move /cache to tmpfs instead of an image file. I'm still experimenting with this one.
Possible Improvements
I'm sure there are some ways to speed things up. I'll add to this list as we come up with more ideas.
Use smaller image files
Put /cache into a ramdisk -- probably would increase responsiveness a great deal (see patch #0002)
Repartition external SD card instead of using image files
so if some1 had a true brick where device can not turn on, this method still wont unbrick it
Mr. Top, you, sir, are a genius. Hopefully this will help us move forward with a possible unbrickable mod.
Sent from my SAMSUNG-SGH-I727 using XDA
Idea, What about cloning the whole emmc card boot partition and all to a microsd
vincom said:
so if some1 had a true brick where device can not turn on, this method still wont unbrick it
Click to expand...
Click to collapse
Yup. This is only for the Emmc lockup bug where it affects the data partitions,
Sent from my iPad using Tapatalk HD
tjsooley said:
Idea, What about cloning the whole emmc card boot partition and all to a microsd
Click to expand...
Click to collapse
That would definitely work if the boot partition of the Emmc was intact. I think partition #8. I don't know of a way to redirect the base kernel boot until it starts executing the init scripts.
Sent from my iPad using Tapatalk HD
In theory wouldn't you just have to change the memory address that the phone goes to when it first boots so it never looks at the original boot partition?
Sent from my SAMSUNG-SGH-I727 using XDA
Could you tell me what exactly causes this. So i can avoid it.
im currently on skyics latest leak with clock work mod touch recovery
i just would like to know what not to do. thanks
tpmullan said:
In theory wouldn't you just have to change the memory address that the phone goes to when it first boots so it never looks at the original boot partition?
Sent from my SAMSUNG-SGH-I727 using XDA
Click to expand...
Click to collapse
the memory address the pc points to on first boot/after resets is implemented in hardware iirc,,, bootstrapping etc.
Is there a way to unbrick this device without a JTAG using only the EMMC program? My answer to all the questions in this post is NO, my device does not turn ON at all but when I plug it into the computer, it shows on the Device Manager under COM7 port. I have installed the Qualcomm HS-USB QDLoader 9008 driver and it appears in EMMC software as in Download mode. I've searched on the internet and I cannot find a solution that is not using JTAG. Thanks for answering.

[Q] Use sdcard0 as sd-ext? Is it possible & expedient?

Hey, hoping someone on here may possibly know a definite answer to this. (goto last paragraph for my actual questions)
Since I got the Xperia L little over a year ago as a secondary phone, I started flashing and manipulating my (then) two devices, and I also use a lot more apps now than I did two years ago as my "need" to be mobile and stay available and connected has lately increased. Overall, I'm not too satisfied of the whole Android and apps concepts but, so far, I've appreciated the Xperia L as a versatile and unobtrusive device.
When its "internal storage" (or /data, basically) recently got a little cramped, I moved a few apps to SD via Android's native method, and when some apps wouldn't like to be moved or even stopped working after they got moved, I created an sd-ext partition in the external SD card and moved a few apps there, via symlinks first then via Mounts2SD - certain apps still seem to prefer to remain on the internal storage for some reason and some apps seem to act up (or lose settings etc), especially when /data/data is saved to sd-ext, or they wouldn't even run correctly, stop responding or crash (user apps only).
The "internal SD" is 4 GB in size and I barely need it for anything, other than saving ROM files, Gapps and aromafm when flashing without the external SD card present, which is 32 GB (and I have two of these) so I don't really see the point of saving work files and media on just another partition. I see how there may be a point in terms of speed, e.g. for taking pictures, since writing to the external SD card seems significantly slower (at most around 11 MB/s for larger files), and when saving apps to sd-ext, the internal storage provides enough space for a couple of photos anyway.
Now, my questions are if it's possible to use the internal SD partition as a mount point for sd-ext by whatever means, maybe swap certain /dev/blocks somehow, though I don't know which ones that would be and how I'd have to do that so Android doesn't give me the bird..?
And, considering the Linux way of "partitions" and mounts, is it even expedient practice to force apps "outside" the root/data structure..?
Is there a completely reliable (compatible and transparent) way to do this, so no apps ever complain about it, and then save/load their stuff (on either the internal or external SD), or would it generally be the better choice to remain with unchanged partitions..?
I take it there's no feasible way to actually re-partition the internal memory, so the whole /data thing would increase from 1.57 GB now to, say, 3.5 GB or more, leaving 1-2 GB for sdcard0 (enough for my purposes)..? (without an external input of sorts, however they initially put the partitions on the clean 8 GB memory)
harl windwolf said:
...
I take it there's no feasible way to actually re-partition the internal memory, so the whole /data thing would increase from 1.57 GB now to, say, 3.5 GB or more, leaving 1-2 GB for sdcard0 (enough for my purposes)..? (without an external input of sorts, however they initially put the partitions on the clean 8 GB memory)
Click to expand...
Click to collapse
Yes there is ... look at this post I made earlier.
If you need more specific directions, I can post the exact commands I used on my Xperia L.
Thank you very much!
That was easier than I expected and so far seems to have worked without an issue.
I was about to fall back to Android 4.4.4 with a clean installation of CM11 (fxp) anyway, so I basically just had to run those commands over ADB in addition, and now my Xperia L's /data partition is about 4.3 GB, with 1.22 GB left for sdcard0.
Cheers! :good:
You're very welcome glad it helped you out
harl windwolf said:
Thank you very much!
That was easier than I expected and so far seems to have worked without an issue.
I was about to fall back to Android 4.4.4 with a clean installation of CM11 (fxp) anyway, so I basically just had to run those commands over ADB in addition, and now my Xperia L's /data partition is about 4.3 GB, with 1.22 GB left for sdcard0.
Cheers! :good:
Click to expand...
Click to collapse
This works with the latest CM12 beta too?
@Kahana82 @harl windwolf
maybe you created the guide on xperia l?
thunderising said:
This works with the latest CM12 beta too?
Click to expand...
Click to collapse
From what I know, it *should* work with any version of Android, as long as you can access the phone's console via ADB as well as the recovery menu (to mount/unmount sdcard1 if necessary and then format sdcard0). The 2nd post in that other thread kind of confirms that.
Of course, if you want your apps and settings back, you still need to back them up first.
Especially though, if you'd plan on flashing a new ROM anyway, you don't even need to boot the OS along the way of (re)partitioning the internal memory (nor do you need to remove the external SD card if you know which one it is in the mount list).
Just boot into recovery, connect via ADB, mount the external SD card (sdcard1) so you can run fs-utils, then run the respective commands (from the other thread) one after another, format sdcard0 in recovery, and that's it - then just flash the new OS etc.
thunderising said:
This works with the latest CM12 beta too?
Click to expand...
Click to collapse
Yes, I'm using it like that since beta 2.
harl windwolf said:
From what I know, it *should* work with any version of Android, as long as you can access the phone's console via ADB as well as the recovery menu (to mount/unmount sdcard1 if necessary and then format sdcard0). The 2nd post in that other thread kind of confirms that.
Of course, if you want your apps and settings back, you still need to back them up first.
Especially though, if you'd plan on flashing a new ROM anyway, you don't even need to boot the OS along the way of (re)partitioning the internal memory (nor do you need to remove the external SD card if you know which one it is in the mount list).
Just boot into recovery, connect via ADB, mount the external SD card (sdcard1) so you can run fs-utils, then run the respective commands (from the other thread) one after another, format sdcard0 in recovery, and that's it - then just flash the new OS etc.
Click to expand...
Click to collapse
I came to the same conclusions, the phone still has its partitions, same file-systems and partition names...I don't see what could break the fact that it should be completely transparent on usage.
rostifaner said:
@Kahana82 @harl windwolf
maybe you created the guide on xperia l?
Click to expand...
Click to collapse
Here you go, these are the steps I followed on my Xperia L:
Open a command window: CMD, then get into shell:
adb shell
Once in shell, type:
umount /storage
parted /dev/block/mmcblk0
print
This prints out the partition information of your phone's memory chip
You will see the partition numbers in the first column, partition names in the last one,
in between you have the start/end memory index and the partition size
------start---end---size
...
31---1795---3506---1711---userdata
32---3506---7818---4312---sdcard​In the above output, consider the values indicated in italic as not to be changed !
Now calculate (open a spreadsheed if you like) the new value for the end of the userdata partition,
and use the same value for the start of the sdcard partition
On your sheet it should look something like this if you added 2048 to the userdata size
------start---end---size
31---1795---5554---3759---userdata
32---5554---7818---2264---sdcard​
Remove userdata and sdcard partitions:
rm 31
rm 32
Create the new userdata and sdcard partitions:
mkpartfs logical ext2 1795 5554
name 31 userdata
mkpartfs logical fat32 5554 7818
name 32 sdcard
Exit parted to go to the adb shell again:
quit
userdata partition (31) needs to have ext4 file system
The following will do the ext2->ext4 conversion:
cd /storage/sdcard1/fs-utils
tune2fs -j /dev/block/mmcblk0p31
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p31
e2fsck -fpDC0 /dev/block/mmcblk0p31
Now you can go to recovery and format the sdcard partition (default)
Then you can restore the backup you made before all this or do a clean install
I see a lot of people complaining about storage to install apps in the Lollipop threads, and are left in the dark most of the time.
Maybe it would be a good idea to rename this thread, so these people can find this information more easily...
 @MikeChannon (Mod): Also put a reference to it somewhere in one of the stickies ?
Kahana82 said:
I see a lot of people complaining about storage to install apps in the Lollipop threads, and are left in the dark most of the time.
Maybe it would be a good idea to rename this thread, so these people can find this information more easily...
@MikeChannon (Mod): Also put a reference to it somewhere in one of the stickies ?
Click to expand...
Click to collapse
Well I'm the Forum Admin. To rename or sticky threads it's best to contact one of the Forum Mods. For this forum they are:
The-Hulk
Tijmen
Toledo_JAB
wedgess
laufersteppenwolf
El Daddy
SREEPRAJAY
VECTUS
Whiskey103
B1nny
gregbradley
Arjen
Mike
Thanks Mike, sorry for the trouble.
I completely missed the "moderators" button on top of the forum (with all their names popping up when clicking on it) my bad.
Thus I reported my own post, which is probably the best way to get their attention anyway.
Can someone help me, i have brick my xperia. My mmcblk0 damaged. How can i restore this. Flashtool can`t restore firmware!
Here log
C:\Android>adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
~ # parted /dev/block/mmcblk0
parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
print
Error: /dev/block/mmcblk0: unrecognised disk label
(parted)
Kahana82 said:
Yes, I'm using it like that since beta 2.
I came to the same conclusions, the phone still has its partitions, same file-systems and partition names...I don't see what could break the fact that it should be completely transparent on usage.
Here you go, these are the steps I followed on my Xperia L:
Open a command window: CMD, then get into shell:
adb shell
Once in shell, type:
umount /storage
parted /dev/block/mmcblk0
print
This prints out the partition information of your phone's memory chip
You will see the partition numbers in the first column, partition names in the last one,
in between you have the start/end memory index and the partition size
------start---end---size
...
31---1795---3506---1711---userdata
32---3506---7818---4312---sdcard​In the above output, consider the values indicated in italic as not to be changed !
Now calculate (open a spreadsheed if you like) the new value for the end of the userdata partition,
and use the same value for the start of the sdcard partition
On your sheet it should look something like this if you added 2048 to the userdata size
------start---end---size
31---1795---5554---3759---userdata
32---5554---7818---2264---sdcard​
Remove userdata and sdcard partitions:
rm 31
rm 32
Create the new userdata and sdcard partitions:
mkpartfs logical ext2 1795 5554
name 31 userdata
mkpartfs logical fat32 5554 7818
name 32 sdcard
Exit parted to go to the adb shell again:
quit
userdata partition (31) needs to have ext4 file system
The following will do the ext2->ext4 conversion:
cd /storage/sdcard1/fs-utils
tune2fs -j /dev/block/mmcblk0p31
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p31
e2fsck -fpDC0 /dev/block/mmcblk0p31
Now you can go to recovery and format the sdcard partition (default)
Then you can restore the backup you made before all this or do a clean install
Click to expand...
Click to collapse
Thanks !! for putting up these instructions :good: :highfive: . I wanted to increase app storage and was just searching and found this post very useful, why don't you post this in general section so that more people can find it also add disclaimer that they might brick their device.
Works like a charm! Thank you very much, I have been searching for this since i bought the phone.
indade said:
Can someone help me, i have brick my xperia. My mmcblk0 damaged. How can i restore this. Flashtool can`t restore firmware!
Here log
C:\Android>adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
~ # parted /dev/block/mmcblk0
parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
print
Error: /dev/block/mmcblk0: unrecognised disk label
(parted)
Click to expand...
Click to collapse
Can you boot into flashmode ?
Kahana82 said:
userdata partition (31) needs to have ext4 file system
The following will do the ext2->ext4 conversion:
cd /storage/sdcard1/fs-utils
tune2fs -j /dev/block/mmcblk0p31
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p31
e2fsck -fpDC0 /dev/block/mmcblk0p31
Now you can go to recovery and format the sdcard partition (default)
Then you can restore the backup you made before all this or do a clean install
Click to expand...
Click to collapse
Thanx bro your guide helped me a lot and I have partitioned my XL.
My XL now has 3.2GB of device memory and 2.7GB of Internal storage.
But when I checked the storage by print command it shows the file system of device memory ext3 not ext4.
Phone is working as usual. But Is there any way to change it to ext4?
Edit - Today I checked again its now ext4. I don't know how.
Navneet Suresh said:
Can you boot into flashmode ?
Click to expand...
Click to collapse
Yes i can boot in flashmode, in fastboot, in recovery, but can`t install firmware
Can someone give me screenshot of their partitions(print command), original or not it doesn't matter, pls.
indade said:
Yes i can boot in flashmode, in fastboot, in recovery, but can`t install firmware
Click to expand...
Click to collapse
what error do you get
Navneet Suresh said:
what error do you get
Click to expand...
Click to collapse
In flashmode, by flashtool:
09/044/2015 15:44:39 - INFO - Flashtool Version 0.9.18.5 built on 14-02-2015 15:30:00
09/044/2015 15:44:39 - INFO - Executing search strategies to find proxy selector
09/044/2015 15:44:40 - INFO - No proxy found for IE. Trying next one
09/044/2015 15:44:40 - INFO - Strategy firefox failed trying next one : No Firefox installation found
09/044/2015 15:44:40 - INFO - No proxy found for java. Trying next one
09/044/2015 15:44:40 - INFO - Syncing devices from github
09/044/2015 15:44:40 - INFO - Scanning devices folder for changes.
09/044/2015 15:44:44 - INFO - Pulling changes from github.
09/044/2015 15:44:45 - INFO - Devices sync finished.
09/044/2015 15:44:49 - INFO - Device disconnected
09/046/2015 15:46:09 - INFO - Selected Bundle for SONY Xperia L. FW release : 15.3.A.1.17. Customization : C2105
09/046/2015 15:46:09 - INFO - Preparing files for flashing
09/046/2015 15:46:24 - INFO - Please connect your device into flashmode.
09/046/2015 15:46:28 - INFO - Device connected in flash mode
09/046/2015 15:46:28 - INFO - Opening device for R/W
09/046/2015 15:46:28 - INFO - Reading device information
09/047/2015 15:47:28 - INFO - Unable to read from phone after having opened it.
09/047/2015 15:47:28 - INFO - trying to continue anyway
09/047/2015 15:47:28 - INFO - Start Flashing
09/047/2015 15:47:28 - INFO - Processing loader.sin
09/047/2015 15:47:28 - INFO - Checking header
09/047/2015 15:47:28 - ERROR - Processing of loader.sin finished with errors.
09/047/2015 15:47:28 - INFO - Ending flash session
09/047/2015 15:47:28 - ERROR - Error in processHeader : 22 : Устройство не опознает команду.
09/047/2015 15:47:28 - ERROR - Error flashing. Aborted
09/047/2015 15:47:28 - INFO - Device disconnected
in recovery:
Can`t mount /cache/recovery/command
Can`t mount /cache/recovery/log
Can`t mount /cache/recovery/last_log
Can`t mount /cache/recovery/last_install

[SOLVED] Decryption Unsuccessful and a currently bricked M8

I previously ran LolliGPE but was long overdue for an update. I downloaded the latest version and copied the image to my phone and flashed the ROM. I decided to go try a dirty install first to see if I could keep everything I had, since I had already been running a previous version and after reviewing the changelog did not see anything recommending to wipe clean. After installing successfully, Android asked me to enter my password to decrypt my data (I don't recall ever encrypting my data?), and so I did. It then told me that my password was right, but the data was corrupt, and presented me a button to reset my phone. The button redirected me to recovery and automatically attempted to wipe /data and then re-mount it, but the wipe failed. I rebooted again with the same issue, same failed attempt to wipe. I went to install the zip again, and this time do a full wipe, but it was unable to mount my phone's storage nor my SD card. I am not able to mount either at all now.
What's the best course of action? I'd like to retain as much as I can and avoid wiping all of the internal storage clean. Is there a simpler fix to this or am I doomed?
HBOOT: 3.19.0.0000
RADIO: 1.09.20.0926
OS: 3.28.605.4
EDIT: For anyone else having a problem like this that at least wants to get their data back, here's what you should do (I assume you know how to work with Linux!):
Make sure you have the latest version of TWRP and ADB.
Boot the phone into recovery mode and connect the phone to your computer via USB
Run "ls -al /dev/block/platform/msm_sdcc.1/by-name" and check the output. Make a note of the partition marked "userdata" - for me, it was /dev/block/mmcblk0p48.
Either: simply use adb pull to copy this file to your computer (this will require about 26 gigs of space), or attempt to mount the file. To use adb pull, execute "adb pull /dev/block/<ID> ./data" (ID being what you marked down). Your data partition will be copied to /data. To mount, use "mount -t ext4 /dev/block/<ID> /userdata". Whatever's left of your data will be on your phone's new /userdata folder.
Use ADB to pull what files you want from /userdata. If you pulled the partition, skip this step.
If you copied the files you wanted over, you're done. If you pulled the entire partition, you're going to want to try and mount it. On Windows, there are various tools to mount Linux partitions, a quick Google will find some good ones. However, if the data is corrupt, it will not work. I recommend attempting to repair the partition on linux, with the command "e2fsck -f -y /path/to/data", replacing the path to your data file as necessary. Once done, run "mount -t ext4 /path/to/data /mnt/data", replacing the paths as necessary.
Once mounted, you can access your data wherever it was mounted. If e2fsck appeared to fix many errors, chances are most of your data will be in the lost+found folder, and you'll need to sort through this yourself. If you're lucky, then your data will be intact and readily usable. Internal SD card data is located at ./media/0.
To fix the partitions and get Android back up and running, you need to install the latest firmware, format your data in TWRP, factory reset, and then flash a ROM again. Here's what I did to do that, without an SD card. If you have an SD card, simply copy your ROM zip to the SD card and skip the final steps:
Make sure you have the latest version of TWRP and ADB, and download the latest copy of the firmware (check the development forum here).
Boot the phone (doesn't matter to what) and run adb reboot bootloader. When your phone reboots, double-check by running fastboot reboot-bootloader.
Put your phone in RUU mode with fastboot oem rebootRUU. The phone will restart and the HTC logo will come up.
Wait a couple seconds, then run fastboot flash zip firmware.zip, where firmware.zip is the firmware you want to flash.
The first time you do this, it will fail saying something like "FAILED (remote: 90 hboot pre-update! please flush image again immediately)". Ignore this, run the last command again: fastboot flash zip firmware.zip
The progress bar will appear and begin filling. Wait until fastboot is finished flashig it (the progress bar may not fill completely), wait an extra 5 seconds or so, and then do fastboot reboot.
The phone will reboot. Android will still be messed up, but you can verify the partitions are in working order by checking adb shell cat /proc/emmc.
Once you know the partitions are working, get back into TWRP/recovery: adb reboot recovery
Format /data and wipe /cache, /data, dalvik/art cache, etc (factory reset). You will lose the contents of your internal storage and everything else.
If you don't have the ROM zip on an sd card, make sure the zip is in the same directory as adb and run adb push rom.zip /sdcard/rom.zip, where rom.zip is the ROM. You can also copy it to the external sd by swapping /sdcard/rom.zip with /external_storage/rom.zip.
Once copied, reboot into recovery and flash the zip. Back to normal!
Update:
It's a firmware problem. Apparently there was a new firmware update that the ROM uses that I don't have. mmcblk0p42 was changed to "vzw_logger" (which I don't have), making mmcblk0p49 userdata instead of previously mmcblk0p48. The data partition it expects to be /data is /cache. Got this information by comparing 'cat /proc/emmc' with information of the latest version I found here.
Is there a way to fix this that allows me to preserve the contents of my internal storage (/sdcard)? Can I just flash an older version of the ROM to backup my data?
Klayderpus said:
Update:
It's a firmware problem. Apparently there was a new firmware update that the ROM uses that I don't have. mmcblk0p42 was changed to "vzw_logger" (which I don't have), making mmcblk0p49 userdata instead of previously mmcblk0p48. The data partition it expects to be /data is /cache. Got this information by comparing 'cat /proc/emmc' with information of the latest version I found here.
Is there a way to fix this that allows me to preserve the contents of my internal storage (/sdcard)? Can I just flash an older version of the ROM to backup my data?
Click to expand...
Click to collapse
I posted a warning about this change in the general section early on. For you to have the partition changes means you are on the newer firmware which doesn't match what you posted above for os. You very likely at this point have nothing left to salvage. Are you on the latest twrp?
dottat said:
I posted a warning about this change in the general section early on. For you to have the partition changes means you are on the newer firmware which doesn't match what you posted above for os. You very likely at this point have nothing left to salvage. Are you on the latest twrp?
Click to expand...
Click to collapse
I am on the latest TWRP, yes. Since this post, I've actually been making good progress in getting the data partition back, or so I think. I've been using dd to copy /dev/block/mntblk0p48 to an image file, but got stuck when I reached the FAT32 limit, so I re-formatted my SD card, except now it's read-only.
Klayderpus said:
I am on the latest TWRP, yes. Since this post, I've actually been making good progress in getting the data partition back, or so I think. I've been using dd to copy /dev/block/mntblk0p48 to an image file, but got stuck when I reached the FAT32 limit, so I re-formatted my SD card, except now it's read-only.
Click to expand...
Click to collapse
If you Dd the entire data partition it's gonna be almost 25 gigs. If you can't mount data in twrp and find anything usable when browsing via adb in twrp there's probably not anything usable in there.
dottat said:
If you Dd the entire data partition it's gonna be almost 25 gigs. If you can't mount data in twrp and find anything usable when browsing via adb in twrp there's probably not anything usable in there.
Click to expand...
Click to collapse
I did a DD before while in ADB and it only got to about 1.3 gigs, but after running the image through e2fsck I actually found some images and downloads. I think there's usable stuff in there and I'd like to at least try to get it. There's family pictures and stuff on there that have some value to me. My SD card is 32 gigs so I could probably do it if anything for the hell of it.
Do you happen to know how I can get the SD card mounted? mount -o rw,remount /dev/block/mmcblk1p1 [some dir] is what I've been trying, but I've been getting either Read only filesystem or Invalid argument.
I might be a little crazy
Klayderpus said:
I did a DD before while in ADB and it only got to about 1.3 gigs, but after running the image through e2fsck I actually found some images and downloads. I think there's usable stuff in there and I'd like to at least try to get it. There's family pictures and stuff on there that have some value to me. My SD card is 32 gigs so I could probably do it if anything for the hell of it.
Do you happen to know how I can get the SD card mounted? mount -o rw,remount /dev/block/mmcblk1p1 [some dir] is what I've been trying, but I've been getting either Read only filesystem or Invalid argument.
I might be a little crazy
Click to expand...
Click to collapse
Its already mounted.. Just boot into TWRP while connected to your PC. Open cmd prompt in your adb directory.
adb shell
cd sdcard
ls
See if your internal SD card contents are listed.
dottat said:
Its already mounted.. Just boot into TWRP while connected to your PC. Open cmd prompt in your adb directory.
adb shell
cd sdcard
ls
See if your internal SD card contents are listed.
Click to expand...
Click to collapse
TWRP lists the internal SD card as being size 0 under Mount -> Select Storage and /sdcard is empty. I re-formatted my external SD card to make a full size image but that's what wasn't mounting.
Klayderpus said:
TWRP lists the internal SD card as being size 0 under Mount -> Select Storage and /sdcard is empty. I re-formatted my external SD card to make a full size image but that's what wasn't mounting.
Click to expand...
Click to collapse
Did you try the repair option for /data listed under wipe in TWRP?
dottat said:
Did you try the repair option for /data listed under wipe in TWRP?
Click to expand...
Click to collapse
Doesn't work. There's a couple of messages about not being able to mount /data and then:
Code:
Repairing Data using e2fsck...
E:Unable to repair '/data'.
E:Error repairing file system.
Klayderpus said:
Doesn't work. There's a couple of messages about not being able to mount /data and then:
Code:
Repairing Data using e2fsck...
E:Unable to repair '/data'.
E:Error repairing file system.
Click to expand...
Click to collapse
try this
adb shell
mount -t ext4 /dev/block/mmcblk0p49 /userdata
df
show me the output of df...
and if to be sure of which firmware you are on.. reboot recovery... and do the following....
adb shell
mount -t ext4 /dev/block/mmcblk0p48 /userdata
df
and show me that DF
I got all of my data back successfully. I'm updating the OP with the steps I did to get it back.
What's the next step? Change firmware? I have a local copy of what I needed from the phone, so anything's game now.
edit: /dev/block/mmcblk0p48 for me is userdata, 49 does not exist. Both mounts fail.
Code:
df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 933044 24 933020 0% /dev
tmpfs 933044 20 933024 0% /tmp
/dev/block/mmcblk0p47 1030828 16464 1014364 2% /cache
/dev/block/mmcblk1p1 30647232 12 29090436 0% /external_sd
/dev/block/mmcblk1p1 30647232 12 29090436 0% /and-sec
Klayderpus said:
I got all of my data back successfully. I'm updating the OP with the steps I did to get it back.
What's the next step? Change firmware? I have a local copy of what I needed from the phone, so anything's game now.
edit: /dev/block/mmcblk0p48 for me is userdata, 49 does not exist. Both mounts fail.
Code:
df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 933044 24 933020 0% /dev
tmpfs 933044 20 933024 0% /tmp
/dev/block/mmcblk0p47 1030828 16464 1014364 2% /cache
/dev/block/mmcblk1p1 30647232 12 29090436 0% /external_sd
/dev/block/mmcblk1p1 30647232 12 29090436 0% /and-sec
Click to expand...
Click to collapse
I would say update firmware. Since you confirmed blk48 as user data I know you don't have lollipop firmware.
I posted a firmware zip that contains the newest twrp which is compatible with lollipop in tigerstowns firmware thread. You can use that to update.
Then wipe and reinstall whatever Rom you want to use.
I fixed it this morning by updating firmware and will update the OP with the rest of the steps for the Googlers. Thanks again.
Klayderpus said:
EDIT: For anyone else having a problem like this that at least wants to get their data back, here's what you should do (I assume you know how to work with Linux!):
Make sure you have the latest version of TWRP and ADB.
Boot the phone into recovery mode and connect the phone to your computer via USB
Run "ls -al /dev/block/platform/msm_sdcc.1/by-name" and check the output. Make a note of the partition marked "userdata" - for me, it was /dev/block/mmcblk0p48.
Either: simply use adb pull to copy this file to your computer (this will require about 26 gigs of space), or attempt to mount the file. To use adb pull, execute "adb pull /dev/block/<ID> ./data" (ID being what you marked down). Your data partition will be copied to /data. To mount, use "mount -t ext4 /dev/block/<ID> /userdata". Whatever's left of your data will be on your phone's new /userdata folder.
Use ADB to pull what files you want from /userdata. If you pulled the partition, skip this step.
If you copied the files you wanted over, you're done. If you pulled the entire partition, you're going to want to try and mount it. On Windows, there are various tools to mount Linux partitions, a quick Google will find some good ones. However, if the data is corrupt, it will not work. I recommend attempting to repair the partition on linux, with the command "e2fsck -f -y /path/to/data", replacing the path to your data file as necessary. Once done, run "mount -t ext4 /path/to/data /mnt/data", replacing the paths as necessary.
Once mounted, you can access your data wherever it was mounted. If e2fsck appeared to fix many errors, chances are most of your data will be in the lost+found folder, and you'll need to sort through this yourself. If you're lucky, then your data will be intact and readily usable. Internal SD card data is located at ./media/0.
[/LIST]
Click to expand...
Click to collapse
I have a laptop running Ubuntu: where do I run the "ls -al /dev/block..." command? As in what folder do I need to be in? The phone only appears in an mtp capacity...
EDIT: I figured that out but now I am stuck at "adb pull /dev/block/<ID> ./data". My ID was mmcblk0p28 but the command returns "Bash: mmcblk0p28: no such file or directory exists"
EDIT 2: Got that command to work but the file is too large to write (My disk is FAT32 ). So I then tried the mount command but again got "no such file or directory exists".
Same Issue "Decryption Unsuccessful"
I was trying to apply the OTA update for 5.1 on my M8 converted to GPE 5.01, but had to update to the stock recovery, and found myself in the same situation with the "Decryption Unsuccessful" message.
Following Klayderpus' steps to recover, but I'm running into a few issues:
1) Windows not Ubuntu so some (many) of the commands do not apply.
2) The device is not responding to adb, although it was prior to the "upgrade". Fastboot is working.
3) TWRP was not on the device, in fact I never could get to the recovery after trying to install the stock recovery when I converted to GPE 5.01 many months ago
I have a fresh nandroid backup, so I am just trying to get the device running. Being without the phone is causing me great pain....
I upgraded the firmware to 4.16 and did the factory reset from the stock 4.16 recovery. The phone boots back to the "Decryption Unsuccessful" message.
I am not sure, but I think the next step for me to try is to install the GPE ROM from graffixnyc from the microSD card (need to find/buy that little SD adaptor)
Any help would be greatly appreciated!!
========================
Update;
Recovery does not see the SD card , so I won't be able to install from there.
I'll try flashing TWRP recover to see if that will show the contents of the external card
========================
Update 2:
TWRP does see the external card, but the install failed as it is unable to mount /data and /storage.
I'm out of ideas....HELP!!
========================
Update 3
I noticed the "factory reset" in HBOOT and thought I'd try that instead of the "Wipe" in TWRP, but only made things worse.
Now the phone comes up to the "Decryption Unsuccessful" where I can then take the reset to get it into TWRP recover
TWRP comes up directly into a screen where it's "Running OpenRecovery Script" and then reboots.
I'm going to quit now, as I am only making matters worse.....
========================
Update 4
I got TWRP to quit whatever it was doing.
Now, In TWRP > Wipe > Advanced Wipe, I cannot wipe or repair the Data partition. I see a message "Could not mount /data unable to find crypto footer". Trying to wipe the Davlik Cache fails, "Unable to mount /data, " Unable to mount storage".
========================
version-bootloader: 3.19.0.0000
version-baseband: 1.25.214500021.06G
version-main: 4.16.401.10
modelid: 0P6B12000
cidnum: 11111111
========================
I've bricked the phone and it looks permanent.
I found another thread where everyone was solving this issue running this command "mke2fs -T ext4 /dev/block/mmcblk0p8" in TWRP. I failed to notice that it was not an M8 device thread. The phone won't boot at all, and windows sees it as a usb drive.
Haste makes waste
Do you still have fastboot?
Check out the RUU collection here and grab what apllies to your device:
http://forum.xda-developers.com/ver...zw-m8-master-ruu-firmware-collection-t2946473
Make sure you use the HTC fastboot.exe from post 3
highplains914drifter said:
I was trying to apply the OTA update for 5.1 on my M8 converted to GPE 5.01, but had to update to the stock recovery, and found myself in the same situation with the "Decryption Unsuccessful" message.
Following Klayderpus' steps to recover, but I'm running into a few issues:
1) Windows not Ubuntu so some (many) of the commands do not apply.
2) The device is not responding to adb, although it was prior to the "upgrade". Fastboot is working.
3) TWRP was not on the device, in fact I never could get to the recovery after trying to install the stock recovery when I converted to GPE 5.01 many months ago
I have a fresh nandroid backup, so I am just trying to get the device running. Being without the phone is causing me great pain....
I upgraded the firmware to 4.16 and did the factory reset from the stock 4.16 recovery. The phone boots back to the "Decryption Unsuccessful" message.
I am not sure, but I think the next step for me to try is to install the GPE ROM from graffixnyc from the microSD card (need to find/buy that little SD adaptor)
Any help would be greatly appreciated!!
========================
Update;
Recovery does not see the SD card , so I won't be able to install from there.
I'll try flashing TWRP recover to see if that will show the contents of the external card
========================
Update 2:
TWRP does see the external card, but the install failed as it is unable to mount /data and /storage.
I'm out of ideas....HELP!!
========================
Update 3
I noticed the "factory reset" in HBOOT and thought I'd try that instead of the "Wipe" in TWRP, but only made things worse.
Now the phone comes up to the "Decryption Unsuccessful" where I can then take the reset to get it into TWRP recover
TWRP comes up directly into a screen where it's "Running OpenRecovery Script" and then reboots.
I'm going to quit now, as I am only making matters worse.....
========================
Update 4
I got TWRP to quit whatever it was doing.
Now, In TWRP > Wipe > Advanced Wipe, I cannot wipe or repair the Data partition. I see a message "Could not mount /data unable to find crypto footer". Trying to wipe the Davlik Cache fails, "Unable to mount /data, " Unable to mount storage".
========================
version-bootloader: 3.19.0.0000
version-baseband: 1.25.214500021.06G
version-main: 4.16.401.10
modelid: 0P6B12000
cidnum: 11111111
========================
I've bricked the phone and it looks permanent.
I found another thread where everyone was solving this issue running this command "mke2fs -T ext4 /dev/block/mmcblk0p8" in TWRP. I failed to notice that it was not an M8 device thread. The phone won't boot at all, and windows sees it as a usb drive.
Haste makes waste
Click to expand...
Click to collapse
If you have fastboot do the following commands
Fastboot oem task 28
Fastboot oem task 29
Then try to flash your rom or ruu.
dottat said:
If you have fastboot do the following commands
Fastboot oem task 28
Fastboot oem task 29
Then try to flash your rom or ruu.
Click to expand...
Click to collapse
No Fastboot, nothing. Device was charged, but now acts as if the battery is dead. the Power button does nothing even after a long press.
Bad day...
Klayderpus said:
I previously ran LolliGPE but was long overdue for an update. I downloaded the latest version and copied the image to my phone and flashed the ROM. I decided to go try a dirty install first to see if I could keep everything I had, since I had already been running a previous version and after reviewing the changelog did not see anything recommending to wipe clean. After installing successfully, Android asked me to enter my password to decrypt my data (I don't recall ever encrypting my data?), and so I did. It then told me that my password was right, but the data was corrupt, and presented me a button to reset my phone. The button redirected me to recovery and automatically attempted to wipe /data and then re-mount it, but the wipe failed. I rebooted again with the same issue, same failed attempt to wipe. I went to install the zip again, and this time do a full wipe, but it was unable to mount my phone's storage nor my SD card. I am not able to mount either at all now.
What's the best course of action? I'd like to retain as much as I can and avoid wiping all of the internal storage clean. Is there a simpler fix to this or am I doomed?
HBOOT: 3.19.0.0000
RADIO: 1.09.20.0926
OS: 3.28.605.4
EDIT: For anyone else having a problem like this that at least wants to get their data back, here's what you should do (I assume you know how to work with Linux!):
Make sure you have the latest version of TWRP and ADB.
Boot the phone into recovery mode and connect the phone to your computer via USB
Run "ls -al /dev/block/platform/msm_sdcc.1/by-name" and check the output. Make a note of the partition marked "userdata" - for me, it was /dev/block/mmcblk0p48.
Either: simply use adb pull to copy this file to your computer (this will require about 26 gigs of space), or attempt to mount the file. To use adb pull, execute "adb pull /dev/block/<ID> ./data" (ID being what you marked down). Your data partition will be copied to /data. To mount, use "mount -t ext4 /dev/block/<ID> /userdata". Whatever's left of your data will be on your phone's new /userdata folder.
Use ADB to pull what files you want from /userdata. If you pulled the partition, skip this step.
If you copied the files you wanted over, you're done. If you pulled the entire partition, you're going to want to try and mount it. On Windows, there are various tools to mount Linux partitions, a quick Google will find some good ones. However, if the data is corrupt, it will not work. I recommend attempting to repair the partition on linux, with the command "e2fsck -f -y /path/to/data", replacing the path to your data file as necessary. Once done, run "mount -t ext4 /path/to/data /mnt/data", replacing the paths as necessary.
Once mounted, you can access your data wherever it was mounted. If e2fsck appeared to fix many errors, chances are most of your data will be in the lost+found folder, and you'll need to sort through this yourself. If you're lucky, then your data will be intact and readily usable. Internal SD card data is located at ./media/0.
To fix the partitions and get Android back up and running, you need to install the latest firmware, format your data in TWRP, factory reset, and then flash a ROM again. Here's what I did to do that, without an SD card. If you have an SD card, simply copy your ROM zip to the SD card and skip the final steps:
Make sure you have the latest version of TWRP and ADB, and download the latest copy of the firmware (check the development forum here).
Boot the phone (doesn't matter to what) and run adb reboot bootloader. When your phone reboots, double-check by running fastboot reboot-bootloader.
Put your phone in RUU mode with fastboot oem rebootRUU. The phone will restart and the HTC logo will come up.
Wait a couple seconds, then run fastboot flash zip firmware.zip, where firmware.zip is the firmware you want to flash.
The first time you do this, it will fail saying something like "FAILED (remote: 90 hboot pre-update! please flush image again immediately)". Ignore this, run the last command again: fastboot flash zip firmware.zip
The progress bar will appear and begin filling. Wait until fastboot is finished flashig it (the progress bar may not fill completely), wait an extra 5 seconds or so, and then do fastboot reboot.
The phone will reboot. Android will still be messed up, but you can verify the partitions are in working order by checking adb shell cat /proc/emmc.
Once you know the partitions are working, get back into TWRP/recovery: adb reboot recovery
Format /data and wipe /cache, /data, dalvik/art cache, etc (factory reset). You will lose the contents of your internal storage and everything else.
If you don't have the ROM zip on an sd card, make sure the zip is in the same directory as adb and run adb push rom.zip /sdcard/rom.zip, where rom.zip is the ROM. You can also copy it to the external sd by swapping /sdcard/rom.zip with /external_storage/rom.zip.
Once copied, reboot into recovery and flash the zip. Back to normal!
Click to expand...
Click to collapse
Hey
I have a HTC one m7 verizon & same problem storage decryption failed. See my case here in below post. And please tell me if anything possible. Please......
http://forum.xda-developers.com/verizon-htc-one/help/storage-encryped-htc-one-m7-vzw-s-t3279869

[GUIDE] Repartition your gpt partitioned device after custom rom install(Huawei Y6)

This guide was written for the Huawei y6 with a gpt partition table, mounts that use partition names not numbers and the userdata partition is the last one on disk however with a little adaption this should work for most gpt devices.
If you are unsure if your system uses partition names for the mount system look in /fstab."hardware" to see if your devices are labelled in the following manner. "/dev/block/bootdevice/by-name/system".
If the fstab file does not exist all is not lost look in your root directory at the .rc files for the command mounting system.
If you are unsure ask in the thread before doing anything. Better to ask than be stuck with a brick.
This guide covers modification to only system and userdata partitions but if you use great care the basics covered here will allow for modification to other partitions as long as you understand the risk and know that backups are your friend.
If you are unable to follow instructions and end up with a bricked device that is your own fault and attempts to blame me will be laughed at.
I obtained the attached parted binary from here
So you have flashed a custom ROM and without all the OEM bloatware you now have some unused free space in your system partition just sitting there gathering dust.
You are stuck with this space... Wrong.
You can repartition your device with a little paitence, time and work.
Read along if you are curious about how to get the space you deserve.
Prerequisites:
Free space (Duh).
The ability to follow instructions and to read ALL steps before you start so you know what your plan is.
An unlocked bootloader which you already have if you flashed a custom ROM.
A custom recovery (twrp preferred).
Parted binary (see attachment at the bottom of this post).
A computer with adb installed and working (there are many guides out there if you don't have it, Google is your friend).
A calculator (well I'm sure your computer has one but just so you know).
Some knowledge using terminal commands.
Risk of Bricking your device:
Low if you backup and can double check typing and calulations.
High if you can't do one of the above.
Because parted does not allow resizing of ext4 partitions you must delete partitions you want to change then recreate them.
All steps must be performed while in recovery because you are going to have to unmount any partition before you can change it.
Step 1:
Boot into recovery and make a backup. You MUST do this otherwise you will have nothing to restore.
Step 2:
Plug your device into your computer.
Copy the parted binary into your working directory on your PC.
Open your Command Prompt (Windows) or Terminal (Linux) and navigate to where adb is installed and you also put parted, or if you have adb in your PATH just go to where parted is.
Run
Code:
~ # adb devices
to ensure your device is present.
Run
Code:
~ # adb root
to get root priviliges.
Run
Code:
~ # adb push parted /sbin/parted
/sbin is in your devices PATH so you don't have to worry about typing /parted.
Run
Code:
~ # adb shell
Run
Code:
~ # chmod 755 /sbin/parted
If you get an error about a read only file system run
Code:
mount -o remount,rw /
then try again.
Step 3: Now you need to do some homework to find your sector size, sector count and how much free space you have available.
DO NOT shrink your filesystem to smaller than you need to operate. I always add at LEAST 50 mb to the used space however I recommend you think for the future, are you planning on restoring to stock?, are you planning on flashing OpenGAPPS?, are you planning on moving third party apps into the system?, are you planning on adding media or custom boot animations to the system?
So in the case below I would not make the partition any smaller than 800 MB.
Code:
~ # df
Filesystem Size Used Free Blksize
/system 1.2G 748.5M 441.8M 4096
/data 5.2G 3.5G 1.6G 4096
/cache 147.2M 4.7M 142.5M 4096
Now issue the following command to get your disks sector size in bytes remember to note this down.
Code:
~ # blockdev --getss /dev/block/mmcblk0
512
Time to use parted.
Issue the following commands to get some info on your current partitions.
"unit s" tells parted to show sectors instead of blocks, bytes etc.
Code:
~ # parted /dev/block/mmcblk0
(parted) unit s
(parted) print
Number Start End Size File system Name Flags
22 876562s 1191132s 314571s ext4 cache
23 1191133s 3990839s 2799707s ext4 system
24 3990840s 15269854s 11279015s ext4 userdata
Remember to not the partition number as you will need it later.
Remember to note your partition name with exact case, if you changed "system" to "System" you will have problems.
Also note the start sector of your system partition for the later steps.
Also note the end sector number for your userdata partition for the later steps.
Now get your calulator ready.
Some things to keep in mind here are that the number of sectors times sector size is the size of your partition in bytes and your starting sector must be 1 after the end of the previous partition.
So the following equation will give you the numbers you need.
Desired size in MB * 1024 * 1024 / Sector Size = Number of sectors
Starting sector + Number of sectors - 1 = Last Sector
If you want a 1.1 Gb partition, you have 512 byte sectors and the starting sector is 1191133 you would then use the following equation.
1100 * 1024 * 1024 / 512 = 2252800
1191133 + 2252800 - 1 = 3443932
Step 4:
Now using the info you have gathered you can change your partitions.
So I would issue the following commands to delete, create and name the system partition with the size I want.
Code:
(parted) rm 23
(parted) mkpart 23 ext4 1191133 3443932
(parted) name 23 system
Now to resize the data partition.
You need to start with the first available sector after the end of system and end with the last available sector noted earlier.
Code:
(parted) rm 24
(parted) mkpart 24 ext4 3443933 15269854
(parted) name 24 userdata
Now that your partitions are all done you can exit parted with the following.
Code:
(parted) quit
Step 5:
Now restore the backup you made earlier.
If you get an error restoring which usually only happens if you have altered partition numbers just reboot back into recovery and restore then so the kernel gets to update its own info.
Reboot.
Congratulations you now have repartitioned your device.
Don't forget to thank this post if you are grateful.
Is there anything diferent to do about moderm mmcblkop14(/firmware)? I want to reduce it to 100 mb but i noticed its blocksize it's different from the others (others =4096, firmware=16384). I saw in your pictures you reduce it, so i will try it to do that. I have a nandroid so i hope this try works.
OK, i should probably been the first idiot to bricked his phone by reading a tutorial.
I need some help. I was trying to make this extra space and i have a few problems during the process.
First of all, in my case i have a partition 23 called cust, exactly the same in size with the cache. So i started with the cache calculating and then the other 3( 23 cust, 24 system, 25 userdata). For that moment i already made my nandroid, buy for some stupid reason I saved to my pc.
My problems came when i began with step 4. When i tried to put the cache it told me that it can't do it because it was in use. So i twrp y put on mount and desmounted that partition and then i could keep going. Same thing happened with Data partition, i did the same.
Finally, i did it all the tutorial, just needed to restore as it said in step 5 because i didn't have it in my phone. So i tried with adb push but nothing and i couldn't mount again those partition with twrp. Then, in a desperate move, i tried to reflash my cm rom, so i did that. And later, it bootloop with te huawei logo and i can´t flash a rom o restore my nandroid. It doesn't read a sdcard.
And now, when i see the script in twrp (sorry i don't know how is the name, i talking about the center botton in twrp) it appears in red "unable to mont '/data', '/system', '/cache'.
I don't know what to do, really, i need a hand.
beatLeo said:
OK, i should probably been the first idiot to bricked his phone by reading a tutorial.
I need some help. I was trying to make this extra space and i have a few problems during the process.
First of all, in my case i have a partition 23 called cust, exactly the same in size with the cache. So i started with the cache calculating and then the other 3( 23 cust, 24 system, 25 userdata). For that moment i already made my nandroid, buy for some stupid reason I saved to my pc.
My problems came when i began with step 4. When i tried to put the cache it told me that it can't do it because it was in use. So i twrp y put on mount and desmounted that partition and then i could keep going. Same thing happened with Data partition, i did the same.
Finally, i did it all the tutorial, just needed to restore as it said in step 5 because i didn't have it in my phone. So i tried with adb push but nothing and i couldn't mount again those partition with twrp. Then, in a desperate move, i tried to reflash my cm rom, so i did that. And later, it bootloop with te huawei logo and i can�´t flash a rom o restore my nandroid. It doesn't read a sdcard.
And now, when i see the script in twrp (sorry i don't know how is the name, i talking about the center botton in twrp) it appears in red "unable to mont '/data', '/system', '/cache'.
I don't know what to do, really, i need a hand.
Click to expand...
Click to collapse
Ok this is difficult because of your wording but it sounds like data, system and cache no longer exist.
Is your device the y6?
Do you have adb access?
Did you finish recreating the partitions?
Did you manage to name them if so?
Are you able to use recovery?
If you have adb can use please issue the following code, if you don't have adb can you please use twrp, advanced, terminal command to issue it.
Code:
ls /dev/block/bootdevice/by-name/
and let me know if it shows your cache, userdata and system.
DestructoSphere said:
Ok this is difficult because of your wording but it sounds like data, system and cache no longer exist.
Is your device the y6?
Do you have adb access?
Did you finish recreating the partitions?
Did you manage to name them if so?
Are you able to use recovery?
If you have adb can use please issue the following code, if you don't have adb can you please use twrp, advanced, terminal command to issue it.
Code:
ls /dev/block/bootdevice/by-name/
and let me know if it shows your cache, userdata and system.
Click to expand...
Click to collapse
- Yes, my device is Y6 (SCL-L03).
- Seems that i don't have access to adb, because in cmd show me "offline" device.
-Yes, i fineshed with that, but couldn't do the restore of backup.
- I did all step 4.
- Yes, i'm using twrp.
I put the code with twrp... and here it says not found.
Any ideas? I hope you could help me.
beatLeo said:
Ok this is difficult because of your wording but it sounds like data, system and cache no longer exist.
Is your device the y6?
Do you have adb access?
Did you finish recreating the partitions?
Did you manage to name them if so?
Are you able to use recovery?
If you have adb can use please issue the following code, if you don't have adb can you please use twrp, advanced, terminal command to issue it.
- Yes, my device is Y6 (SCL-L03).
- Seems that i don't have access to adb, because in cmd show me "offline" device.
-Yes, i fineshed with that, but couldn't do the restore of backup.
- I did all step 4.
- Yes, i'm using twrp.
I put the code with twrp... and here it says not found.
Any ideas? I hope you could help me.
Click to expand...
Click to collapse
You need to put a space between ls and the /
DestructoSphere said:
You need to put a space between ls and the /
Click to expand...
Click to collapse
ups, ok, i did that and i see all the partitions including cache, cust, system and userdata. Please, what is next?
beatLeo said:
ups, ok, i did that and i see all the partitions including cache, cust, system and userdata. Please, what is next?
Click to expand...
Click to collapse
Ok I suspect maybe the filesystems never got created.
Can you run
Code:
df
this will show you the currently mounted partitions free space.
Output will look something like this
Code:
Filesystem Size Used Free Blksize
/dev 442.6M 60.0K 442.5M 4096
/system 1.2G 948.5M 241.8M 4096
/data 5.2G 2.8G 2.4G 4096
/cache 147.2M 176.0K 147.0M 4096
/persist 3.9M 776.0K 3.1M 4096
/firmware 99.8M 46.8M 52.9M 2048
If you dont see data or cache they never got mounted at twrp start, system is not mounted by default.
Then if data is not listed try
Code:
mount -t ext4 /dev/block/bootdevice/by-name/userdata /data
Remember to have spaces between arguments.
Or try system by replacing "userdata" with "system" and "/data" with "/system"
If you get an error trying to mount please do the following referring to the attached screenshots.
In twrp, go to "wipe", "advanced wipe". Then select one of the partitions and select "repair or change filesystem".
This should give you info about the partition.
If you wish to reformat it select "change filesystem" then select "ext4" and swipe to confirm.
Now retry the mount command and hopefully it will succeed.
Do this for each partition then retry your backup/flash.
Hopefully this works, good luck.
Thanks for your help. At first i couldn't see cache or data partition. I did what you told me, and i made cache to appears with df command. System too. But i couldn't made the same with the userdata partition. I tried to repair but it didn't work.
Is there another way to remount that partition?
A question apart: what was that "cust" partiton i've got and you didn't in your images posted in cm12.1 post? Because i recalculated it too.
beatLeo said:
Thanks for your help. At first i couldn't see cache or data partition. I did what you told me, and i made cache to appears with df command. System too. But i couldn't made the same with the userdata partition. I tried to repair but it didn't work.
Is there another way to remount that partition?
A question apart: what was that "cust" partiton i've got and you didn't in your images posted in cm12.1 post? Because i recalculated it too.
Click to expand...
Click to collapse
Hi,
Does twrp show the userdatas partition filesystem type? Like in my previous screenshot cache is shown as ext4.
If not can you try change filesystem instead of the repair option and choose ext4.
I removed my cust partition altogether as I had no use for it.
DestructoSphere said:
Hi,
Does twrp show the userdatas partition filesystem type? Like in my previous screenshot cache is shown as ext4.
If not can you try change filesystem instead of the repair option and choose ext4.
I removed my cust partition altogether as I had no use for it.
Click to expand...
Click to collapse
Yes, it shows current file system: ext4. I tried repair and change file system but nothing. When i'm trying to use "mount -t ext4 /dev/..." it says "failed: invalid argument"
What else could i do?
I really appeciate your help man.
P.S: Sorry, i don't know why the screenshot looks not vertical.
beatLeo said:
Yes, it shows current file system: ext4. I tried repair and change file system but nothing. When i'm trying to use "mount -t ext4 /dev/..." it says "failed: invalid argument"
What else could i do?
I really appeciate your help man.
P.S: Sorry, i don't know why the screenshot looks not vertical.
Click to expand...
Click to collapse
Ok for some reason filesystem seems to have issues.
Can you please try
Code:
mkfs.ext2 -j /dev/block/bootdevice/by-name/userdata
to manually format it?
Remember spaces before and after -j option.
DestructoSphere said:
Ok for some reason filesystem seems to have issues.
Can you please try
Code:
mkfs.ext2 -j /dev/block/bootdevice/by-name/userdata
to manually format it?
Remember spaces before and after -j option.
Click to expand...
Click to collapse
It says mkfs.ext2: lseek: Value too large for define data type
beatLeo said:
Ok for some reason filesystem seems to have issues.
Can you please try
It says mkfs.ext2: lseek: Value too large for define data type
Click to expand...
Click to collapse
As far as I know that happens when you break some size limit.
How big did you make your userdata partition? Maybe you had a typo so I'm thinking you may want to run through the guide again to check but first can you let me know what you get if you write
Code:
blockdev --getsize64 /dev/block/bootdevice/by-name/userdata
DestructoSphere said:
As far as I know that happens when you break some size limit.
How big did you make your userdata partition? Maybe you had a typo so I'm thinking you may want to run through the guide again to check but first can you let me know what you get if you write
Code:
blockdev --getsize64 /dev/block/bootdevice/by-name/userdata
Click to expand...
Click to collapse
it says 5465161216
beatLeo said:
As far as I know that happens when you break some size limit.
How big did you make your userdata partition? Maybe you had a typo so I'm thinking you may want to run through the guide again to check but first can you let me know what you get if you write
it says 5465161216
Click to expand...
Click to collapse
Ok the number seems ok.
Can you please try using parted again with the guide to delete then recreate the partition making sure to specify the filesystem.
Hopefully that works but if not I think you need to rewrite the partition table a start again.
If it doesn't work can you please post the output from
Code:
parted
unit s
print free
DestructoSphere said:
Ok the number seems ok.
Can you please try using parted again with the guide to delete then recreate the partition making sure to specify the filesystem.
Hopefully that works but if not I think you need to rewrite the partition table a start again.
If it doesn't work can you please post the output from
Code:
parted
unit s
print free
Click to expand...
Click to collapse
Hi DestructoSphere,
tried to do that, but remember i can't get to adb so i can't find a way to paste the parted file into de sbin. Any ideas about that?
beatLeo said:
Ok the number seems ok.
Can you please try using parted again with the guide to delete then recreate the partition making sure to specify the filesystem.
Hopefully that works but if not I think you need to rewrite the partition table a start again.
If it doesn't work can you please post the output from
Hi DestructoSphere,
tried to do that, but remember i can't get to adb so i can't find a way to paste the parted file into de sbin. Any ideas about that?
Click to expand...
Click to collapse
In twrp can you mount mtp or usb storage and copy it to sdcard then twrp filemanager to copy to sbin?
Ok, i tried with a sdcard, but i couldn't either. It didn't recognize my sdcard. And i don't have an otg's usb.
But in twrp's cmd showed "mtp enabled". Could this means that i have to mounted the sd partition? If that is a yes, could you please write me the code ?
beatLeo said:
Ok, i tried with a sdcard, but i couldn't either. It didn't recognize my sdcard. And i don't have an otg's usb.
But in twrp's cmd showed "mtp enabled". Could this means that i have to mounted the sd partition? If that is a yes, could you please write me the code ?
Click to expand...
Click to collapse
Hi DestructoSphere, i finally resolve this. It was a lot simplier than you ever thought. I tried changing to ext2 my data partion, and then change it again to ext4 and that's how it works again.
Take a look into my partitions. But i still want to reduce to 100mb the modem partition.

Categories

Resources