[Q] /data partition unable to wipe - Moto G Q&A, Help & Troubleshooting

Hey guys,
I had previously encrypted my phone with the inbuilt android encryption, but it just didn't work (the PIN wasn't my password)
I tried to factory reset it but it didn't work either, from both fastboot or recovery.
So I reflashed my entire system from fastboot (which worked perfectly). Now I want to install the unofficial cm12 zip, but I can't erase userdata from my phone at all.. Either through fastboot or recovery, and I'm locked to the GPe image I am using currently.
The recovery error I get when trying to delete my data partition is:
Code:
-- Wiping data...
Formatting /data...
Error mounting /data!
Skipping format...
Formatting /cache...
Formatting /sd-ext...
E:unknown volume for path [/sd-ext]
Formatting /sdcard/.android_secure...
Error mounting /sdcard/.android_secure!
Skipping format...
Data wipe complete.
I have no idea what to do help please?

Possible solution
Okay, so the CWM recovery is beyond stupid and seems to want to verify that it can read a partition before it lets you format it. But you can't do this if you've encrypted it. So you have to reformat it yourself. But first, you have to figure out the device name of that partition.
After you've booted the phone into recovery, you'll need to send commands to the phone with adb.
Type this to receive an error revealing a device name:
Code:
adb shell mount /data
Then type the following using the /dev/ name given in the error from the first command. That device name might be unique to my phone. I'm not sure:
Code:
adb shell ls -l /dev/block/platform/msm_sdcc.1/by-name/
In any case, you want to find where userdata is pointing to. On mine, it is:
Code:
/dev/block/mmcblk0p36
Then to double check which type of filesystem is being used on that userdata partition:
Code:
adb shell cat /etc/fstab
Then to format it yourself (if f2fs is the filesystem) since CWM recovery won't bloody well do it and lets everyone think they've bricked their phone:
Code:
adb shell mkfs.f2fs /dev/block/mmcblk0p36
Disclaimer: this worked for me, but I can't make any guarantees. It got me past the error CWM was giving. After I formatted the partition on my own, CWM recovery was able to proceed as normal.

Worked for me atleast
1) You Need twrp recovery.
2)Select data partition.
3)Change file system to some other than f2fs.
4)Again change file system to f2fs (without rebooting recovery).
5)Repair Partition with twrp menu.
6)If Partition repair was successful then wipe the Partition.
7)? Good to go.
8)And yeah though it doesn't brick your phone if anything happens to your device then I am not responsible.

jlm0 said:
Okay, so the CWM recovery is beyond stupid and seems to want to verify that it can read a partition before it lets you format it. But you can't do this if you've encrypted it. So you have to reformat it yourself. But first, you have to figure out the device name of that partition.
After you've booted the phone into recovery, you'll need to send commands to the phone with adb.
Type this to receive an error revealing a device name:
Code:
adb shell mount /data
Then type the following using the /dev/ name given in the error from the first command. That device name might be unique to my phone. I'm not sure:
Code:
adb shell ls -l /dev/block/platform/msm_sdcc.1/by-name/
In any case, you want to find where userdata is pointing to. On mine, it is:
Code:
/dev/block/mmcblk0p36
Then to double check which type of filesystem is being used on that userdata partition:
Code:
adb shell cat /etc/fstab
Then to format it yourself (if f2fs is the filesystem) since CWM recovery won't bloody well do it and lets everyone think they've bricked their phone:
Code:
adb shell mkfs.f2fs /dev/block/mmcblk0p36
Disclaimer: this worked for me, but I can't make any guarantees. It got me past the error CWM was giving. After I formatted the partition on my own, CWM recovery was able to proceed as normal.
Click to expand...
Click to collapse
@jlm0 Hope your post will help me. I have terminal emulator, with this how do I run these commands, because I'm not able to change the recovery also.
Regards
Janardhan TS
sent from Mi

Related

Bootloop + E:unable to mount /data

