[BRICK][TWRP][I9505]/system is 0mb in TWRP - Galaxy S 4 Q&A, Help & Troubleshooting

Yesterday I tried to install Imperium LL ROM (latest). It kept giving me errors about being unable to mount /system while installing (with Aroma). In the rom's thread I saw that someone had similar issues and he fixed it by deleting /dev/block/platform/msm_sdcc.2. I tried renaming it, but it just kept coming back. I the deleted it, rebooted to recovery and tried to install it again. The installer got stuck on formating /system (for about 5 minutes). I rebooted and tried to restore a nandroid backup. It also got stuck on formating /system. In TRWP log I saw 'Failed to mount /system (invalid argument). I went to Wipe->Advanced-> selected system-> Repair or change File System. It shows : Present: Yes; Removable: No; Size: 0MB; Used: 0MB; Free: 0MB; Backup Size: 0MB.
I have full access to recovery and download mode. Is there anything I can do to fix it, or do I have to send it for repair to the shop I bough it in (I have an insurance that covers any damage, even if I caused it)?

I would suggest trying to flash a stock firmware with Odin. Maybe flash it together with a PIT file too.

I flashed Stock, latest Lollipop firmware (without flashing PIT). It seemed to work fine. It did the usual "Optimizing apps" thing, then it rebooted. Right now it seems to be bootlooping. I'm going to try and flash TWRP and see what I can do from there.
EDIT: I flashed recovery and did a factory reset. When rebooting it asked if I want to root and I chose to do so. After about 10 minutes it booted up into the welcome screen (the one where you choose language, wifi etc.). I need to flash the latest modem and bootloader, and then install a ROM.
Thanks @Pwnycorn for help.

If you flash the phone with the latest stock firmware, the phone will be running the latest modem and bootloader.

Related

Partition damage? Not sure whats wrong...

