[Nexus 4 Q&A, Help & Troubleshooting] AndRe5575:
Hi together,

I got a problem with my Nexus 4 (5.1.1) without any reason it ended in a bootloop after I restarted it.

So I tried to manually flash the original Stock on it and after I rebooted into the original recovery menu to delete the userdata/cache (full reset) the following was displayed:

E:failed to mount /cache (invalid argument)

E:can't mount /cache/recovery/log

E:can't open /cache/recovery/log

E:failed to mount /cache (invalid argument)

E:can't mount /cache/recovery/last_log

E:can't open /cache/recovery/last_log

E:failed to mount /cache (invalid argument)

E:can't mount/cache/recovery/last_install

E:can't open /cache/recovery/last_install

E:failed to mount /cache (invalid argument)

After that I tried to install it by using the Nexus Root Kit but still the same -> bootloop.

So I decided to install 4.2.0 and it worked without bootloop. Next I updated my Nexus 4 via OTA and everything went fine until I updated to 4.4.3 -> bootloop

After that I rooted my Nexus by the use of Nexus Root Kit including TWRP and the Stock Firmware 4.2.0 to check the log file. The only thing that was wondering me is the following inside:

E:Unable to mount '/usb-otg' But I think that one is OK because no otg is plugged

So I installed 5.1.1 again (including TWRP) to compare both log files. My Nexus still ended in bootloop so I opend the recovery menu to copy the following log file:

Starting TWRP 2.8.6.1 on Tue Jun 2 22:22:59 2015

(pid 153)

BOARD_HAS_NO_REAL_SDCARD := true

RECOVERY_SDCARD_ON_DATA := true

TW_NO_USB_STORAGE := true

TW_INCLUDE_CRYPTO := true

I:Found brightness file at '/sys/devices/i2c-0/0-0038/backlight/lm3530/brightness'

I:TWFunc::Set_Brightness: Setting brightness control to 255

Starting the UI...Pixel format: 768x1280 @ 32bpp

Pixel format: RGBX_8888

Not using qualcomm overlay, 'msmfb44_80601'

framebuffer: fd 4 (768 x 1280)

I:Scaling the curtain width 1.600000x and height 1.600000x

=> Linking mtab

Renaming regular /etc/recovery.fstab -> /etc/recovery.fstab.bak

Moving /etc/twrp.fstab -> /etc/recovery.fstab

=> Processing recovery.fstab

I:Processing '/boot'

I:Processing '/recovery'

I:Processing '/system'

I:Processing '/data'

I:Setting up '/data' as data/media emulated storage.

I:Created '/sdcard' folder.

I:mount -o bind '/data/media' '/sdcard' process ended with RC=0

I:mount -o bind '/data/media' '/sdcard' process ended with RC=0

I:Processing '/cache'

I:Unable to mount '/cache'

I:Actual block device: '/dev/block/mmcblk0p22', current file system: 'ext4'

I:Processing '/usb-otg'

I:Created '/usb-otg' folder.

I:Backup folder set to '/data/media/TWRP/BACKUPS/XXXX'

I:Settings storage is '/data/media'

Updating partition details...

I: Data backup size is 5MB, free: 5701MB.

E:Unable to mount '/cache'

I:Actual block device: '/dev/block/mmcblk0p22', current file system: 'ext4'

E:Unable to mount '/usb-otg'

I:Actual block device: '', current file system: 'vfat'

...done

I:Unmounting main partitions...

Partition Logs:

/boot | /dev/block/mmcblk0p6 | Size: 22MB

Flags: Can_Be_Backed_Up IsPresent Can_Flash_Img

Primary_Block_Device: /dev/block/mmcblk0p6

Display_Name: Boot

Storage_Name: boot

Backup_Path: /boot

Backup_Name: boot

Backup_Display_Name: Boot

Storage_Path: /boot

Current_File_System: emmc

Fstab_File_System: emmc

