2

This is the normal LineageOS loading screen, which I had until yesterday:

enter image description here

Problem: Since yesterday, only one circle is going from right to left, forever. In other words, it never reaches the 3 circles (even after 8 hours overnight), and my Nexus 5 has become useless.

After reading Nexus 5 stuck on "flying color dots lollipop" screen after Hard Factory Reset I tried pressing Power/Volume- at the same time for 30 seconds. Result: It makes the fastboot screen appear for less than a second (during that split second I can move the cursor with Volume+/-), then the screen turns black, then fastboot for a split second again, then this boot-loop:

  1. white Google+unlocked lock on black background, for a few second
  2. black screen
  3. Vibration
  4. Back to step 1

Pressing the same Volume-/Power during the earlier "white Google+unlocked lock on black background" screen results also results in the same boot-loop.

During all of these phases (animation, fastboot, boot-loop), running adb logcat from my connected computer only shows waiting for device.

I am performing all of this with the charger plugged in. I even changed the battery to make sure it was not a power problem. To check I managed to quickly push "Power off" in fastboot and it shows the battery level: 100%.

The computer/port/cable I am using are the ones that I have been using everyday for years to transfer files and debug apps over USB. I also tried a wall charger and new cable too to make sure, same result.

The Nexus 5 is unencrypted.

After plugging the phone into a Windows computer (instead of my usual Linux), fastboot miraculously stayed on, and I was able to get the following information:

Partitions

~ # cat /proc/partitions
major minor  #blocks  name

 179        0   30535680 mmcblk0
 179        1      65536 mmcblk0p1
 179        2       1024 mmcblk0p2
 179        3        512 mmcblk0p3
 179        4        512 mmcblk0p4
 179        5        512 mmcblk0p5
 179        6        512 mmcblk0p6
 179        7       2048 mmcblk0p7
 179        8       1024 mmcblk0p8
 179        9        512 mmcblk0p9
 179       10        512 mmcblk0p10
 179       11        512 mmcblk0p11
 179       12       3072 mmcblk0p12
 179       13       3072 mmcblk0p13
 179       14        512 mmcblk0p14
 179       15      16384 mmcblk0p15
 179       16      16384 mmcblk0p16
 179       17       3072 mmcblk0p17
 179       18      22528 mmcblk0p18
 179       19      22528 mmcblk0p19
 179       20      22528 mmcblk0p20
 179       21       3072 mmcblk0p21
 179       22        512 mmcblk0p22
 179       23        512 mmcblk0p23
 179       24        512 mmcblk0p24
 179       25    1048576 mmcblk0p25
 179       26      30720 mmcblk0p26
 179       27     716800 mmcblk0p27
 179       28   28551146 mmcblk0p28
 179       29          5 mmcblk0p29
 179       32       4096 mmcblk0rpmb

Mount

~ # mount
rootfs on / type rootfs (rw,seclabel)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,seclabel,relatime)
/dev/block/mmcblk0p25 on /system type ext4 (ro,seclabel,relatime,data=ordered)

Block names

~ # ls -l /dev/block/platform/msm_sdcc.1/by-name
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 DDR -> /dev/block/mmcblk0p24
lrwxrwxrwx    1 root     root            20 Jan  1 01:00 aboot -> /dev/block/mmcblk0p6
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 abootb -> /dev/block/mmcblk0p11
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 boot -> /dev/block/mmcblk0p19
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 cache -> /dev/block/mmcblk0p27
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 crypto -> /dev/block/mmcblk0p26
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 fsc -> /dev/block/mmcblk0p22
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 fsg -> /dev/block/mmcblk0p21
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 grow -> /dev/block/mmcblk0p29
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 imgdata -> /dev/block/mmcblk0p17
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 laf -> /dev/block/mmcblk0p18
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 metadata -> /dev/block/mmcblk0p14
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 misc -> /dev/block/mmcblk0p15
lrwxrwxrwx    1 root     root            20 Jan  1 01:00 modem -> /dev/block/mmcblk0p1
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 modemst1 -> /dev/block/mmcblk0p12
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 modemst2 -> /dev/block/mmcblk0p13
lrwxrwxrwx    1 root     root            20 Jan  1 01:00 pad -> /dev/block/mmcblk0p7
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 persist -> /dev/block/mmcblk0p16
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 recovery -> /dev/block/mmcblk0p20
lrwxrwxrwx    1 root     root            20 Jan  1 01:00 rpm -> /dev/block/mmcblk0p3
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 rpmb -> /dev/block/mmcblk0p10
lrwxrwxrwx    1 root     root            20 Jan  1 01:00 sbl1 -> /dev/block/mmcblk0p2
lrwxrwxrwx    1 root     root            20 Jan  1 01:00 sbl1b -> /dev/block/mmcblk0p8
lrwxrwxrwx    1 root     root            20 Jan  1 01:00 sdi -> /dev/block/mmcblk0p5
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 ssd -> /dev/block/mmcblk0p23
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 system -> /dev/block/mmcblk0p25
lrwxrwxrwx    1 root     root            20 Jan  1 01:00 tz -> /dev/block/mmcblk0p4
lrwxrwxrwx    1 root     root            20 Jan  1 01:00 tzb -> /dev/block/mmcblk0p9
lrwxrwxrwx    1 root     root            21 Jan  1 01:00 userdata -> /dev/block/mmcblk0p28