Hey all,
I have an S4 i337m model. I've installed a custom ROM that is essentially a rooted stock ROM (I do not remember the exact build/version of the ROM). I realize having this info would be useful, but at the moment, I cannot access this info.
While running this ROM, everything was fine. Last week Friday, I attempted to install FoxHound 1.6. Had to play around with the installation options, but I got FoxHound to work. However, I need to get back on my old ROM as I needed some files that were deleted during the FoxHound install. So I wiped my phone, and restored my nandroid backup of my rooted stock ROM. again, everything was fine. No issues.
Here is where the problem is; after restoring my rooted stock ROM, I could boot into the phone and access the files needed. However, when I reboot/shut down phone, upon restarting/powering up, my phone is stuck at the 'Samsung Galaxy S4' logo right after power on. So, I boot into recovery (the latest version of TWRP) and I navigate to 'file manager' to take a look at my storage/files. And this is where I believe the issue to be; I see virtually no files at all. I can see many folders/partitions, but there are virtually no files anywhere (i.e. the system and data partitions are empty). I am assuming this is the reason why my phone doesn't boot past the Samsung Galaxy S4 logo. Now, when this happens, I wipe my phone again and restore my working nandroid backup. Everything works fine. I can get back into Android without issues. Until I reboot/power off my phone. Then this happens all over again.
I believe I may have damaged(?) the partition(s). When I installed FoxHound, I also installed an option during installation titled 'EXT4'. I know linux uses ext2/3/4 partition tables. Did I damage my storage/partition by installing EXT4 from FoxHound? Do I need to repartition my phone via Odin PIT file or something similar? Am I totally wrong with my analysis? Any help/advise/insight would be very welcomed.
Thanks
Additional info
Baseband: I337MVLUAMG1
Build number: JDQ39.I337MVLUAMG1
ROM: Rooted stock ROM 4.2.2 (with some bloatware removed)
While my phone was in the it's 'logo stuck' state, I entered into TWRP and selected the Wipe option, then Format Data. I must select 'Format Data' in order for my phone to work on it's next boot. Manually formatting System, Data, etc... will not allow my phone to boot up at next boot. And, my phone will only work on the next boot. If I power off/restart phone, it will get stuck at the logo again. So my phone is only good for 1 boot up after a wipe.
And, after I restore a working backup and boot into the phone, everything works until next power down/reboot. Once I power down/reboot phone, I must go into recovery since it will not boot into Android. When I get into TWRP, I see that my Internal Storage has 0MB free and I am unable to see any files. I can see folders/partitions, but there is nothing in any folder/partition. My external SD card shows nothing as well. My external SD card however is unaffected as all the data is still there once I get into Android and look around.
Also, I just restored a backup I had before I was having this issue. After restoring and rebooting, the same thing happens. I get stuck at the 'Samsung Galaxy S4' logo.
So I'm guessing there is some partition troubles here. Maybe I'm wrong, but I'm scratching my head as to the cause of this problem.
It could be some hardware issues too. I'd Odin back to stock and see if the problem persists. If it does its hardware.
jd1639 said:
It could be some hardware issues too. I'd Odin back to stock and see if the problem persists. If it does its hardware.
Click to expand...
Click to collapse
I thought the same thing. I'm downloading the stock ROM now and will give it a try.
One other thing I noticed during my last restore/fix attempt... After I perform a wipe -> Format Data (from TWRP), I notice that it reverts to my rooted stock ROM without me restoring anything. So, after I do a full wipe/format, and reboot my phone immediately after the full wipe/format, my phone will boot into the rooted stock ROM. I thought that wiping/formatting via TWRP totally cleans the internal storage of all data. So how can I be booting into any ROM after a wipe?
Unless I'm mistaken in my thinking and the full wipe/format option in TWRP just reverts back to the stock ROM I had installed prior to installing further custom ROMs?
If you wipe system and data there shouldn't be any rom it would boot. Don't try that though unless you have a nandroid because it shouldn't boot
What version of twrp ate you using?
Do not format data in twrp.
jd1639 said:
If you wipe system and data there shouldn't be any rom it would boot. Don't try that though unless you have a nandroid because it shouldn't boot
What version of twrp ate you using?
Click to expand...
Click to collapse
I hear ya... I have several nandroid backups. All work (minus this 'stuck at logo' issue I am having). I am using the newest TWRP version 2.6. It's very strange... after I perform a full wipe, I am able to boot into my rooted stock ROM that I flashed shortly after acquiring the phone. This was a bit over a month ago now. I do not know how this is possible.
xBeerdroiDx said:
Do not format data in twrp.
Click to expand...
Click to collapse
Why not?
_____________________________________________________________________
**Should I try using CWM instead?
Talabis said:
I hear ya... I have several nandroid backups. All work (minus this 'stuck at logo' issue I am having). I am using the newest TWRP version 2.6. It's very strange... after I perform a full wipe, I am able to boot into my rooted stock ROM that I flashed shortly after acquiring the phone. This was a bit over a month ago now. I do not know how this is possible.
Why not?
_____________________________________________________________________
**Should I try using CWM instead?
Click to expand...
Click to collapse
Use twrp 2.5.0.2 or cwm. The newer twrp has issues.
jd1639 said:
Use twrp 2.5.0.2 or cwm. The newer twrp has issues.
Click to expand...
Click to collapse
Is TWRP 2.5.0.0 ok to use?
Ok... It's really starting to look like my partition table has been damaged. Every time I flash a new ROM or restore a nandroid backup successfully, and then restart my phone, I get stuck at the S4 logo. Upon starting recovery, my internal storage reads 0MB free. It seems like my partition table is becoming corrupt after a reboot, or it has already been corrupted.
I tried flashing the stock ROM for my phone (I337MVLUAMDJ_I337MOYAAMDJ_I337MVLUAMDJ_HOME.tar is the one I used), but that didn't help at all. After installing this stock ROM, and I go into stock recovery, I get an error: E:failed to mount /data (invalid argument).
This really is looking like a partition problem. Is there some way to re-partition my phone? I remember a PIT file was used to partition my old Galaxy S i9000. Is there a PIT file for the S4 i337m?
I would also like to try CWM but I am having a hard time finding a ODIN flashable version.
I wouldn't mess with a pit file and I haven't seen one anyway. It's sounding more and more like your memory is bad. I'd keep it stock and see if you can get an exchange on the phone under warranty.
Further investigation has lead me to the culprit... sorta. It's my /data partition that is screwing everything up. If I format /data and then reboot, I can get into my phone. But if I reboot again, then my /data partition becomes corrupt and my phone hangs at the S4 logo. And then if I go into recovery, I can see that my internal storage is at 0MB free.
However, after formatting/restoring /data partition and rebooting into android successfully, everything works fine. If I reboot from this point and enter recovery, I am still able to see my /data partition and files. At this point, everything seems to be fine. Once I reboot out of recovery and let the phone boot into Android, I get stuck at the S4 logo and my /data partition screws up/becomes corrupt. It looks like my /data partition is only becoming corrupt after the 1st successful boot into Android. If I enter recovery after the 1st successful android load, I am still able to see all files and partitions. It is only trying to load android after the 1st boot that my /data partition becomes corrupt. Very strange...
So, I can always boot into my phone as long as I format my /data partition prior to loading Android. Anyone experience this before? Any ideas? I realize my memory may be damaged, but I'm leaving that as a last resort possibility since my phone was working fine up until I started installing FoxHound with the EXT4 option as well as installing 1 or 2 of the kernel's FoxHound provides. Namely Adam kernel is the one I tried.
All good... I think/hope
Well, I think I got the problem solved. After toying with this thing all day. It seems like TWRP 2.6 was the problem in some sense. Looks like TWRP 2.6 does not format the /data partition correctly. I had to get restore/install a working ROM, boot into my phone and install ClockworkMod Recovery via ROM Manager. I then used CWM to format /data. Once I did this, and loaded back into my phone, and went through the setup process since /data was formatted, everything was working fine. I just rebooted 5 times and shut down twice and my phone booted back up into android without issue.
So as one user in this thread had mentioned, formatting /data with TWRP 2.6 was the problem.
Hope this helps others avoid a similar issue.
Thanks everyone for all the help. It pointed me in the right direction.
Glad you got it fixed.
I'll be giving these steps a try, having somewhat of the same problem!
i've been having this exact same problem but with TWRP 2.5.0.2 since July. Its been driving me insane and I have not been able to find any one else having this issue until now. I think i might finally try CWM instead as a last measure before I finally give up!
Try TWRP 2.6.3.1 version. It works pretty well even though it's unofficial http://forum.xda-developers.com/showthread.php?t=2262996
Sent from my SAMSUNG-SGH-I337 using XDA Premium 4 mobile app