Backup_Method: dd

/recovery | /dev/block/mmcblk0p7 | Size: 22MB

Flags: IsPresent Can_Flash_Img

Primary_Block_Device: /dev/block/mmcblk0p7

Display_Name: Recovery

Storage_Name: recovery

Backup_Path: /recovery

Backup_Name: recovery

Backup_Display_Name: Recovery

Storage_Path: /recovery

Current_File_System: emmc

Fstab_File_System: emmc

Backup_Method: dd

/system | /dev/block/mmcblk0p21 | Size: 827MB Used: 814MB Free: 12MB Backup Size: 814MB

Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_Available_in_GUI IsPresent

Primary_Block_Device: /dev/block/mmcblk0p21

Display_Name: System

Storage_Name: System

Backup_Path: /system

Backup_Name: system

Backup_Display_Name: System

Storage_Path: /system

Current_File_System: ext4

Fstab_File_System: ext4

Backup_Method: files

/data | /dev/block/mmcblk0p23 | Size: 5803MB Used: 5MB Free: 5701MB Backup Size: 5MB

Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_During_Factory_Reset Wipe_Available_in_GUI IsPresent Can_Be_Encrypted Has_Data_Media Can_Encrypt_Backup Use_Userdata_Encryption Is_Storage Is_Settings_Storage

Symlink_Path: /data/media

Symlink_Mount_Point: /sdcard

Primary_Block_Device: /dev/block/mmcblk0p23

Crypto_Key_Location: /dev/block/platform/msm_sdcc.1/by-name/metadata

Display_Name: Data

Storage_Name: Internal Storage

Backup_Path: /data

Backup_Name: data

Backup_Display_Name: Data

Storage_Path: /data/media

Current_File_System: ext4

Fstab_File_System: ext4

Backup_Method: files

MTP_Storage_ID: XXXX7

/cache | /dev/block/mmcblk0p22 | Size: 0MB Used: 0MB Free: 0MB Backup Size: 0MB

Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_During_Factory_Reset Wipe_Available_in_GUI IsPresent

Primary_Block_Device: /dev/block/mmcblk0p22

Display_Name: Cache

Storage_Name: Cache

Backup_Path: /cache

Backup_Name: cache

Backup_Display_Name: Cache

Storage_Path: /cache

Current_File_System: ext4

Fstab_File_System: ext4

Backup_Method: files

/usb-otg | | Size: 0MB Used: 0MB Free: 0MB Backup Size: 0MB

Flags: Can_Be_Mounted Can_Be_Wiped

Primary_Block_Device: /dev/block/sda1

Alternate_Block_Device: /dev/block/sda

Display_Name: usb-otg

Storage_Name: usb-otg

Backup_Path: /usb-otg

Backup_Name: usb-otg

Backup_Display_Name: usb-otg

Storage_Path: /usb-otg

Current_File_System: vfat

Fstab_File_System: vfat

Backup_Method: files

I:Loading package: TWRP (/script/ui.xml)

I:Load XML directly

I:Loading package: TWRP (/data/media/TWRP/theme/ui.zip)

I:Loading zip theme

I:Loading package: TWRP (/twres/ui.xml)

I:Load XML directly

I:Checking resolution...

I:Scaling theme width 1.600000x and height 1.600000x, offsets x: 24 y: 0

I:Loading resources...

open_png /twres/images/twrplogo.png

libpng warning: iCCP: Not recognizing known sRGB profile that has been edited

open_png /twres/images/menu-button.png

open_png /twres/images/file.png

open_png /twres/images/folder.png

open_png /twres/images/slideout.png

open_png /twres/images/indeterminate001.png

open_png /twres/images/indeterminate002.png

open_png /twres/images/indeterminate003.png

open_png /twres/images/indeterminate004.png

open_png /twres/images/indeterminate005.png

open_png /twres/images/indeterminate006.png

open_png /twres/images/indeterminate007.png

