Nexus 5 deleted data partition - Nexus 5 Q&A, Help & Troubleshooting

Hi there,
So I wanted to resize the system partition so I could install GApps. I accidentally deleted the data partition somehow (deleted not corrupted). I can go into bootloader and recovery, my bootloader is unlocked so I can flash any recovery I need to but I can't boot Android. Any ways to redo the partition table or manually add the userdata partition?
Thanks in advance.
Edit: I was able to fix the partition by creating a partition called "userdata" with parted, but now my phone is constantly rebooting and it cant be the power button because when powered off or in bootloader, it doesnt automatically turn on. Any help?

KevinKraze said:
Hi there,
So I wanted to resize the system partition so I could install GApps. I accidentally deleted the data partition somehow (deleted not corrupted). I can go into bootloader and recovery, my bootloader is unlocked so I can flash any recovery I need to but I can't boot Android. Any ways to redo the partition table or manually add the userdata partition?
Thanks in advance.
Click to expand...
Click to collapse
I would start fresh and flash the last factory image using fastboot
Then follow this guide for repartitioning... https://forum.xda-developers.com/t/recovery-unofficial-twrp-hh-for-nexus-5-hammerhead.4047653/

Lughnasadh said:
I would start fresh and flash the last factory image using fastboot
Then follow this guide for repartitioning... https://forum.xda-developers.com/t/recovery-unofficial-twrp-hh-for-nexus-5-hammerhead.4047653/
Click to expand...
Click to collapse
I have tried to flash the factory image, but as I said, the data partition is deleted so nothing works

I got it to work by manually creating a partition with parted and called it "userdata" After I just flashed the userdata.img file and everything seemed to work!

Related

[Q] How to mount sdcard in ICS Encrypted phone?

