Nexus 5 installation stuck at erasing 'userdata'
-
The magic device tool attempt I mentioned above stayed stalled at erasing userdata for over 8 h before I shut off the phone. After rebooting into fastboot mode I found that I could sometimes use fastboot to format partitions, other times it would hang on the erase. I manually formated the partitions and then tried the system image server installation method, but that stalled again with the "'/cache/recovery/': Is a directory error". However, that did install the UBports Recovery before failing.
While in the UBports Recovery, I can push files to the device with adb. I was able to push all the files that were mentioned in the system image server terminal output. I suspect that I could complete the UBports installation if I were to know what needs to be pushed where and what adb or fastboot command is used to extract the files once they are pushed.
Can anyone tell me how to manually install the files or point me to the source files for the system image server or MDTool scripts so I can find the individual commands to do things manually?
-
You can try:
- Switching the device off and leave it off for a while.
- Remove your /home/joe/.cache/ubuntuimages and all its content.
- Start up in fastboot mode.
- Re-run the MDTool.
Repeat the steps if it fails a few times (5 times or so). Also make sure bootfast tells you that it is unlocked.
-
@hans1977se , I gave your suggestion a try. All five times it hung up on erasing userdata. Each time the terminal output was the same, other than the times changing slightly. An example is:
Detecting device
039c8980e0785f4f fastboot
Device detected !Flashing legacy channel
Creating filesystem with parameters:
Size: 734003200
Block size: 4096
Blocks per group: 32768
Inodes per group: 7472
Inode size: 256
Journal blocks: 2800
Label:
Blocks: 179200
Block groups: 6
Reserved block group size: 47
Created filesystem with 11/44832 inodes and 5813/179200 blocks
target reported max download size of 1073741824 bytes
erasing 'cache'...
OKAY [ 0.514s]
sending 'cache' (13348 KB)...
OKAY [ 0.630s]
writing 'cache'...
OKAY [ 1.029s]
finished. total time: 2.173s
Creating filesystem with parameters:
Size: 29236371456
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 32768
Label:
Blocks: 7137786
Block groups: 218
Reserved block group size: 1024
Created filesystem with 11/1785856 inodes and 156120/7137786 blocks
target reported max download size of 1073741824 bytes
erasing 'userdata'...I'd let it sit on the erasing userdata message for five minutes, then shut the phone off, let it sit five minutes, then try again.
I dug through the MD Tool scripts (launcher.sh and the others it calls) and found that in the end, it does the following:
fastboot format cache
fastboot format userdata
fastboot reboot-bootloader
ubuntu-device-flash --server=http://system-image.ubports.com touch --channel=ubports-touch/legacy --device=hammerhead --bootstrap
rm -f /tmp/AttachedDevicesI manually formated cache, rebooted to fastboot, manually formatted userdata (rebooting between formats makes it so it doesn't hang up on erasing), rebooted to fastboot, then ran the ubuntu-device-flash command. The terminal output was:
$ ubuntu-device-flash --verbose --server=http://system-image.ubports.com touch --channel=ubports-touch/legacy --device=hammerhead --bootstrap
2017/07/01 11:22:44 Device is |hammerhead|
2017/07/01 11:22:45 Flashing version 42 from ubports-touch/legacy channel and server http://system-image.ubports.com to device hammerheadWhile the above was displayed, the phone was flashing messages about erasing/downloading/writing. Then it blanked the screen and rebooted to a screen that showed Google with an unlocked padlock. A second or two after that happened, the following messages were displayed in the terminal:
2017/07/01 11:23:05 Start pushing /home/joe/.cache/ubuntuimages/pool/ubports-d50c18b27590af5734a826c4f7857d8909b0e0f902d21af142a780620c8eb58b.tar.xz to device
2017/07/01 11:23:05 Start pushing /home/joe/.cache/ubuntuimages/pool/device-728a726a0e9a9983dc3b3b5279ab12759b3e15d33a657dd4b9253b3aa27858c1.tar.xz to device
2017/07/01 11:23:05 Start pushing /home/joe/.cache/ubuntuimages/pool/keyring-4c4e7ef380ebcfa2c31084efa199138e93bfed8fc58aa3eb06bdf75a78af9b57.tar.xz to device
2017/07/01 11:23:05 Start pushing /home/joe/.cache/ubuntuimages/ubports-touch/15.04/stable/hammerhead/version-1.tar.xz to device
2017/07/01 11:23:05 Start pushing /home/joe/.cache/ubuntuimages/gpg/image-master.tar.xz to device
2017/07/01 11:23:05 Start pushing /home/joe/.cache/ubuntuimages/gpg/image-signing.tar.xz to device
2017/07/01 11:23:05 error pushing: failed to copy '/home/joe/.cache/ubuntuimages/pool/keyring-4c4e7ef380ebcfa2c31084efa199138e93bfed8fc58aa3eb06bdf75a78af9b57.tar.xz' to '/cache/recovery/': Is a directoryAfter a bit more time, the phone showed the Ubports Recovery page with various options. So it seems to me that something is happening to make the phone reboot before everything that is supposed to happen in fastboot actually occurs. There is a file push problem ("Is a directory", last line in the output above) and maybe other things.
I suspect I need to do the installation manually to sort it out. To do that, I need to know what files to push where and how to extract them once they are there. If you or anyone else can clue me in on the details of what commands ubuntu-device-flash is supposed to run, that might help me out.
-
It's really beginning to sound like the flash on your device is not up to par. Have you been able to flash the device with an Android image, or even its factory image?
-
@JoeBeach Too bad the luck was not on your side in this. It doesn't sound good, and i agree with @UniSuperBox that it seems to be something wrong with your flash. It could be partly broken, or maybe fastboot has been corrupted?
I think it would probably be best if you could get the phone back to android first. From your earlier posts i can see that you have tried that already, with problems, but maybe you could give it a second try? I also found this page (https://forum.xda-developers.com/google-nexus-5/general/fix-unbrick-nexus-5-stucked-qualcomm-hs-t3043301) that you could evaluate if it would be worth a try. I haven't tried it myself, so i cannot recommend you either way, but it look like it could be a way forward.
If you're in the end getting nowhere in this, maybe trying to get a very cheap second one with a cracked screen and build one working phone with a mix of parts from the two phones could be the way to go?
-
@UniSuperBox and @hans1977se , I am leaning toward hardware problems being the answer also. I was able to get the ubuntu-device-flash to execute without any error messages by booting to the UBports recovery, running an adb shell, and making a directory "recovery" under /cache. After exiting the adb shell I ran the ubuntu-device-flash command (no --bootstrap option so it would use the adb connection) with the following results:
$ ubuntu-device-flash --verbose --server=http://system-image.ubports.com touch --channel=ubports-touch/legacy --device=hammerhead
2017/07/01 13:55:10 Device is |hammerhead|
2017/07/01 13:55:10 Flashing version 42 from ubports-touch/legacy channel and server http://system-image.ubports.com to device hammerhead
2017/07/01 13:55:10 Start pushing /home/joe/.cache/ubuntuimages/pool/keyring-4c4e7ef380ebcfa2c31084efa199138e93bfed8fc58aa3eb06bdf75a78af9b57.tar.xz to device
2017/07/01 13:55:10 Start pushing /home/joe/.cache/ubuntuimages/ubports-touch/15.04/stable/hammerhead/version-1.tar.xz to device
2017/07/01 13:55:10 Done pushing /home/joe/.cache/ubuntuimages/pool/keyring-4c4e7ef380ebcfa2c31084efa199138e93bfed8fc58aa3eb06bdf75a78af9b57.tar.xz to device
2017/07/01 13:55:10 Done pushing /home/joe/.cache/ubuntuimages/ubports-touch/15.04/stable/hammerhead/version-1.tar.xz to device
2017/07/01 13:55:11 Start pushing /home/joe/.cache/ubuntuimages/pool/device-728a726a0e9a9983dc3b3b5279ab12759b3e15d33a657dd4b9253b3aa27858c1.tar.xz to device
2017/07/01 13:55:11 Start pushing /home/joe/.cache/ubuntuimages/gpg/image-signing.tar.xz to device
2017/07/01 13:55:11 Start pushing /home/joe/.cache/ubuntuimages/gpg/image-master.tar.xz to device
2017/07/01 13:55:11 Done pushing /home/joe/.cache/ubuntuimages/gpg/image-signing.tar.xz to device
2017/07/01 13:55:11 Done pushing /home/joe/.cache/ubuntuimages/gpg/image-master.tar.xz to device
2017/07/01 13:55:12 Start pushing /home/joe/.cache/ubuntuimages/pool/ubports-d50c18b27590af5734a826c4f7857d8909b0e0f902d21af142a780620c8eb58b.tar.xz to device
2017/07/01 13:55:19 Done pushing /home/joe/.cache/ubuntuimages/pool/device-728a726a0e9a9983dc3b3b5279ab12759b3e15d33a657dd4b9253b3aa27858c1.tar.xz to device
2017/07/01 13:55:43 Done pushing /home/joe/.cache/ubuntuimages/pool/ubports-d50c18b27590af5734a826c4f7857d8909b0e0f902d21af142a780620c8eb58b.tar.xz to device
2017/07/01 13:55:43 Created ubuntu_command: /home/joe/.cache/ubuntuimages/ubuntu_commands501912074
2017/07/01 13:55:43 Rebooting into recovery to flash
$That all looked great, but in the end it still doesn't boot into UBports, it just sits on a black screen with "Google" in the center and and unlocked icon at the bottom.
I'll do some looking to see if the flash is replaceable in the Nexus 5, but I suspect it is not. There are other ones out there I could buy, I just picked this one up because it was cheap and local. I should have insisted on seeing it boot up before I bought it. Oh well, I've spent $60 on worse things...
-
@JoeBeach You could even upgrade to 64GB in the same go. I found this hack blog (http://hackaday.com/2016/05/10/upgrading-a-nexus-5-emmc-to-64gb/). It's not for the fainthearted, and uncertain if more than 32GB will be usable, but quite interesting.
-
Hi there,
I just found this thread. Maybe my problem is even better addressed here:
I followed the instructions on your website. Unlocked bootloader and root the device.Using magic-device-tool I receive through following error message:
err: fork/exec /usr/bin/xz: cannot allocate memory
Can you please help me?
-
Before this error message I received:
Unable to write recovery img -
@hans1977se I saw that blog too. I have a reasonable amount of skill with soldering, but I think I'd also like to have a bit of good luck on my side to pull that off. On the other hand, if the phone isn't working anyway, maybe its worth a shot...
-
@tH3f0rC3 I'm definitely not an expert at this, but I'll give my input.
I took a quick look at the man page for xz. It is a compression/decompression tool. The terminal output I posted earlier shows that one part of the installation is copying various *.xz files to the phone. It appears that it then runs xz on those compressed files to uncompress them. The "Unable to write recovery img" and "cannot allocate memory" error messages suggest to me that the phone's memory is full. Whether that means RAM or flash memory, I'm not sure. If it is a RAM problem, I'm not sure what to do. If it is a flash problem, perhaps the partitions were not properly reformatted during the installation process or maybe the phone has a nonstandard partition layout that doesn't have enough room for the uncompressed files?
Can the phone boot to its previous operating system and work properly?
-
@JoeBeach I have soldered these kind of chips, both successfully and unsuccessfully, and i think there are particularly two things that are difficult. The first thing is that surrounding components very easily goes off the pcb, and the other thing is to get good connections to the pcb on all pads. I think an IR-heater is probably the best for this job.
I don't know where you're located, but is some parts of the world it is very easy and cheap to have someone doing this. Otherwise, if you have to do it yourself, like you say on the other hand it is unusable scrap anyway.
Did you try the un-brick instruction i linked to as well?
-
@hans1977se I had not looked at the unbrick link, I missed that along the way. I don't normally work in windows, but I have a dual boot laptop at work for occasions like this. I'll give it a try and let you know what I find.
-
@JoeBeach
Yes, the currently installed Android system works still very well.
Do you have any suggestion how to clean memory and try again. By the way, its a 16GB Nexus 5.Best Regards,
-
Dont know if it helps, but we got one user that could rectify this by installing TWRP, and following all possible clean/erase/format steps
-
@hans1977se I tried the unbrick software that you linked to on xda, but had no luck. The phone never showed up on a COM port even after installing the drivers that were mentioned. That prevents the use of the software. I'm taking that as a sign that the flash is damaged.
-
@Flohack I tried installing TWRP again and trying the various format and wipe options. No luck there. They all ended up giving error messages about not being able to mount various partitions. I'm taking this as another indication that the flash is damaged.
I am giving up on trying to fix things via software. I'll either be finding another Nexus 5 that I can confirm works before buying or perhaps trying to replace the flash. Probably the first option just because it sounds like it should be quicker.
-
@JoeBeach Thanks for the update! I think buying a phone that you can verify that it works is probably going to be the most predictable and easy solution.
Soldering that kind of chip could easily go wrong.
Good luck!
-
@JoeBeach I got a suggestion from a friend. You could try CWM recovery for Nexus 5. It's similar to TWRP, he said, but maybe some differences that you could benefit from.
-
Hi Everyone,
I ended up buying another used Nexus 5 from Cellular Exchange for $169 and I have successfully installed UBports on it. It took three runs of Magic Device Tool: 1st to unlock the bootloader, 2nd to install the UBports Recover, 3rd to install UBPorts. So far, everything seems to be working fine. I have changed my T-mobile service over to it, so I'll be getting a crash course in UBports use.
Thank you for all of the suggestions troubleshooting the other phone. I may yet try to repair it.
Would it be worthwhile to start another thread outlining the successful installation? Or maybe add it to the wiki?