open_png /twres/images/progress_empty.png

open_png /twres/images/progress_fill.png

open_png /twres/images/checkbox_empty.png

open_png /twres/images/checkbox_checked.png

open_png /twres/images/radio_empty.png

open_png /twres/images/radio_selected.png

open_png /twres/images/medium-button.png

open_png /twres/images/sort-button.png

open_png /twres/images/minus-button.png

open_png /twres/images/plus-button.png

open_png /twres/images/home-icon.png

open_png /twres/images/back-icon.png

open_png /twres/images/slider.png

open_png /twres/images/slider-used.png

open_png /twres/images/slider-touch.png

open_png /twres/images/unlock.png

open_png /twres/images/keyboard1.png

open_png /twres/images/keyboard2.png

open_png /twres/images/keyboard3.png

open_png /twres/images/keyboard4.png

open_png /twres/images/cursor.png

I:Loading variables...

I:Loading mouse cursor...

I:Loading pages...

I:PageSet::CheckInclude loading filename: '/twres/portrait.xml'

I:Loading included resources...

I:Loading included variables...

I:Loading mouse cursor...

I:Loading included pages...

I:Loading page main

I:Loading page main2

I:Loading page install

I:Loading page flash_confirm

I:Loading page flash_zip

I:Loading page flash_done

I:Loading page install_image

I:Loading page flashimage_confirm

I:Loading page clear_vars

I:Loading page confirm_action

I:Loading page action_page

I:Loading page singleaction_page

I:Loading page action_complete

I:Loading page filecheck

I:Loading page rebootcheck

I:Loading page wipe

I:Loading page advancedwipe

I:Loading page formatdata

I:Loading page formatdata_confirm

I:Loading page checkpartitionlist

I:Loading page partitionoptions

I:Loading page refreshfilesystem

I:Loading page selectfilesystem

I:Loading page backup

I:Loading page backupname1

I:Loading page backupname2

I:Loading page backupencryption

I:Loading page backupencryption2

I:Loading page checkbackuppassword

I:Loading page backup_run

I:Loading page restore

I:Unable to open '/data/media/TWRP/BACKUPS/XXXX'

I:Loading page restore_read

I:Loading page restore_decrypt

I:Loading page try_restore_decrypt

I:Loading page restore_select

I:Loading page renamebackup

I:Loading page restore_run

I:Loading page selectstorage

I:Loading page mount

I:Loading page usb_mount

I:Loading page usb_umount

I:Loading page reboot

I:Loading page settings

I:Loading page timezone

I:Loading page screen

I:Loading page Vibrate

I:Loading page advanced

I:Loading page partsdcard

I:Loading page htcdumlock

I:Loading page lock

I:Loading page filemanagerlist

I:Loading page filemanageroptions

I:Loading page choosedestinationfolder

I:Loading page filemanagerrenamefile

I:Loading page filemanagerrenamefolder

I:Loading page filemanagerchmod

I:Loading page filemanagerconfirm

I:Loading page filemanageracction

I:Loading page decrypt

I:Loading page decrypt_pattern

I:Loading page trydecrypt

I:Loading page terminalfolder

I:Loading page terminalcommand

I:Loading page sideload

I:Loading page fixperms

I:Loading page installsu

I:Set page: 'clear_vars'

I:Set page: 'main2'

I:Switching packages (TWRP)

SELinux contexts loaded from /file_contexts

E:Unable to mount '/cache'

I:Actual block device: '/dev/block/mmcblk0p22', current file system: 'ext4'

I:Could not check /cache/recovery SELinux contexts, using /sbin/teamwin instead which may be inaccurate.

Full SELinux support is present.

E:Unable to mount '/cache'

I:Actual block device: '/dev/block/mmcblk0p22', current file system: 'ext4'

E:Cannot load volume /misc!

E:Cannot load volume /misc!

Startup Commands:

ro.qc.sensors.wl_dis=true