I was using a CM9 Nightlies. My company requires us to encrypt our phone.
Now that I was trying to update my phone to the latest version of CM9, I found I couldn't mount /sdcard in CWM recovery...
Is there anyway either to de-encrypt the phone without full-wipe or mount encrypted /sdcard in CWM?
By encrypting your phone you are unable to mount /sdcard currently(stock recovery can flash through it) and the only way you could do it is a full wipe or mounting a "fake" sdcard(idk how to, sorry)
So in short, you pretty much need to full wipe to update
Sent from my ice cream powered Nexus S
I'm running CWM with AOKP and recently encrypted for work policies and now that I want to upgrade and flash a new ROM it is stating that the sd card is unable to be mounted, even after a full wipe in CWM. What is needed? I don't mind wiping but would rather not lose what was on my sd card (titanium backups, etc)
Thanks in advance!
You need to do it within android. Did you do a cwm backup before wiping?
yes, I have a nandroid but it will not restore due to the inability to mount sd storage. Actually it can't even load the option to restore from a nandroid.
Good, now let's hope that actually helps. Unsure if anyone else has tried, but maybe it'll let you flash a new ROM and decrypt it through there. Worst case scenario you end up in the same position as now and you'll have to do an sd wipe, unless someone else knows different. As on the Nexus S the sdcard is seperate to the /data partition (unlike the GN), it flashing a fastboot image shouldn't erase it.
Try to flash a ROM via fastboot images which you can find here. Select your phone and choose an ICS fastboot image (not full ROM, update, etc - must be fastboot). You'll want to download the appropriate image and store it on your computer, then extract the archive until you end up with several files and another archive. You want to have boot.img, system.img and userdata.img ready. Use the following commands in fastboot mode:
fastboot flash boot boot.img
fastboot flash system system.img
[try to boot - if fails, continue]
fastboot flash data userdata.img
The last one should be correct, but maybe it is userdata. Havn't actually tried that one myself - it may not even be necessary (try booting it without this first, if it doesn't work you may need to do this). You can also use the fastboot -w update method but i wouldn't recommend it this time just so we know exactly what is being flashed. After this, boot into android and hope it asks you for decryption information.
edit: also, if those commands don't work, you'll need to flash the contained radio.img and recovery.img files too. It might be picky.
Thanks for the advice. If I flash the stock image via fastboot it sounds like I will lose root and custom recovery since it flashes the bootloader, correct? Will this also wipe my sd card?
If so I may just try to format my sd card in Android so that will be all that I lose versus having to reroot and install CWM again.
Thanks again for your time and info. Very helpful.
*Thanked*
katmandu421 said:
Thanks for the advice. If I flash the stock image via fastboot it sounds like I will lose root and custom recovery since it flashes the bootloader, correct? Will this also wipe my sd card?
If so I may just try to format my sd card in Android so that will be all that I lose versus having to reroot and install CWM again.
Thanks again for your time and info. Very helpful.
*Thanked*
Click to expand...
Click to collapse
You will lose all you data, it will be as if you just bought it, your SD card is NOT wiped
You will only lose recovery as a result of the stock rom script
Oh and you only have to flash boot.img, system.img and userdata.img
Sent from my ice cream powered Nexus S
Thanks guys. Got it flashed to stock and booted (had to use fastboot flash userdata userdata.img, btw) but I did not get any prompt to enter encryption password, and I now have no usb storage showing. I don't even get the "unmounted" icon like I had before. Not sure whats going on.
Any thoughts?
EDIT: I even tried all of these commands as well after I read somewhere it is the bootloader preventing the encrypted sd card from being read
fastboot flash bootloader bootloader.img
fastboot reboot-bootloader
fastboot flash radio radio.img
fastboot reboot-bootloader
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot erase cache
Still unable to mount sd card. Man this sucks. Can't use my camera and many apps are kinda hosed without sd card support.
EDIT 2: I tried going into recovery just to see what was there (power on + volume up, then selecting "Recovery" and I got the android with the exclamation point. I guess that means there is no custom recovery anymore which is good but I thought there was a white screen that went into checking for update.zips automatically when you select the stock recovery.
MuthaF$%er...
I just got a pop up stating that the sd card was in an unsupported format and that I should reformat it. I did and all looks good now, but am unrooted and no recovery...dammit.
Guess I should've done that the other day before going through all the fast boot steps. Lost my data either way. Oh well, most was in the cloud anyways.
Thanks again for all the help. Now I know how to use fastboot at least

[Q] Update stock even if rooted

I am thinking of just going on stock android but i like adblock. So i will end up rooting my phone, i was wondering if there is a way to update Lollipop rooted without having to restore. I dont mind loosing my root after every update, i can always re root
thanks guys
rolgar20 said:
I am thinking of just going on stock android but i like adblock. So i will end up rooting my phone, i was wondering if there is a way to update Lollipop rooted without having to restore. I dont mind loosing my root after every update, i can always re root
thanks guys
Click to expand...
Click to collapse
Download new factory images
fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash radio radio.img
fastboot flash bootloader bootloader.img
reboot into your custom recovery
flash the latest SuperSU (http://download.chainfire.eu/supersu)
Elluel said:
Download new factory images
fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash radio radio.img
fastboot flash bootloader bootloader.img
reboot into your custom recovery
flash the latest SuperSU (http://download.chainfire.eu/supersu)
Click to expand...
Click to collapse
Wouldn't that wipe my data?
rolgar20 said:
Wouldn't that wipe my data?
Click to expand...
Click to collapse
The only things that will wipe your data:
unlocking the bootloader (which I assume you already have unlocked due to having root access)
flashing userdata.img (if you read my previous post, I left this out)
wiping the data partition in recovery
factory reset option in Android (which really just boots into recovery and wipes data from there)
Elluel said:
The only things that will wipe your data:
unlocking the bootloader (which I assume you already have unlocked due to having root access)
flashing userdata.img (if you read my previous post, I left this out)
wiping the data partition in recovery
factory reset option in Android (which really just boots into recovery and wipes data from there)
Click to expand...
Click to collapse
Wonderful, thanks!

Help unable to flash

I had cynogen mod installed and my phone rooted. Then all of a sudden i get a boot loop. I tried to flash but I receive an error FAILED <unable to flash write>. im able to go into recovery and boot loader. In my team win recovery in the terminal I get multiple errors saying "E:unable to mount '/data", "E:unable to mount /ata/media/TWRP/ .twrps when trying to read settings file" ,"E: No valid storage partitions found for MTP" (when i try to enable mtp), "E:unable to mount '/persist" and "E:unable to mount storage"
PLEASE HELP
I have same problem. Internal storage 0Mb. Can not mount /data /cache /sdcard. Using TWRP still see /system stucture but /sdcard /data are empty.
I was used NRT to flash other ROM or stock ROM, but 50% partition flashing is Failed (can not write flash...).
So sad! It seems my Nexus 5's flash chip is dead or device partition table is corrupt ?
ndminh82 said:
I have same problem. Internal storage 0Mb. Can not mount /data /cache /sdcard. Using TWRP still see /system stucture but /sdcard /data are empty.
I was used NRT to flash other ROM or stock ROM, but 50% partition flashing is Failed (can not write flash...).
So sad! It seems my Nexus 5's flash chip is dead or device partition table is corrupt ?
Click to expand...
Click to collapse
I looked into my partitions being corrupted but when i tried to repair them it said the file location didnt exist
Since you can boot into fastboot mode, did you try to flash the factory imgs? (except userdata.img to begin with).
Primokorn said:
Since you can boot into fastboot mode, did you try to flash the factory imgs? (except userdata.img to begin with).
Click to expand...
Click to collapse
yes im able to flash the system.img but not able to flash radio.img,bootloader.img,recovery.img,cache.img
dragonphx said:
yes im able to flash the system.img but not able to flash radio.img,bootloader.img,recovery.img,cache.img
Click to expand...
Click to collapse
With the flash-all script? Can you post the log?
Primokorn said:
With the flash-all script? Can you post the log?
Click to expand...
Click to collapse
Im using the nexus root toolkit, trying to do the flash stock and unroot for the boot loop. What flash.all script?
dragonphx said:
Im using the nexus root toolkit, trying to do the flash stock and unroot for the boot loop. What flash.all script?
Click to expand...
Click to collapse
A script in the official factory images to flash the partitions.
ive tried that before it still gives me the same errors FAILED <remote flash write fail>
please someone help me
My Nexus 5 was gone to repair center and they said its ROM Flash is corrupted. No replacement for it. I need to bring it to recycle bin!

My Phone Got Stuck On Huawei Logo after unlocking bootloader

Hi,
Please help...I just unlocked my Huawei ( mate 8 L29)...then I flashed TWRP but the phone got stuck on Huawei Logo....now I can only open TWRP and fastboot.......I dont have any data and I am ready to format the whole data if this is a solution.
Thank you
Boot into recovery and wipe/format after a backup of data. Then reboot, it will be.fine
bluheart said:
Boot into recovery and wipe/format after a backup of data. Then reboot, it will be.fine
Click to expand...
Click to collapse
thank you....I tried through TWRP to wipe /format but could NOT boot
Please advise if there is a way to install new ROM from pc ....and how to ....
basimzanaty said:
thank you....I tried through TWRP to wipe /format but could NOT boot
Please advise if there is a way to install new ROM from pc ....and how to ....
Click to expand...
Click to collapse
did you tried to root with twrp ?
Have you flashed decrypted boot image
ghs14 said:
Have you flashed decrypted boot image
Click to expand...
Click to collapse
No.....but I partially solved the problem by flashing IMG trough fast boot...I downloaded the following :
...I just wanted to put the link ...but it seems not allowed in the forum
then I flashed them by these orders:
fastboot flash cache cache.img
fastboot flash cust cust.img
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot reboot
It worked out but still I cant find any ZIP files in TWRP to root my phone....I think I need to flash decrypted boot image to enable TWRP to recognize these ZIP files.
Anyway ....Thank you all for help
Format via TWRP in itself will decrypt the storage and decrypt image will hold it future proof

How to erase CACHE PARTITION ?

I ran into a problem today when I tried to repair my Z5 Dual, I unplugged my phone in the beginning (NOT EVEN 5 Seconds). Then my phone started showing SOFTWARE UPDATE FAILED PLEASE CONNECT YOUR PHONE TO YOUR COMPUTER. I have a lot of important data in my phone which I need. I thought of just erasing the cache partition. But when I try via fastboot it says that REMOTE: COMMAND NOT ALLOWED HERE. Is there any other way to erase the cache partition? is there any other tool for erasing the cache partition alone? If the above doesn't work us there any way to recover the files in the internal storage. I have also encrypted some files using galleryvault that's why I prefer wiping cache and trying to boot up instead of flashing a new ROM with USERDATA box unchecked. Any help would really be appreciated.
Wipe it in twrp if you have it.
L33Tgod said:
Wipe it in twrp if you have it.
Click to expand...
Click to collapse
I haven't unlocked the bootloader.. No modifications to my phone. Is there any other way?
ajithpoison said:
I haven't unlocked the bootloader.. No modifications to my phone. Is there any other way?
Click to expand...
Click to collapse
Then just flash .ftf using flashtool without wiping anything

Categories

Resources