Moderator Notes: I was asked to sticky this thread as it seems to be a recurring issue and a couple of fixes are in the posts.
Sorry my bad english am latin.
Hi guys first thread here and i need your help. Here s the thing, i was using my tf700, browsering, and the tablet goes off, i tried start up and a bootloop appears. So i go to Recovery (latest TWRP) and i tried to flash a ROM (latest crombi kk), like always i tried to wipe cache and dav bfore flash it but that proces seems to fail, and a couple of messages like unable to mount /data unable to mount /system appears, first time happening, i never had troubles with the tablet. So i tried to get fastboot mode and run the fastboot erase cach command (i read in a forum dat some guy did that and work for him), so i download the adb fastboot files, i connect the tf700 to my laptop (windows 7 64bit) and a installing drivers message and i wait and the driver that is called Transformer did not install, i dont know where to get those drivers, i found a file Asus usb drivers and bla bla but when i unzip the file i get 3 folders and no .exe or installer. So i tried to continue and i enter fastboot mode in the tablet and connect usb tablet-pc, and now another driver installing message appears, now is a driver called Fastboot, so i wait anda again the driver did not install correctly. So i continue and open cmd and tried the comman for erase cache, and only appears the WAITING FOR DEVICE text. i donw know waht to do, i also tried flashing again a ROM, bt only bootloop, trie again to wipe cache and dav but is only unable to mount /data. Any ideas ????
formobicho said:
Sorry my bad english am latin.
Hi guys first thread here and i need your help. Here s the thing, i was using my tf700, browsering, and the tablet goes off, i tried start up and a bootloop appears. So i go to Recovery (latest TWRP) and i tried to flash a ROM (latest crombi kk), like always i tried to wipe cache and dav bfore flash it but that proces seems to fail, and a couple of messages like unable to mount /data unable to mount /system appears, first time happening, i never had troubles with the tablet. So i tried to get fastboot mode and run the fastboot erase cach command (i read in a forum dat some guy did that and work for him), so i download the adb fastboot files, i connect the tf700 to my laptop (windows 7 64bit) and a installing drivers message and i wait and the driver that is called Transformer did not install, i dont know where to get those drivers, i found a file Asus usb drivers and bla bla but when i unzip the file i get 3 folders and no .exe or installer. So i tried to continue and i enter fastboot mode in the tablet and connect usb tablet-pc, and now another driver installing message appears, now is a driver called Fastboot, so i wait anda again the driver did not install correctly. So i continue and open cmd and tried the comman for erase cache, and only appears the WAITING FOR DEVICE text. i donw know waht to do, i also tried flashing again a ROM, bt only bootloop, trie again to wipe cache and dav but is only unable to mount /data. Any ideas ????
Click to expand...
Click to collapse
More likely your data partition got corrupted.
Try wiping it or formatting /data in TWRP to see if that helps? You will lose everything if you don't have backups.
sbdags said:
More likely your data partition got corrupted.
Try wiping it or formatting /data in TWRP to see if that helps? You will lose everything if you don't have backups.
Click to expand...
Click to collapse
i already tried that, wiping (cache, dav, system, ata, factoty reset) anything gives the unable to mount /data error.
formobicho said:
i already tried that, wiping (cache, dav, system, ata, factoty reset) anything gives the unable to mount /data error.
Click to expand...
Click to collapse
You'll need to manually format it using the terminal in TWRP
Make sure data is umounted then run this command. Make sure you have charged it as well or leave it plugged in.
It can take a number of hours to complete.
Code:
mke2fs -T ext4 /dev/block/mmcblk0p8
sbdags said:
You'll need to manually format it using the terminal in TWRP
Make sure data is umounted then run this command. Make sure you have charged it as well or leave it plugged in.
It can take a number of hours to complete.
Code:
mke2fs -T ext4 /dev/block/mmcblk0p8
Click to expand...
Click to collapse
first of all is an honor chat with the legend sbdags!!! second can u guide me step by step. i did enter in twrp and go to advanced then terminal command then a selection menu appear and said browse to starting folder and a list of folder appears and a botton with Select Folder, wich folder i must select now? i tried just hit the select folder button and then i put the command taht u said and in the terminal said mke2fs 1.41.14 (22-dec-2010) nothing more and nothing happen
sbdags said:
You'll need to manually format it using the terminal in TWRP
Make sure data is umounted then run this command. Make sure you have charged it as well or leave it plugged in.
It can take a number of hours to complete.
Code:
mke2fs -T ext4 /dev/block/mmcblk0p8
Click to expand...
Click to collapse
Thank you so much sbdags.
You're a life save thought I had softbricked my tf700
Muchas gracias
formobicho said:
first of all is an honor chat with the legend sbdags!!! second can u guide me step by step. i did enter in twrp and go to advanced then terminal command then a selection menu appear and said browse to starting folder and a list of folder appears and a botton with Select Folder, wich folder i must select now? i tried just hit the select folder button and then i put the command taht u said and in the terminal said mke2fs 1.41.14 (22-dec-2010) nothing more and nothing happen
Click to expand...
Click to collapse
Did you unmount data first?
---------- Post added at 07:25 AM ---------- Previous post was at 07:24 AM ----------
chukkie said:
Thank you so much sbdags.
You're a life save thought I had softbricked my tf700
Muchas gracias
Click to expand...
Click to collapse
You are welcome!
EDIT - somehow the format finally took.. after 5 or 6 reboots.. very strange
okay, i hate to bump this thread. but i have been searching for a few nights and i cannot find a solution. i am having the same problem as OP.
Essentially, my tablet was interrupted mid format. I believe my data partition is corrupted. I can access recovery/fastboot and the tablet accepts commands from my PC. i have TWRP 2.7.1.1 on the tablet right now.
i tried what sdbags said:
You'll need to manually format it using the terminal in TWRP
Make sure data is umounted then run this command. Make sure you have charged it as well or leave it plugged in.
It can take a number of hours to complete.
Code:
mke2fs -T ext4 /dev/block/mmcblk0p8
Click to expand...
Click to collapse
this did not work. i got the same "mke2fs 1.41.14 (22-dec-2010)" output, and then the tablet rebooted back into TWRP over again. (data was not mounted, i cannot mount it at all)
some more output from my tablets TWRP console:
Code:
e:could not mount/data and unable to find crypto footer.
e:unable to mount '/data'
e:unable to recreate /data/media folder/
updating partition details...
e:unable to mount '/data'
e:unable to mount internal storage.
e:unable to mount /data/media during gui startup
full selinux support is present.
e:unable to mount /data/,edia/twrp/.twrps when trying to read settings file.
e:unable to mount '/data'
is there another way to fix my corrupted partition?
this did not work. i got the same "mke2fs 1.41.14 (22-dec-2010)" output, and then the tablet rebooted back into TWRP over again. (data was not mounted, i cannot mount it at all)
Click to expand...
Click to collapse
I have exactly same situation
edit: after running this command
mke2fs -T ext4 /dev/block/mmcblk0p8
Click to expand...
Click to collapse
it prompt
Starting Path : /external_sd
Click to expand...
Click to collapse
and there is also button "KILL" when I hit enter it prompt : /dev/block/mmcblk0p8 is appereatly in use by the system: Will not make a file system here!
Any advice? (sry for being this big noob!)
Code:
adb shell
killall -19 recovery
make_ext4fs /dev/block/mmcblk0p8
reboot
Type in those commands via a usb connection to your device whilst it is in recovery.
sbdags said:
Code:
adb shell
killall -19 recovery
make_ext4fs /dev/block/mmcblk0p8
reboot
Type in those commands via a usb connection to your device whilst it is in recovery.
Click to expand...
Click to collapse
Wouw thanks for so fast reply :highfive:.
But I think I'll disepoint you "usb debugging is disabled"
---------------------------------------------------------------------------------------------------------------
Any way I can reinstall stock from fastboot? damn it......
brinza said:
Wouw thanks for so fast reply :highfive:.
But I think I'll disepoint you "usb debugging is disabled"
---------------------------------------------------------------------------------------------------------------
Any way I can reinstall stock from fastboot? damn it......
Click to expand...
Click to collapse
No idea how when and after what exactly but the installation of stock rom started by itself after couple of reboots and couple of command i tried. (I had a file : US_epad-user-10.6.1.14.10.zip on my SD card
sbdags said:
Code:
adb shell
killall -19 recovery
make_ext4fs /dev/block/mmcblk0p8
reboot
Type in those commands via a usb connection to your device whilst it is in recovery.
Click to expand...
Click to collapse
Probably a Bad Idea - you should unmount /data before formatting. Then it should also not hurt to keep the recovery running.
Unbrick my TF 700t
Accidentally, bricking my tablet
I try Advance and Terminal Command with TRWP at tablet, it did not work
but when I try with command from PC (desktop), it works like a charm. I was able to see internal storage
from that just re install Custom ROM. Thank alot to sdbag
Thanks
sbdags said:
Code:
adb shell
killall -19 recovery
make_ext4fs /dev/block/mmcblk0p8
reboot
Type in those commands via a usb connection to your device whilst it is in recovery.
Click to expand...
Click to collapse
Wow. you are a life saver. that worked for me.
player50 said:
Wow. you are a life saver. that worked for me.
Click to expand...
Click to collapse
Glad it worked. Everyone should keep those commands handy
Thanks a lot...
After a long research I have found your thread.
I have almost given up looking for this damn issue...
At last, It became real! You are a real life saver.
sbdags help!
1) i dont know how to unmount data .
2) when i click advanced then terminal command it opens- Browse to starting folder and gives the file manager kind of view.
3) so i tried using adb on computer
the first three command work(i think but the third gives this error not enough space) .
please suggest a solution. thank you in advance
device moto g xt1033
i tried downgrading from lollipop 5.0 brasilian to kitkat but it wont go past warning bootloader unlocked screen. when i flash cm from twrp, it gives 3 errors
E:/ unable to mount '/data'
E:/ unable to mount '/cache'
E:/ unable to mount internal storage
then when i start it just keeps on loading on cm logo
should i create a separate thread for all this?
'
SemiNoob314 said:
1) i dont know how to unmount data .
2) when i click advanced then terminal command it opens- Browse to starting folder and gives the file manager kind of view.
3) so i tried using adb on computer
the first three command work(i think but the third gives this error not enough space) .
please suggest a solution. thank you in advance
device moto g xt1033
i tried downgrading from lollipop 5.0 brasilian to kitkat but it wont go past warning bootloader unlocked screen. when i flash cm from twrp, it gives 3 errors
E:/ unable to mount '/data'
E:/ unable to mount '/cache'
E:/ unable to mount internal storage
then when i start it just keeps on loading on cm logo
should i create a separate thread for all this?
'
Click to expand...
Click to collapse
Question: Why don't you care to read the short thread from beginning?
das chaos said:
Question: Why don't you care to read the short thread from beginning?
Click to expand...
Click to collapse
i am really sorry if the earlier comment came out as rude.
actually i did all of those steps, using the command terminal, using adb from pc but none of them worked, all of them had some problem