[S5 SM-G900F] Multiple Fatality: Soft Brick, No Baseband, Encryption Failed

Custom TW ROM Lollipop Galaxy S5 SM-G900F: multiple high-impact issues
In last 24hrs I managed to get away from several hard issues, so, I thought it might be good idea to share and start separate thread, as I found none to cover all that in the same time. It all started with no baseband - No SIM card error. For the starters no separate ODIN baseband flash turned out to help. One thing leading to another and I managed to soft brick the device. Trying this and that, I was finally struck with: Encryption failed, unable to complete encryption, reset phone to factory settings.
ODIN: reflash Stock: no ROM from SamFirmware for my country and carrier managed to boot up device, although full flash was successful. Turning on 'Nand Erase All' and 'Phone Bootloader Update' haven't helped, either.
ODIN: reflash PIT: no PIT file flashing has solved the problem
TWRP Recovery: Data/factory reset: no go
TWRP Recovery: /data, /system, /cache: no go - but there was this message that /data cannot be mounted and no crypto data can be found.
TWRP Recovery: Flash CyanogenMod: Success! - it is great ROM indeed, but there is no good camera for AOSP, so let's move on.
TWRP Recovery: Flash Custom TW ROM: Struck with looped encryption failed error.
TWRP Recovery: Wipe > Advanced Wipe > Repair or Change File System: /data was somehow, somewhere formatted as f2fs - changed it to ext4. Flash TW ROM, wait couple of minutes: SUCCESS!. (TWRP 3.0.1.0)
Hey there
Hello, i have the same "encryption failed" error on my s5. It has been a paper weight for a month now.
It started a few days after i updated to lollypop. I have never tried to mod the phone in the slightest.
Any help would be greatly appreciated!

Unable to mount /system in S4 I9505 - jfltexx

I flashed the root, then a twrp 3.0.2.0 recovery with odin and than went to recovery to make wipes. Had an issue with formatting cache (it was never ending process, more than 20 minutes) I lost my patience and removec the battery, came to twrp recovery again, enabled -rf fix in settings. Wiped everything and then came to install, chose the ROM and proceeded - then an error jumped, that the system was not mounted.
I tried almost everything, but system wont mount with twrp.
Is my only option to get back to official stock?
Did you try TWRP 2.8.7?