ro.sf.lcd_density=320

ro.com.google.clientidbase=android-google

ro.com.android.dateformat=MM-dd-yyyy

ro.com.android.dataroaming=true

ro.com.android.wifi-watchlist=GoogleGuest

ro.url.legal= not allowed to post

ro.boot.emmc=true

ro.boot.baseband=mdm

ro.boot.hardware=mako

ro.boot.serialno=XXXX

ro.boot.bootloader=MAKOZ30f

ro.omni.device=mako

ro.omni.version=5.0.2-20150515-mako-HOMEMADE

ro.twrp.boot=1

ro.twrp.version=2.8.6.1

ro.wifi.channels=

ro.allow.mock.location=1

ro.board.platform=msm8960

ro.build.id=LRX22G

ro.build.date=Fri May 15 14:40:19 EDT 2015

ro.build.date.utc=0

ro.build.host=build

ro.build.tags=test-keys

ro.build.type=eng

ro.build.user=jenkins

ro.build.display.id=omni_mako-eng 5.0.2 LRX22G 2 test-keys

ro.build.product=mako

ro.build.version.sdk=21

ro.build.version.release=5.0.2

ro.build.version.codename=REL

ro.build.version.incremental=2

ro.build.version.all_codenames=REL

ro.build.description=omni_mako-eng 5.0.2 LRX22G 2 test-keys

ro.build.fingerprint=google/omni_mako/mako:5.0.2/LRX22G/2:eng/test-keys

ro.build.characteristics=nosdcard

ro.config.ringtone=Orion.ogg

ro.config.alarm_alert=Argon.ogg

ro.config.notification_sound=pixiedust.ogg

ro.dalvik.vm.native.bridge=0

ro.kernel.android.checkjni=1

ro.secure=0

ro.zygote=zygote32

ro.carrier=unknown

ro.product.cpu.abi=armeabi-v7a

ro.product.cpu.abi2=armeabi

ro.product.cpu.abilist=armeabi-v7a,armeabi

ro.product.cpu.abilist32=armeabi-v7a,armeabi

ro.product.cpu.abilist64=

ro.product.name=omni_mako

ro.product.board=MAKO

ro.product.brand=google

ro.product.model=Nexus 4

ro.product.device=mako

ro.product.locale.region=US

ro.product.locale.language=en

ro.product.manufacturer=LGE

ro.baseband=mdm

ro.bootmode=unknown

ro.hardware=mako

ro.opengles.version=196608

ro.qualcomm.bt.hci_transport=smd

ro.qualcomm.sensors.smd=true

ro.revision=11

ro.serialno=XXXX

ro.telephony.call_ring.multiple=0

ro.bootloader=MAKOZ30f

ro.debuggable=1

ro.modversion=OmniROM-5.0.2-20150515-mako-HOMEMADE

ro.factorytest=0

ro.setupwizard.enterprise_mode=1

drm.service.enabled=true

net.bt.name=Android

net.change=net.bt.name

init.svc.adbd=running

init.svc.healthd=running

init.svc.ueventd=running

init.svc.recovery=running

init.svc.set_permissive=stopped

rild.libpath=/system/lib/libril-qc-qmi-1.so

twrp.crash_counter=0

wifi.interface=wlan0

wifi.supplicant_scan_interval=15

debug.egl.recordable.rgba8888=1

media.aac_51_output_enabled=true

dalvik.vm.isa.arm.features=div

dalvik.vm.heapsize=512m

dalvik.vm.dex2oat-Xms=64m

dalvik.vm.dex2oat-Xmx=512m

dalvik.vm.heapmaxfree=8m

dalvik.vm.heapminfree=512k

dalvik.vm.dexopt-flags=m=y

dalvik.vm.heapstartsize=8m

dalvik.vm.dex2oat-filter=interpret-only

dalvik.vm.heapgrowthlimit=192m

