Stuck in boot-loop (Broken partition / filesystem?) My Samsung S3 (rooted, running LineageOS) is "soft-bricked":


Stuck in Boot-loop with Samsung Logo
I can still boot into 'ODIN' download mode 
I can still boot into 'TWRP' recovery mode


On launch, the TWRP logs show that something is gravely wrong with the file-system:

Failed to mount '/cache' (Invalid argument)
E:primary block device '/dev/block/mmcblk0p12' for mount point '/data' is not present!
Failed to mount '/data' (Invalid argument)
Unable to recreate /data/media folder
Updating partition details...
Failed to mount '/efs' (Invalid argument)
Failed to mount '/cache' (Invalid argument)
Failed to mount '/system' (Invalid argument)
Failed to mount '/data' (Invalid argument)
Failed to mount '/preload' (Invalid argument)
...done
Unable to mount storage
Failed to mount '/data' (Invalid argument)
Fill SELinux support is present.
Unable to mount /data/media/TWRP/.twrps
MTP Enabled


I've re-flashed the TWRP image, but the problem persists.

I've even tried an advanced-wipe of EVERYTHING, but that fails, too:

Unable to wipe Cache.
Unable to wipe /cache.
Updating partition details...
Failed to mount '/efs' (Invalid argument)
Failed to mount '/cache' (Invalid argument)
Failed to mount '/system' (Invalid argument)
Failed to mount '/data' (Invalid argument)
Failed to mount '/preload' (Invalid argument)
...done
Unable to mount storage


For some reason I can't mount ANYTHING. 

I can connect over ADB, so I tried flashing a custom ROM:

Installing zip file '/sdcard/lineage-14.1..zip'
...
could not detect filesystem for /dev/block/mmcblk0p9, assuming ext4
mount: failed to mount /dev/block/mmcblk0p9 at /
system: No such file or directory
unmount of system/ failed: no such volume

could not detect filesystem for /dev/block/mmcblk0p12, assuming f2fs
mount: failed to mount /dev/block/mmcblk0p12 at /
data: No such file or directory
unmount of data/ failed: no such volume

Patching system image unconditionally...
E1001: Failed to update system image.
Updater process ended with ERROR: 7

Error installing zip file '/sdcard/lineage-14.1..zip'


Do I need to put my phone in the bin?

(P.s. Apologies if there are typos in the above logs, they are manually typed as adb logcat didn't work..!)
Try flashing Stock ROM via ODIN as it won't require recovery and will generate proper system, recovery and other partitions. After that, as for errors, I suggest you to try flashing a old version of recovery ( In case you are flashing latest).