[Galaxy S III Q&A, Help & Troubleshooting] dscoular:
Hi All,

I've loved my Samsung Galaxy S3 I9300 and have been so happy with the Resurrection Remix Marshmallow ROM (ResurrectionRemix-M-v5.6.4-20160223-i9300.zip). Over the last few weeks, I'd notice the phone would have random problems but a re-install via full wipe would bring it back into working order. However, when I woke up this morning all I could get was the Samsung SIII boot logo, the recovery: TWRP v2.8.6.1 or the fastboot/download mode.

When the TWRP recovery is booted I discovered I can get a root shell via "adb shell" and that /data was empty and, in fact, all my filesystems are read only. I'm an old linux hand so I suspect my 16GB of internal Nand memory is getting a bit too long in the tooth... so I thought I'd "umount /data" try running "e2fsck -vf /dev/block/mmcblk0p12" on the /data device... and "/proc/kmsg" spurts out a steady stream of I/O errors:

<7>[ 1440.020301] c0 mshci: ===========================================

<3>[ 1440.020402] c0 brq->sbc.opcode=23,brq->cmd.opcode=25.

<3>[ 1440.020449] c0 brq->sbc.error=-110,brq->cmd.error=0, brq->stop.error=0,brq->data.error=0.

<3>[ 1440.020558] c0 mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400d00

<3>[ 1440.020628] c0 mmcblk0: command error, retrying timeout

<3>[ 1440.144001] c0 mmc0: cmd 23 response timeout error

<7>[ 1440.144050] c0 mshci: ============== REGISTER DUMP ==============

<7>[ 1440.144105] c0 mshci: MSHCI_CTRL: 0x00000010

<7>[ 1440.144147] c0 mshci: MSHCI_PWREN: 0x00000001

<7>[ 1440.144190] c0 mshci: MSHCI_CLKDIV: 0x00000001

<7>[ 1440.144232] c0 mshci: MSHCI_CLKSRC: 0x00000000

<7>[ 1440.144275] c0 mshci: MSHCI_CLKENA: 0x00000001

<7>[ 1440.144317] c0 mshci: MSHCI_TMOUT: 0xffffffff

<7>[ 1440.144360] c0 mshci: MSHCI_CTYPE: 0x00010000

<7>[ 1440.144402] c0 mshci: MSHCI_BLKSIZ: 0x00000200

<7>[ 1440.144445] c0 mshci: MSHCI_BYTCNT: 0x00001000

<7>[ 1440.144488] c0 mshci: MSHCI_INTMSK: 0x0000bfce

<7>[ 1440.144530] c0 mshci: MSHCI_CMDARG: 0x00000020

<7>[ 1440.144573] c0 mshci: MSHCI_CMD: 0x20002157

<7>[ 1440.144615] c0 mshci: MSHCI_MINTSTS: 0x00000000

<7>[ 1440.144658] c0 mshci: MSHCI_RINTSTS: 0x00000030

<7>[ 1440.144700] c0 mshci: MSHCI_STATUS: 0x00006906

<7>[ 1440.144743] c0 mshci: MSHCI_FIFOTH: 0x503f0040

<7>[ 1440.144786] c0 mshci: MSHCI_CDETECT: 0x00000001

<7>[ 1440.144828] c0 mshci: MSHCI_WRTPRT: 0x00000001

<7>[ 1440.144871] c0 mshci: MSHCI_GPIO: 0x00000000

<7>[ 1440.144913] c0 mshci: MSHCI_TCBCNT: 0x00000800

<7>[ 1440.144956] c0 mshci: MSHCI_TBBCNT: 0x00001000

<7>[ 1440.144999] c0 mshci: MSHCI_DEBNCE: 0x000fffff

<7>[ 1440.145041] c0 mshci: MSHCI_USRID: 0xffffffff

<7>[ 1440.145084] c0 mshci: MSHCI_VERID: 0x5342240a

<7>[ 1440.145127] c0 mshci: MSHCI_HCON: 0x00e424c1

<7>[ 1440.145169] c0 mshci: MSHCI_UHS_REG: 0x00010000

<7>[ 1440.145212] c0 mshci: MSHCI_BMOD: 0x00000582

<7>[ 1440.145254] c0 mshci: MSHCI_PLDMND: 0x00000000