dalvik.vm.stack-trace-file=/data/anr/traces.txt

dalvik.vm.image-dex2oat-Xms=64m

dalvik.vm.image-dex2oat-Xmx=64m

dalvik.vm.image-dex2oat-filter=verify-none

dalvik.vm.heaptargetutilization=0.75

persist.hwc.mdpcomp.enable=true

persist.sys.usb.config=mtp,adb

persist.sys.dalvik.vm.lib.2=libart.so

persist.sys.root_access=1

persist.audio.dualmic.config=endfire

persist.audio.fluence.mode=endfire

persist.audio.fluence.voicecall=true

persist.audio.handset.mic=dmic

persist.audio.handset.mic.type=digital

persist.audio.lowlatency.rec=false

persist.radio.apm_sim_not_pwdn=1

service.adb.root=1

keyguard.no_require_sim=true

telephony.lteOnCdmaDevice=0

I:Unable to mount '/cache'

I:Actual block device: '/dev/block/mmcblk0p22', current file system: 'ext4'

I:Failed to mount /cache for TWFunc::Update_Log_File

E:Unable to mount '/cache'

I:Actual block device: '/dev/block/mmcblk0p22', current file system: 'ext4'

tw_get_context got selinux context: u: object_r:media_rw_data_file:s0

I:Got default contexts and file mode for storage files.

I:Attempt to load settings from settings file...

I:Settings file '/data/media/TWRP/.twrps' not found.

I:Unable to mount '/cache'

I:Actual block device: '/dev/block/mmcblk0p22', current file system: 'ext4'

I:Unable to mount '' to write version number.

__bionic_open_tzdata: couldn't find any tzdata when looking for CST6CDT!

__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!

I:TWFunc::Set_Brightness: Setting brightness control to 255

I:TWFunc::Fixup_Time: Pre-fix date and time: 2015-06-02--17-23-02

I:TWFunc::Fixup_Time: Setting time offset from file /sys/class/rtc/rtc0/since_epoch

I:TWFunc::Fixup_Time: Date and time corrected: 2015-06-02--17-23-02

I:Enabling MTP during startup

I:Starting MTP

Starting MTP

I:Get_Max_FileSize::maxFileSize: 17592186044416

I:sending message to add XXXX7 '/data/media' 'Internal Storage'

I:Message sent, add storage ID: XXXX7

MTP Enabled

I:Switching packages (TWRP)

created new mtpserver object

MtpServer::run fd: 15

mtppipe add storage XXXX7 '/data/media'

MtpStorage id: XXXX7 path: /data/media

I:Set page: 'advanced'

I:Set page: 'confirm_action'

I:Set page: 'action_page'

I: operation_start: 'Copy Log'

I:Copying file /tmp/recovery.log to /data/media/recovery.log

So I tried to repair the cache

Repairing Cache using e2fsck...

I:Repair command: /sbin/e2fsck -p /dev/block/mmcblk0p22

Error reading block 164361 (Invalid argument).

/dev/block/mmcblk0p22: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.

(i.e., without -a or -p options)

E:/sbin/e2fsck -p /dev/block/mmcblk0p22 process ended with ERROR=4

E:Unable to repair '/cache'.

E:Error repairing file system.

I:Set page: 'action_complete'

I: operation_end - status=1

I:Set page: 'clear_vars'

I:Set page: 'partitionoptions'

I:Set page: 'selectfilesystem'

I:Set page: 'confirm_action'

I:Set page: 'action_page'

I: operation_start: 'Change File System'

Formatting Cache using mkexfatfs...

mkexfatfs 1.0.0

Creating... done.

Flushing... done.

File system created successfully.

I:mkexfatfs /dev/block/mmcblk0p22 process ended with RC=0

Done.

I:cmd: /sbin/exfat-fuse -o big_writes,max_read=131072,max_write=131072 /dev/block/mmcblk0p22 /cache