Problems flashing stock rom

This is all new to me and I've read everything I could find.
I successfully rooted my e4 with magisk. Then I wanted to flash the stock rom to get it back to out of the box condition.
I had to flash the .bat file because rsdlite will not recognize my phone no matter what I do. It got stuck on a bad key/erasing bootloop. I was able to flash twrp, format data/unencrpyt, and flash no verity and it booted just fine, unrooted. I rerooted and tried to sign into Google account and Google play services didn't work. I downloaded and installed several versions, deleted data and cache for Google plays services, store, framework, even deleted the hosts.txt file and nothing. So I decided to flash stock and start fresh.
Following the steps I had done previously that worked no longer work. When I format data/unencrpyt I get the failed to mount /data blah blah crypto footer, failed to mount /cache. So I tried to reformat those individually by changing their format to f2fs and back to ext4 and vise versa and reformated and no errors. Flashes no verity thinking everything should go smoothly now and I'm stuck in a twrp recovery loop. I'm just lost. I've spent hours and hours and hours reading and fiddling and I'm at the point where I have to ask for help. So...
Help!

[Q] [HELP] Odin/TWRP Flash successful, BUT not changing anything after reboot

TLDR : I Cannot MODIFY ANYTHING IN SYSTEM or USERDATA(i.e. internal storage) partitions. Files Deleted via twrp in System/internal storage comeback after reboot and new files added from computer vanish after reboot. Also NOW, different flashes are successful through both methods via -
1. twrp recovery-(Boot/recovery/CustomROMs flashes) and
2. ODIN-(boot/recovery/Stock ROM flashes)
but again dont change anything after reboot (previously both methods worked, so no issue with twrp or odin according to me). So, Whole storage (System+Internal Storage) is intact after Reboot as it is. Now I feel it has something to do with magisk. I can see exact file names both in internal storage and /system and do delete, move, rename i.e. any operations in twrp so i guess storage is not encrypted. I can boot into system for hardly 10-15 seconds after that it bootloops again, so i cannot do anything there. Only options to me is twrp recovery or odin, both are not helping for now.
--------------------------------- DETAILED EXPLANATION : ------------------------------------
[PROBLEM 1] DELETION:
Anything deleted via TWRP recovery in system partition or "EVEN in sdcard, i.e. internal storage" deletes successfully in twrp, without any error but comes back in the same state after the reboot. When i delete error causing file or folder via TWRP file manager, it gets deleted, and if you check again it's not there wherever it was present, but just after reboot every file and folder comes back to previous state like if nothing was done. This is true for any file present in any of the partitions. Newly inserted file in internal storage vanishes after reboot, and deleted file comes back after reboot - true for any partition. Status quo maintained !!
[PROBLEM 2] FLASHING:
To solve above problem, i thought it might be an issue with Magisk or the new twrp recovery, so i tried flashing Magisk Uninstaller zip in twrp, which again flashes successfully, SECONDLY- tried zackptg-(dmverity,forceencrypt Disabler) zip file, that also flashes successfully(i thought might be an issue of dmverity or encryption), and THIRD thing i tried flashing older twrp version recovery, that also flashes successfully but after reboot same currently installed twrp boots, not the newly "successfully flashed" older version. So i cannot change twrp-(tried both recovery.img flash in (1) twrp itself and (2) also through ODIN) - both returns flash successful and pass(in Green). FOURTH, tried dirty flash both (1) other ROM and (2) SAME ROM on top of current ROM- everything returns successful but after reboot boots the current erroneous ROM that i want to change. FIFTH, tried Clean Flashing i.e. wiped everything (selected 1. dalvik cache, 2. data, 3. cache, 4. system, 5. Internal Storage in wipe section) and also tried Factory RESET and FORMAT DATA option and after all this flashed Custom ROM zip file only (no gapps or magisk flash), but every wipe operation returns successful and ROM flash also successful, but when reboot into system again that bootlooping erroneous ROM that was present before all of these "successfully done" operations.
[PROBLEM 3] ODIN FLASH:
As all above failed, i thought flashing STOCK ROM through ODIN is my last resort. I did (1) Stock recovery flash through Odin- it was green pass (successful), but when booted returned that same twrp recovery not stock recovery. Tried (2) flashing Stock BOOT.img flash through ODIN, again it was successful but actual boot resulted the same Magisk Patched Boot.img. Third (3) tried flashing whole STOCK FIRMWARE - Official latest Stock firmware that was extracted from Samsung Smart Switch, with default options turned on in Odin, flash was again green-pass(successful) but auto reboot after successful flash through ODIN resulted same old erroneous ROM booting up like a VAMPIRE (I'm not dead, I'm Alive!!)... Fourth (4) tried flashing Stock Firmwave of step 3 with NAND ERASE and RE-PARTITION options turned on by inserting pit file to do BANG BANG, nuking my phone with these options that many people on internet advise not to use, screenshot attached below( it took 42 minutes to complete ), again using these options nand erase and re-partition also resulted successful(green-pass) and resulting that same untouched state as it was before.. Boots into twrp recovery not the stock rom or stock recovery with that same old erroneous ROM present in system with data partition intact. (Tried using different ODIN versions, different USB ports on my laptop, different non-official firmwares(but these non-official firmwares of SM-G530H resulted in some errors in ODIN, i.e. it was not green pass like that of official firmware, but resulted RED FAIL.))
[PROBLEM 4] SYSTEM_ROOT Created:
This i saw for the first time i guess, in my phone, and maybe the cause of this whole problem. Now my root directory in twrp '/ ' contains /system_root along with /system, /data, /cache. One more thing /system_root contains system folder ,i.e. /system_root/system results same things as /system . When checked in twrp>wipe section> Repair system> There System Mount Point is shown as : /system_root instead of previously used to be "/system" normal directory when /system_root was not present at all.
Another thing /system_root contains files like default.prop , init files, sepolicy which are also present in root directory ' / ' . This whole /system_root should not have existed at all when /system exists. Maybe /system_root or the init files or other thing present inside /system_root are preventing all the changes - deletion , flashing changes etc. described in this post and maybe this folder was created by step(3) flashing procedure below , i.e. due to magisk. Also formatting system in twrp>wipe>system returns successful msg but nothing is deleted when checked in twrp file manager or twrp>Backup (system partition backup size shows 1456 mb even after formating)
[OTHER THINGS I TRIED] to solve this -
- Deleting twrp folder to make it to default state, again it's successfull deleted but doesn't loads default configuration after reboot due to PROBLEM 1 above as deletion reverts back after reboot
- Fixing contexts in twrp
- reboot disemmcwp
- mount -o remount,rw /system commands in twrp terminal (again to mention every command that is possible to enter runs without any error, hence successful but problem persists even after that )
- flashing stock boot.img and recovery.img (both successful no changes observed after reboot, but after stock boot or recovery.img flash, if you flash magisk uninstaller zip it still says "magisk patched image detected", and next thing written after it is " ! (Exclamation mark) Boot image backup unavailable" , then "Restoring ramdisk with internal backup" again magisk uninstaller also returns successful. after reboot again runing uninstaller detects magisk again. and boots twrp only instead of stock recovery
- repair, resize system partition in twrp>wipe section results Twrp error 1 (might be due to that /system_root folder that contains now /system which is also present in ' / ' root
- Changing "system partition" file-system with all 6 options returns successful but filesystem stays ext4 only when checked again.
WHAT IS WORKING-
Odin is working. - i once flashed my first twrp recovery on this device through the same version
TWRP is working - Although this is new twrp version 3.6.1_9-0 that i flashed just few time before all this catastrophe happened (maybe it might be the cause or it may be magisk)
Current Configuration:
Device: Samsung Galaxy Grand Prime
Model: SM-G530H (fortuna3g)
ROM: [STABLE][10] LineageOS 17.1 GO by DarkDroidDev from xda
GApps: Customised OpenGapps package (this caused erroneous bootlooping ROM) - i can boot into ROM but it is very lagging, and reboots again after some time, ranging from 10-20 seconds to max 3 minutes. Launcher is not working. And Keyboard is crashing. I can go into settings to change something but change doesn't persists after reboot
Magisk: Magisk 23.0
What was my FLASH PROCEDURES before this happened-
- Cleaned dalvikcache, data, cache, system
- After this, Data and Cache showed 0mb in Backup option in twrp, system showed 2mb containing only usr folder, boot showed 13mb
- (1) Cleaned Flashed above ROM
- (2) Customized OpenGapps flash
- (3) Magisk Patched Boot.img flash - - (not magisk.zip installer, its magisk-patched-boot.img flash through twrp only)
- (4) Dalvik Cache Wipe
- Booted into System.
I was actually testing the customised OpenGapps package,
Before this flashed customised package 10-20 times. i was editing, flashing, seeing the changes... > then again editing, flashing. So this was not the first time.
If any error occured, like launcher not working, i again booted into twrp wiped system data or deleted particular launcher file in twrp, all worked, changes were successful then i again continued my testing.. editing packages > flashing > seeing the changes by booting into actual rom.
But this whole case happened during the iteration of my testing when i introduced Gboard apk, downloaded from Play Store from fortuna3g(this device), into the Custom Gapps Package.
So, the cause of all this according to my knowledge where i doubt maybe one of the following-
(1) - That Keyboard apk installation as system app (most probably permissions problem, as apk was fine as tested before on this device and resulted in keyboard related folders created in that /system/usr folder which always contained only one folder, but only this time contained this keyboard related stuff there)
(2) - That magisk-patched-boot.img flashing procedure, step(3) above, just after openGapps flash "without booting into system first" - this was done first time in my testing iterations, so might be incorrect procedure
(3) - Due to step (3), issue might be related to magisk related stuff - dm-verity, Force encryption
(4) - Creation of /system_root folder in root directory '/ ' maybe due to step (3), there used to be only /system there before
(5) - Hardware Problem, maybe that's why all those successful twrp and ODIN flashes not doing anything
Please suggest something that i have not tried and could solve this PROBLEM of NOT BEING ABLE TO CHANGE ANYTHING ON SYSTEM or USERDATA partition.
I know people here know a lot more than me, and can help me with their valuable suggestions and solutions, if any.
Thanks.
I found one xda thread almost with same issue as mine titled -
[Q] Weirdest problem - flashing anythin thru ODIN does not change anything in my S4​But no working solution there also
LinhBT said:
Need to know exactly if it's Snap or not. If it is, then there're 2 options you can try.
1. Ask some one have the same device model as you, do a ROM dump ( you can google for more detail ). Once you got that, I can share with you the tool needed for restore your device from that dump.
2. Try find your device's Factory Images ( similar to Fastboot ROM, but a little different ), and an authenticated prog of your SoC ( this I can share too if you choose this option ) then boot your device into EDL mode by using fastboot2EDL script ( on Git, you can google too ) then use QFIL ( one tool in QPST Tools by Qualcomm ) and force flash the images into the device.
So far as my experience and understanding, there're only these 2 solutions to fix your device ( if it's Snap powered ).
Click to expand...
Click to collapse
Hi mate, My phone is Snapdragon powered..
My problem is almost similar.. But not exactly.. After almost 2 months I am not able to find a solution.. But after this period of researching and googling about things related to my problem.. I feel now, either any one of the following is the cause of problem:
1. Emmc is stuck or locked in read-only mode (Can move files from pc , delete already present files anywhere in any directory, but all changes vanish after reboot... all file and directory structure remain intact- moved files from pc gets deleted.. and deleted files which were already present come back after reboot )
2. Corrupted /data and /cache partition, as e2fsck in twrp terminal results shows "filesystem still has errors" and "e2fsck: unable to set superblock flags on /dev/block/mmcblk0p** ) in both these file system (I think they are preventing flashing procedures- Odin stock firmware flashes and twrp custom ROM flashes both are successful, but after reboot no changes can be seen... - Even Recovery.img and boot.img flashes don't seem to work even both are shown successfully flashed in twrp) After reboot current version twrp boots again instead of newly flashed different version recovery.img ... same with boot.img even after running magisk uninstaller zip files.. running uninstall.zip 2nd or 3rd time also shows magisk patched image detected in log which should be removed in 1st iteration itself..
3. Might be magisk is preventing these changes to be made.. or It might be the /System_root creation as mountpoint for system partition which used to be previously /system normally. This might be the superblock creation which not used to be there. You can see my attachments in my thread to see my directory structure of system_root and my download mode picture
My Samsung's twrp and Download Mode seems to be working but no changes made by them even after successful operations by both.
Can you suggest anything @LinhBT ?

Categories

Resources