Filesystem

~ # blkid /dev/block/mmcblk0p28
/dev/block/mmcblk0p28: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"

Wiping cache

~ # twrp wipe cache
Formatting cache using make_ext4fs...
Failed to mount '/cache' (Invalid argument)
Done processing script file

~ # mke2fs -t ext4 /dev/block/mmcblk0p27
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
44832 inodes, 179200 blocks
8960 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=184549376
6 block groups
32768 blocks per group, 32768 fragments per group
7472 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

~ # twrp reboot
command is: 'reboot' and there is no value
Failed to mount '/data' (Invalid argument)
Failed to mount '/data' (Invalid argument)
E:a
Done processing script file

Doing that cache wipe did not solve the problem, unfortunately: The OS animation has been running for 3 hours already.

Question: How to at least get the content of my Nexus 5's /sdcard saved to a computer? Or maybe even fix the Nexus if possible?

1

I guess the problem is related to cache partition. you can try to fix it with

fastboot format:ext4 cache

or from twrp recovery with

adb shell twrp wipe cache

also formatting the cache partition will help

adb shell mke2fs -t ext4 /dev/block/mmcblk0p27

You can manually backup your data (sdcard) partition. if data is encrypted, mount it with
twrp decrypt <password> where you have to use your screen lock pin/password. if you use a screen lock pattern you must translate it to password (see https://blog.alxu.ca/unlocking-large-pattern-encryption-in-twrp.html)
GNU tar for android and external MicroSD Card or USB-OTG flash drive is required for this. The tar binary is included in open_gapps.zip, download and unpack it, copy the binary to MicroSD Card and rename it to "tar"

mkdir /data
mount -t ext4 -o ro,noexec,noload,noatime /dev/block/mmcblk0p28 /data
cp /external_sd/tar /tmp
chmod a+x /tmp/tar
/tmp/tar --selinux --xattrs --numeric-owner -vcpP /data | gzip | split -a 1 -b 1024m - /external_sd/data.ext4.tar.gz.

if partition is not mountable, you can copy the partition with dd

dd if=/dev/block/mmcblk0p28 of=/external_sd/data.img            bs=1024 count=28551146
dd if=/dev/block/dm-0       of=/external_sd/data_decrypted.img  bs=1024 count=28551146

edit: (thx @ Nicolas Raoul) if your phone neither has external MicroSD Card nor USB-OTG support, you can stream the partition over adb.

adb pull /dev/block/mmcblk0p28  C:\adb\data.img
adb pull /dev/block/dm-0        C:\adb\data_decrypted.img

Open the file with OSFMount or mount it from sudo (see above command). The sdcard folder is located /data/media/0. If you want to restore the apps later on encrypted data partition, it is recommended to create a tar archive (in addition to the above flags) with --exclude data/media this will reduce the backup size. the restoring command line is

cat /external_sd/data.ext4.tar.gz.* | gzip -d | /tmp/tar --selinux --xattrs -vxpPC /
  • For mount -t ext4 -w /dev/block/mmcblk0p28 /data I get mount: mounting /dev/block/mmcblk0p28 on /data failed: Invalid argument – Nicolas Raoul May 9 at 13:45
  • 1
    The Nexus 5 is not encrypted. I guess I can run adb.exe pull /dev/block/mmcblk0p28 mmcblk0p28.img and then mount the image on Linux as ext4? – Nicolas Raoul May 9 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.