[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

[Q] Partition destroyed after power loss

Hi everyone,
today i tried to update my CM11 to the newest CM12 Version. I booted into TWRP recovery and made a full Wipe. While doing this, my device had something like power loss, so the wipe could not finish.
Now the device doesn't boot anyway, after Power on it's booting into fastboot mode. The recovery isn't able to start. It is possible to use ADB and Fastboot. Using "fastboot boot /....../recovery.img it is possible to boot an recovery. The TWRP Recovery displays:
E:Unable to find partition size for '/recovery'
E:Unable to find partition size for '/boot'
E:Unable to find partition size for '/misc'
E:Updating partition details
E:Unable to mount '/cache'
E:Unable to mount '/data'
E:Unable to mount '/sytem'
...done
E:Unable to mount storage
E:Unable to mount /sdcard during GUI startup
E:Unable to mount '/cache'
Full SELinux support is present
E:Unable to mount '/cache'
E:Unable to set emmc bootloader message.
E:Unable to mount /'cache'
E:Unable to mount /sdcard/TWRP/.twrps when trying to read settings file.
MTP Enabled​
The "repair file system" option in TRWP Recovery doesnt work.
After several hours reading threads about similar problems i don't know what to do.
How can i repair the file system tables to reinstall the CM12 or any other ROM?
Hopefully
DragonGuard
I think, i have an idea.
What about to rewrite the complete partitions on my Sensation using adb shell and then rewrite with the partitions? Could that work?
I read an article with an similar problem here: cyanogenmod.org
The problem was that I managed to screw up the partitions on my internal storage card, so basically nothing would work properly. I could still get into recovery, though. That's key.
Here's what you'll need:
Working recovery, basic knowledge of adb & the shell
Parted (download here)
stock PB31IMG.zip
Note also that I had run unrevoked forever (so my phone was S-OFF) ... I'm not sure if that's required or not.
So, grab parted from the link above. Now you need to extract the individual binaries from the .zip (the 6 files in the sdparted folder within the zip), ideally to your android-sdk\tools directory. Now push all 6 files (adb push [file] /sbin/). Next, we need to make them useable, so go into the shell (adb shell). Change to your /sbin/ directory, and run: chmod 0755 <file> on each of the 6 files.
Now, we need to fix the partitions. This is assuming that the partitions are there, just the wrong format (which is what happened to me .. I accidentally made them FAT32 instead of ext). So, run the following: parted /dev/block/mmcblk0 mkfs ext2. It will ask if you want to continue, hit yes. When it asks for the partition number, enter 1. Next, when it asks for the format, enter ext2. Let it do its thing. Now, once it's done, run parted again. This time, enter partition 2 (everything else is the same).
Once all that's done, your recovery program should be able to mount both the /data and /cache partitions. If that's true, you're pretty much done! One thing I found was that I couldn't directly install a new OS (I tried both Cyanogen and Ultimate). In both cases, it would look for stuff in the davik-cache that it couldn't find, so something wasn't installing correctly I think. So, if that happens, flash back to the stock PB31IMG.zip (put it in the root of your /sdcard/ and let hboot install it), and then root your phone anew. That's what I ended up doing.
Again, huge credit for this goes to -Steveo- and ciwrl for helping me figure out which partitions were the right ones (and for supplying parted, which I hadn't been able to find anywhere). If something doesn't end up working, just drop me a pm and we'll see what we can do.
Click to expand...
Click to collapse
Today i would need parted for ext4 partitions and i need to know where on the internal storage i have to write which partition. Is this a possible way to repair the partitions?
Hopefully
Bump
I'm having the same problem, my recovery log shows exactly the same. Have you found a solution yet?
Hi,
i am sorry, but i haven't found any solution yet. I am looking for an HTC Sensation to pull the emmc Data system Files and rewrite it on my broken HTC Sensation. I need the /dev/block/mmcblk0 etc. files to try. In my /dev/block/ folder are only "loop" files located, i think they are part of my problem.
Greetz

How Can I Get Out of This Bootloop on My Moto G

I woke up to find my 1st Generation Moto G battery was depleted and on charging it a bit., I switched it on only to find it optimizing my apps. All these (battery getting depleted, app optimization) happen all the time and I wasn't the least worried.
I picked up my phone later thinking it must have been done with the app optimization only to discover it was totally dead while still connected to a power bank. When I try to switch it on, it is stuck on the "Unlock Bootloader" page. I have tried flashing a new stock rom and it does not work.
I attached the image I see when I try to use recovery to wipe. Basically, nothing works. Can anybody help as I just fixed the screen and also out of warranty?
Fastboot flash the latest Factory Firmware Image for your model.
Factory Firmware Images: http://forum.xda-developers.com/moto-g/general/index-moto-g-falcon-factory-firmware-t3110795
Fastboot Tutorial: http://forum.xda-developers.com/showthread.php?t=2542219
lost101 said:
Fastboot flash the latest Factory Firmware Image for your model.
Factory Firmware Images: http://forum.xda-developers.com/moto-g/general/index-moto-g-falcon-factory-firmware-t3110795
Fastboot Tutorial: http://forum.xda-developers.com/showthread.php?t=2542219
Click to expand...
Click to collapse
Thanks lost101, I do know how to flash perfectly well with fastboot. The problem is it flashes successfully but the phone is still stuck on the Bootloader.
I get this particular message on my recovery when I try to wipe either userdata or cache.
blkdiscard on partition /dev/block/platform/msm_sdcc.1/by-name/userdata failed formatting /userdata failed
formatting cache
and
blkdiscard on partition /dev/block/platform/msm_sdcc.1/by-name/userdata failed formatting /cache
wiping clogo
@NaijaAndroid - Can you try booting into TWRP via: fastboot boot twrp.img
lost101 said:
@NaijaAndroid - Can you try booting into TWRP via: fastboot boot twrp.img
Click to expand...
Click to collapse
I do not have a custom recovery presently but when I try to flash TWRP, it flashes successfully with no error message but the phone is still stuck on the stock recovery.
NaijaAndroid said:
I do not have a custom recovery presently but when I try to flash TWRP, it flashes successfully with no error message but the phone is still stuck on the stock recovery.
Click to expand...
Click to collapse
Read again what I told you to do. I did not say for you to flash anything.
@lost101, I just read your instructions again. I can boot in to TWRP. What else should I do after?
Thanks.
NaijaAndroid said:
@lost101, I just read your instructions again. I can boot in to TWRP. What else should I do after?
Click to expand...
Click to collapse
Via PC, do the following wipe: (requires working ADB setup)
http://forum.xda-developers.com/showpost.php?p=65431978&postcount=22​
You could then TWRP > Wipe > Format Data > Yes, and try flashing a custom ROM.
Edit: You should backup photos or important data before hand.
I just downloaded CM 12.1. How can I transfer the ROM to the phone?
Edit: I have done it.
NaijaAndroid said:
I just downloaded CM 12.1. How can I transfer the ROM to the phone?
Click to expand...
Click to collapse
Recovery mode ADB will work with Linux - unsure about Windows. You could boot into an Ubuntu LiveCD (without installing) and transfer the ROM to phone that way. Otherwise, an OTG usb pen would be another option.
adb push rom.zip /sdcard​
@lost101, I tried to send the Rom via ADB and I got : failed to copy 'Rom.zip' to '/sdcard//Rom.zip' : Read-only file system.
Also, TWRP made my phone to load as MTP on my PC but I could not transfer through that method also. The transfer kept on failing. Seems my internal memory (eMMC) is now Read-only.
NaijaAndroid said:
@lost101, I tried to send the Rom via ADB and I got : failed to copy 'Rom.zip' to '/sdcard//Rom.zip' : Read-only file system.
Also, TWRP made my phone to load as MTP on my PC but I could not transfer through that method also. The transfer kept on failing. Seems my internal memory (eMMC) is now Read-only.
Click to expand...
Click to collapse
Try sideloading the ROM.
TWRP > ADB sideload​adb sideload rom.zip​
lost101 said:
Try sideloading the ROM.
TWRP > ADB sideload​adb sideload rom.zip​
Click to expand...
Click to collapse
I got:
Installing zip file '/sideload/package.zip'
detected filesystem ext4 for /dev/block/platform/msm_sdcc.1/by-name/system
Can't install this package on top of incompatible data. Please try another package or run a factory reset
Updater process ended with ERROR: 7
I was trying to use CM 12.1.
So sorry for taking your time. Thanks.
NaijaAndroid said:
I got:
Installing zip file '/sideload/package.zip'
detected filesystem ext4 for /dev/block/platform/msm_sdcc.1/by-name/system
Can't install this package on top of incompatible data. Please try another package or run a factory reset
Updater process ended with ERROR: 7
I was trying to use CM 12.1.
Click to expand...
Click to collapse
Try a CM13 ROM.
lost101 said:
Try a CM13 ROM.
Click to expand...
Click to collapse
Same problem as above. I got the same message.
On PC:
adb shell​e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata​
lost101 said:
On PC:
adb shell​e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata​
Click to expand...
Click to collapse
I got:
/dev/block/platform/msm_sdcc.1/by-name/userdata is in use.
e2fsck: Cannot continue, aborting.
NaijaAndroid said:
I got:
/dev/block/platform/msm_sdcc.1/by-name/userdata is in use.
e2fsck: Cannot continue, aborting.
Click to expand...
Click to collapse
TWRP > MOUNT > Untick /Data​
lost101 said:
TWRP > MOUNT > Untick /Data​
Click to expand...
Click to collapse
got this after unticking data and trying again:
e2fsck 1.42.9 (28-Dec-2013)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/block/platform
/msm_sdcc.1/by-name/userdata
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
NaijaAndroid said:
got this after unticking data and trying again:
e2fsck 1.42.9 (28-Dec-2013)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/block/platform
/msm_sdcc.1/by-name/userdata
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
Click to expand...
Click to collapse
A certain percentage of phones end up with corrupt emmc (internal storage) over time. This problem is a fairly common thing. I do recall someone managing to boot an use CM13, despite the read-only userdata. I'm guessing they must have flashed it via TWRP, with the ROM.zip on an OTG usb pen. It may have worked because /system was still partially / fully writeable.

[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