__bionic_open_tzdata: couldn't find any tzdata when looking for CST6CDT!

__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!

__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!

__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!

I:Recreating /cache/recovery folder.

I:Copying file /etc/recovery.fstab to /cache/recovery/recovery.fstab

I:Version number saved to '/cache/recovery/.version'

Updating partition details...

I: Data backup size is 76MB, free: 5629MB.

E:Unable to mount '/usb-otg'

I:Actual block device: '', current file system: 'vfat'

...done

I:Set page: 'action_complete'

I: operation_end - status=0

I:Set page: 'clear_vars'

I:Set page: 'refreshfilesystem'

I:getpartitiondetails list '/cache;'

I:getpartitiondetails wipe_path '/cache'

I:Set page: 'selectfilesystem'

I:Set page: 'confirm_action'

I:Set page: 'action_page'

I: operation_start: 'Change File System'

Formatting cache using make_ext4fs function.

Creating filesystem with parameters:

Size: 587202560

Block size: 4096

Blocks per group: 32768

Inodes per group: 7168

Inode size: 256

Journal blocks: 2240

Label:

Blocks: 143360

Block groups: 5

Reserved block group size: 39

Created filesystem with 11/35840 inodes and 4616/143360 blocks

I:Recreating /cache/recovery folder.

I:Copying file /etc/recovery.fstab to /cache/recovery/recovery.fstab

I:Version number saved to '/cache/recovery/.version'

Updating partition details...

I: Data backup size is 76MB, free: 5629MB.

E:Unable to mount '/usb-otg'

I:Actual block device: '', current file system: 'vfat'

...done

I:Set page: 'action_complete'

I: operation_end - status=0

I:Set page: 'clear_vars'

I:Set page: 'refreshfilesystem'

I:getpartitiondetails list '/cache;'

I:getpartitiondetails wipe_path '/cache'

I:Set page: 'selectfilesystem'

I:Set page: 'partitionoptions'

I:Set page: 'advancedwipe'

I:Set page: 'wipe'

I:Set page: 'main'

I:Set page: 'clear_vars'

I:Set page: 'main2'

I:Set page: 'advanced'

I:Set page: 'confirm_action'

I:Set page: 'action_page'

I: operation_start: 'Copy Log'

I:Copying file /tmp/recovery.log to /data/media/0/recovery.log

Because it was not working I changed the format to exFAT and back to EXT4. After that the only fault message was the one about USB-otg.

After a restart the system still keeps in bootloop and I don´t know why.

The KMS_Log shows nothing special during the boot

<6>[ 3.898489] SELinux: Context u: object_r:adb_data_file:s0 is not valid (left unmapped).

<6>[ 5.361574] mtp_open

<6>[ 6.996764] msm_ta_detect_work: USB exit ta detection - frindex

<6>[ 20.373569] [MPDEC]: CPU[3] on->off | Mask=[1110] | time online: 20376

<6>[ 20.633358] [MPDEC]: CPU[2] on->off | Mask=[1100] | time online: 20636

<6>[ 20.893667] [MPDEC]: CPU[1] on->off | Mask=[1000] | time online: 20897

<6>[ 22.107126] adjust_soc: ibat_ua = -212100, vbat_uv = 4043625, soc = 68, batt_temp=340

<6>[ 42.106912] adjust_soc: ibat_ua = -212700, vbat_uv = 4048677, soc = 68, batt_temp=338

<6>[ 62.107065] adjust_soc: ibat_ua = -121500, vbat_uv = 4033522, soc = 68, batt_temp=337

<6>[ 82.106912] adjust_soc: ibat_ua = -213800, vbat_uv = 4053136, soc = 68, batt_temp=337

<6>[ 102.106943] adjust_soc: ibat_ua = -211500, vbat_uv = 4053429, soc = 68, batt_temp=339

I also tried a factory reset (still just unable to mount usb-otg) but it keeps in the bootloop.

Someone got an idea what to do next?