<7>[ 1440.145297] c0 mshci: MSHCI_DBADDR: 0x6bc44000

<7>[ 1440.145340] c0 mshci: MSHCI_IDSTS: 0x00000000

<7>[ 1440.145382] c0 mshci: MSHCI_IDINTEN: 0x00000000

<7>[ 1440.145425] c0 mshci: MSHCI_DSCADDR: 0x6bc44000

<7>[ 1440.145467] c0 mshci: MSHCI_BUFADDR: 0x00000000

<7>[ 1440.145510] c0 mshci: MSHCI_WAKEUPCON: 0x00000000

<7>[ 1440.145553] c0 mshci: MSHCI_CLOCKCON: 0x00000000

<7>[ 1440.145595] c0 mshci: MSHCI_FIFODAT: 0x00000000

<7>[ 1440.145638] c0 mshci: ===========================================

<3>[ 1440.145808] c0 mmc0: it occurs a critical error on eMMC it'll try to recover eMMC to normal state​

So, since my TWRP seems intact but my internal Nand memory appears hosed is there any way I can convince TWRP or any other bootloader/recovery to use my external SDCARD as a boot device instead ?

I note that there's a /init.rc which appears to define where ANDROID_ROOT and ANDROID_DATA come from:

on init

export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin

export LD_LIBRARY_PATH .:/sbin

export ANDROID_ROOT /system

export ANDROID_DATA /data

export EXTERNAL_STORAGE /sdcard

mkdir /sdcard

mkdir /extSdCard

mkdir /system

mkdir /data

mkdir /cache

mkdir /preload

mkdir /efs

mount /tmp /tmp tmpfs​

I'm not clear on where the content of / comes from... I seem to have lost everything in /system (except for an empty /system/bin)... / does seem to be writable but it does not persist reboots. Old favourites for partition information seem inconsistent: fdisk, df, mount and /proc/partitions.

Fdisk only sees one partition, presumably because it's got a gpt label that fdisk cannot understand:

~ # fdisk -l /dev/block/mmcblk0

Disk /dev/block/mmcblk0: 15.7 GB, 15758000128 bytes

1 heads, 16 sectors/track, 1923584 cylinders

Units = cylinders of 16 * 512 = 8192 bytes

Device Boot Start End Blocks Id System

/dev/block/mmcblk0p1 1 1923584 15388671+ ee EFI GPT

Partition 1 does not end on cylinder boundary​

Df only sees cache, external_sd and /efs:

# df -kh

Filesystem Size Used Available Use% Mounted on

tmpfs 416.5M 48.0K 416.4M 0% /dev

/dev/block/mmcblk0p8 1007.9M 17.3M 990.6M 2% /cache

/dev/block/mmcblk1p1 59.6G 39.2G 20.4G 66% /external_sd

/dev/block/mmcblk0p3 19.7M 9.2M 10.5M 47% /efs​

Mount confirms "df":

# mount

rootfs on / type rootfs (rw)

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)

/dev/block/mmcblk0p8 on /cache type ext4 (ro,seclabel,relatime,user_xattr,barrier=1,data=ordered)

/dev/block/mmcblk1p1 on /external_sd type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

/dev/block/mmcblk0p3 on /efs type ext4 (rw,seclabel,relatime,user_xattr,barrier=1,data=ordered)​

However, /proc/partitions contradicts these:

# cat /proc/partitions

major minor #blocks name

179 0 15388672 mmcblk0

179 1 4096 mmcblk0p1

179 2 4096 mmcblk0p2

179 3 20480 mmcblk0p3

179 4 8192 mmcblk0p4

179 5 8192 mmcblk0p5

179 6 8192 mmcblk0p6

179 7 32768 mmcblk0p7

179 8 1048576 mmcblk0p8

179 9 1572864 mmcblk0p9

179 10 573440 mmcblk0p10

179 11 8192 mmcblk0p11

179 12 12091392 mmcblk0p12

179 16 62521344 mmcblk1

179 17 62520320 mmcblk1p1​

Suggesting that the kernel sees all the devices and partitions.

Any advice hugely appreciated... I realise I may out of luck and just have to resign myself to the fact that, while I have a working device and SD card, the fact that the internal Nand memory is hosed means it's time to let go. Or maybe there's another way to breath life into the Nand ?

Any thoughts, the more technical the better, hugely appreciated.

Cheers,

Doug