[Q] HELP stuck in a serious bootloop - HTC Sensation

My htc was off for one month because i went to a trip and did not take it with me. when i came back i turned it on and boom! bootloop! came from nowhere.
I had the vipers rom on it so i tried to update to the newest vipers rom but still bootloop. i tried to install different rom but nothing help,
At the end i installed RUU and still i'm in bootloop! please help me

amitshkuri said:
My htc was off for one month because i went to a trip and did not take it with me. when i came back i turned it on and boom! bootloop! came from nowhere.
I had the vipers rom on it so i tried to update to the newest vipers rom but still bootloop. i tried to install different rom but nothing help,
At the end i installed RUU and still i'm in bootloop! please help me
Click to expand...
Click to collapse
can you boot into bootloader?
if yes post all the on screen details

rzr86 said:
can you boot into bootloader?
if yes post all the on screen details
Click to expand...
Click to collapse
yes i can get into bootloader but in recovery i get error.
***LOCKED***
PYRAMID PVT SHIP S-OFF RL
HBOOT-1.27.0000
RADIO-11.24A.3504.31_M
OpenADSP-v05.6.0.2226.00.0418
eMMC-boot
JAN 13 2012, 17:33:34
HBOOT
FASTBOOT
RECOVERY
FACTORY RESET
SIMLOCK
IMAGE CRC

amitshkuri said:
yes i can get into bootloader but in recovery i get error.
***LOCKED***
PYRAMID PVT SHIP S-OFF RL
HBOOT-1.27.0000
RADIO-11.24A.3504.31_M
OpenADSP-v05.6.0.2226.00.0418
eMMC-boot
JAN 13 2012, 17:33:34
HBOOT
FASTBOOT
RECOVERY
FACTORY RESET
SIMLOCK
IMAGE CRC
Click to expand...
Click to collapse
from this guide it has 3 options to flash 4ext recovery(see step 1)
http://forum.xda-developers.com/showthread.php?t=1472298
after that go into recovery
format all partitions except sdcard
flash the rom
see if it boots

rzr86 said:
from this guide it has 3 options to flash 4ext recovery(see step 1)
http://forum.xda-developers.com/showthread.php?t=1472298
after that go into recovery
format all partitions except sdcard
flash the rom
see if it boots
Click to expand...
Click to collapse
i flashed 4ext recovery and flashed 3.33 firmware and flashed ARHD 7.2 (i did full wipe for all patitions)
still in bootloop but now it pass the HTC logo and the quitly brilliant logo and start the beats animation then it restart.

HI
GREETINGS
according to your bootloader you have stock htc hboot and
stock htc hboot does not go well with soff
flash the hboot in my attachment
to flash the hboot:-
1 put the file in root of sd card
2 reboot into bootloader
3 the bootloader will scan the file, follow on screen instruction
4 reboot back in to bootloader and make a clean installation of the rom as suggested by "RZR86"

shrex said:
HI
GREETINGS
according to your bootloader you have stock htc hboot and
stock htc hboot does not go well with soff
flash the hboot in my attachment
to flash the hboot:-
1 put the file in root of sd card
2 reboot into bootloader
3 the bootloader will scan the file, follow on screen instruction
4 reboot back in to bootloader and make a clean installation of the rom as suggested by "RZR86"
Click to expand...
Click to collapse
I flashed the new hboot and flashed the recovery again and made a clean installation including format for all partitions and still i stuck in this bootloop! what can i do more?

amitshkuri said:
what can i do more?
Click to expand...
Click to collapse
Absolutely loads of stuff. First thing is to get the logs.
Flash a rom with adb set in the default.prop in the boot image ramdisk ( CM for example )
while the device is bootlooping run
Code:
adb shell dmesg
which gives the kernel messages then you can run
Code:
adb logcat -b system -b radio -b events -b main
this will run forever, you'll notice it repeating the same messages over and over, look out for lines that start with "E/"
they're errors being reported and will lead you to the cause of you're bootloop
If either of these two fail then reboot into recovery and run
Code:
adb shell cat /dev/last_kmsg
This is a saved copy of dmsg from the last session.
Once you've got the logs you can easily pinpoint the cause of the problem all you got is read them
PROTIP: Look for the word error or fail or something similar

ok so that's all the errors i found while booting:
E/QC-NETMGR-LIB( 165): couldn't open file /sys/module/f_rmnet/parameters/rmnet_ctl_ch
E/QC-NETMGR-LIB( 165): couldn't open /sys/module/rmnet/parameters/rmnet_ctl_ch
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/DxDrmNexPlayerIntegrator( 169): ** Discretix Server loaded config file - result=0 **
E/DxDrmNexPlayerIntegrator( 169): ** Discretix SignalsListener Thread is starting **
E/DxSecureClock( 169): ** Discretix Clock Monitor is starting **
E/msm8660.gralloc( 153): DEBUG_CALC_FPS: 0
E/msm8660.gralloc( 153): period: 10
E/msm8660.gralloc( 153): ignorethresh_us: 500000
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 0
E/SurfaceFlinger( 153): composer device failed to initialize (Invalid argument)
E/rmt_storage( 120): Unable to open /boot/modem_fsg
E/rmt_storage( 120): Invalid rmt_storage client
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 1
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 2
E/HtcBootAnimation( 225): Could not find width.
E/HtcBootAnimation( 225): Could not find height.
E/HtcBootAnimation( 225): Could not find framerate.
E/HtcBootAnimation( 225): Could not find part1.
E/HtcBootAnimation( 225): Could not find part2.
E/HtcBootAnimation( 225): Could not find part3.
E/HtcBootAnimation( 225): sqlite3_open error, sqlite result: 14, errno: 2, No such file or directory
E/QC-DIAG_LSM( 156):
E/QC-DIAG_LSM( 156): Diag_LSM: Diag_LSM_Init: Failed to open handle to diag driver, error = 13
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 3
E/ExtendedExtractor( 156): Failed to open MM_PARSER_LIB, dlerror = Cannot load library: reloc_library[1290]: 156
E/AudioPolicyManagerBase( 156): Could not open support_receiver()
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 4
And this came at the second of crash:
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 5
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 6
E/QC-NETMGR-LIB( 165): ifioctl: close port failed: (9)Bad file number
E/QC-NETMGR-LIB( 165): ifioctl: open port failed: (19)No such device
E/QC-NETMGR-LIB( 165): netmgr_kif_ifioctl_open_port() failed for rmnet0 on attempt 7
am i in trouble?

amitshkuri said:
am i in trouble?
Click to expand...
Click to collapse
It's difficult to say with ONLY the errors LOL. You've just removed all the context of what was going on around leading upto it. Can you post the rest of them, not here though, pastebin or somewhere like that.
Also dmesg output would be pretty useful to see if all the drivers are install correctly.
At first glance, You seem to be missing some vital libraries. files, to say anything more at this point would just be guessing? but yeah, dmesg and a full logcat.
Actually to save a back and forth you can run the following commands
Code:
adb root
adb shell stop
adb shell dumpstate > state.txt
adb shell dumpsys > sys.txt
Don't know what you know so I'll explain what this does.
adb root , restarts adb as the root user
adb shell stop, this stops the servicemanager and it's child services , basically stop loading android. If you have a boot animation you should see it stop, this also stops device from rebooting as the next commands take some time to run.
dumpstate and dumpsys will dump your entire device contents to state.txt and sys.txt on your desktop machine. you won't see any output and they do take some time to run so please be patient. As you've fully formatted it I wouldn't expect any personal data to be present in those files but may contain device specific info please have a look before posting. searching the for things like your email address, name, IMEI, serial no's etc should help.
Then zip the files and attach them to this thread. Like I mentioned these files contain everything about the Device and the current state and will give us everything we need to figure out whats wrong.
If you're not comfortable "doing the dump!" ( sounds like a song ) then option 1 of logcat and dmesg should do I'll probably end up asking for more but meh!

ok i tried but
Code:
adb root
adb shell stop
didn't help and the boot restart again and again so i cannot write the rest of codes you gave me.
i attached a rar file with the context of logcat and dmesg.

amitshkuri said:
ok i tried but
Code:
adb root
adb shell stop
didn't help and the boot restart again and again so i cannot write the rest of codes you gave me.
i attached a rar file with the context of logcat and dmesg.
Click to expand...
Click to collapse
That's fine dmesg tells all in this case, It's a bit weird. you system partition seem to be at fault. these messages
Code:
<6>[ 2.457794] EXT4-fs (mmcblk0p22): INFO: recovery required on readonly filesystem
<6>[ 2.457977] EXT4-fs (mmcblk0p22): write access will be enabled during recovery
<6>[ 2.466827] EXT4-fs (mmcblk0p22): barriers disabled
<6>[ 2.468963] EXT4-fs (mmcblk0p22): recovery complete
<6>[ 2.476013] EXT4-fs (mmcblk0p22): mounted filesystem with writeback data mode. Opts: barrier=0
which is just information but a couple of lines down is this
Code:
<6>[ 3.588012] EXT4-fs (mmcblk0p22): re-mounted. Opts: noauto_da_alloc,barrier=0
Logcat also has this related message
Code:
I//system/xbin/busybox( 107): tune2fs 1.41.12 (17-May-2010)
I//system/xbin/busybox( 107): tune2fs 1.41.12 (17-May-2010)
I//system/xbin/busybox( 107): The needs_recovery flag is set. Please run e2fsck before clearing
what it looks like is happening is the kernel has remounted your /system partition to try to set it up for recovery while the device is booting make system files unavailable in the process, which ties up to the messages about missing libraries from earlier on. it may well be easily solved simply by following the instruction and running e2fsck on /dev/block/mmcblk0p22, it worth a shot I'd say.
reboot into recovery and run
Code:
adb shell e2fsck /dev/block/mmcblk0p22
you may also have to remove the need_recovery flag from the partition... I don't know how to do that off the top of my head and I have to go out for a bit.... Google may be your friend
More Soon!

own diBeco
trevd said:
That's fine dmesg tells all in this case, It's a bit weird. you system partition seem to be at fault. these messages
Code:
<6>[ 2.457794] EXT4-fs (mmcblk0p22): INFO: recovery required on readonly filesystem
<6>[ 2.457977] EXT4-fs (mmcblk0p22): write access will be enabled during recovery
<6>[ 2.466827] EXT4-fs (mmcblk0p22): barriers disabled
<6>[ 2.468963] EXT4-fs (mmcblk0p22): recovery complete
<6>[ 2.476013] EXT4-fs (mmcblk0p22): mounted filesystem with writeback data mode. Opts: barrier=0
which is just information but a couple of lines down is this
Code:
<6>[ 3.588012] EXT4-fs (mmcblk0p22): re-mounted. Opts: noauto_da_alloc,barrier=0
Logcat also has this related message
Code:
I//system/xbin/busybox( 107): tune2fs 1.41.12 (17-May-2010)
I//system/xbin/busybox( 107): tune2fs 1.41.12 (17-May-2010)
I//system/xbin/busybox( 107): The needs_recovery flag is set. Please run e2fsck before clearing
what it looks like is happening is the kernel has remounted your /system partition to try to set it up for recovery while the device is booting make system files unavailable in the process, which ties up to the messages about missing libraries from earlier on. it may well be easily solved simply by following the instruction and running e2fsck on /dev/block/mmcblk0p22, it worth a shot I'd say.
reboot into recovery and run
Code:
adb shell e2fsck /dev/block/mmcblk0p22
you may also have to remove the need_recovery flag from the partition... I don't know how to do that off the top of my head and I have to go out for a bit.... Google may be your friend
More Soon!
Click to expand...
Click to collapse
The shell e2fsck did not help, still in bootloop.
i searched in google about the need_recovery flag and i found one post that explain how to do this but in ubuntu linux
the command " debugfs " mentioned there, i dont really understand what to do.

amitshkuri said:
The shell e2fsck did not help, still in bootloop.
i searched in google about the need_recovery flag and i found one post that explain how to do this but in ubuntu linux
the command " debugfs " mentioned there, i dont really understand what to do.
Click to expand...
Click to collapse
hi again.
After reading some more e2fsck need some extra options. apologises for that
Also as is usually the case with these things you're not the first person to have this problem. A quick xda search for "The needs_recovery flag is set" brings up this post
I've just tested it because my cache partition has the needs_recovery flag set so I ran the commands in that post in recovery and it did clear the needs_recovery flag. so in your case you need to boot into recovery make sure /system is NOT mount which should be the default state and run the following commands
Code:
adb shell
tune2fs -l /dev/block/mmcblk0p22 | grep features
this command get the list of filesystem features it should look something like this ( order may be different )
Code:
Filesystem features: has_journal resize_inode filetype needs_recovery extent sparse_super large_file
Next we'll run e2fsck with the right command this time LOL
Code:
e2fsck -f /dev/block/mmcblk0p22
After that we can remove the old journal with tune2fs
Code:
tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p22
This should remove both the has_journal and needs_recovery flags from the feature list. Seeing as has_journal was set we'll turn it back on
Code:
tune2fs -O has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p22
Note the caret symbol ( ^ ) which is the difference between the above to commands. This controls whether a feature should be added or removed
Finally check the feature list again
Code:
tune2fs -l /dev/block/mmcblk0p22 | grep features
It should now look like this or something similar, If it still has needs_recovery in the list then something is wrong
Code:
Filesystem features: has_journal resize_inode filetype extent sparse_super large_file
All we need to do now is pray to the ghost of steve jobs and say the magic words
Code:
reboot
And hopefully we might have a win for you! :good:

when i write this line: e2fsck -f /dev/block/mmcblk0p22
i get this: Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found. Fix<y>?
if i press "y" i get this: Inode 13765 is in use, but has dtime set. Fix<y>?
and more and more and more questions and cant continue with the next lines you gave me.
what to do?

amitshkuri said:
when i write this line: e2fsck -f /dev/block/mmcblk0p22
i get this: Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found. Fix<y>?
if i press "y" i get this: Inode 13765 is in use, but has dtime set. Fix<y>?
and more and more and more questions and cant continue with the next lines you gave me.
what to do?
Click to expand...
Click to collapse
e2fsck -f -y /dev/block/mmcblk0p22
That will answer yes to all questions!

i did all exactly and still in a bootloop..
i got Filesystem features: has_journal resize_inode filetype extent sparse_super large_file
without the needs recovery, all went well.
is there hope?

amitshkuri said:
i did all exactly and still in a bootloop..
i got Filesystem features: has_journal resize_inode filetype extent sparse_super large_file
without the needs recovery, all went well.
is there hope?
Click to expand...
Click to collapse
Time to rinse and repeat, Grab the dmesg and the logcat and lets see what it's saying now? Also Have you tried reflashing the rom, it's possible the tune2fs has deleted some files but we can only find out by looking at the logs!

i tried now to reflashed and still bootloop :/
i attached the new demsg and logcat.
thank you for all the help!

amitshkuri said:
i tried now to reflashed and still bootloop :/
i attached the new demsg and logcat.
thank you for all the help!
Click to expand...
Click to collapse
Not a problem on the help. At least you bought an interesting problem to solve It's not your normal bootloop cause.
hmmm , It seems to have gone back to needs recovery.... Ok. Can you run the command from earlier but this time do not re-add the journal feature, so these commands
Code:
tune2fs -l /dev/block/mmcblk0p22 | grep features
e2fsck -f -y -v /dev/block/mmcblk0p22
tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p22
tune2fs -l /dev/block/mmcblk0p22 | grep features
#EDIT Mount as read only to mark it ready for mounting
mount -ro -text4 /dev/block/mmcblk0p22 /system
reboot
can you copy the output of these commands and post them up, I'm just curious to see what its runnning.
Do you know how to make your boot image insecure and how to mount /system with rw by default?
If not can you send me the boot image you're using an i'll fix it up.
The plan is to attempt the fs repair and remove journaling which from what I understand can be responsible for triggering the needs_recovery. should that not work, the kernel will try running recovery on the fs at boot time but this time it won't need to remount the /system partition because it will be already mounted as rw ... that's the theory at least.
If it fails send the logs and we'll have a look a some other options depending on the log out. But I wouldn't be worried there's still a couple of more things we can leverage to fixup the system partition.

Related

Flashable Filesystem Check and Repair Tool

This flashable script will try to check and fix filesystem errors in your ext and fat32 partitions. The repair on fat32 may not be robust, but at least you will be alerted to any potential issues and can then run a dosfsck/chkdsk to fix issues,
This was created for my SuperNova Rom which uses Data2sd, but can be used for any Rom which uses an ext4 partition.
Potential candidates are phones with new issues of Force closes appearing, which usually signify a partition corruption..
Report on the file system check and repair will be output to /sdcard/repairlog.txt
This could be a "must-have" tool for every sdcard.
[*]Version History
FixFS 21-Sept-11
Initial script
FixFS 0.2 22-Sept-11
More checkpoints in logic
Verbose output
Any followups....
Nice one. If I had a partition to check, I'd definitely use this!
rootSU said:
Nice one. If I had a partition to check, I'd definitely use this!
Click to expand...
Click to collapse
Ha ha..
===================================
DROIDZONE'S FILESYSTEM FIXER SCRIPT
===================================
Script started at Thu Sep 22 00:36:27 GMT 2011
Ext4 file system found...
e2fsck running
One or more errors were found in your ext4 partition
e2fsck has encountered technical errors and cannot continue. Script will ABORT
Sdcard found..
Attempting to unmount sdcard
DosFsck running...
One or more errors were found in your Fat32 partition
dosfsck has encountered technical errors and cannot continue. Script will ABORT
Script has completed operations
-----
Above is my result of your awsome tool(thank you so much), seems some errors occured or found problems on my sd, but not fixed during the patch's on.
Would you give me a tip for the next step?
Sent from my HTC Desire using XDA App
You will have to do a manual e2fsck from the shell, since that usually means it is waiting for user intervention due to some errors. Though the automatic options I specified should correct minor issues, some seem to still need intervention
Sent from my HTC Desire using Tapatalk
nice work as per usual matey
ran it once through ROM Manager and your screen in recovery was only visible for a split second, so I checked the repairlog and read this:
===================================
DROIDZONE'S FILESYSTEM FIXER SCRIPT
===================================
Script started at Thu Sep 22 00:43:51 GMT 2011
Ext4 file system found...
e2fsck running
One or more errors were found in your ext4 partition
e2fsck has encountered technical errors and cannot continue. Script will ABORT
Sdcard found..
Attempting to unmount sdcard
DosFsck running...
One or more errors were found in your Fat32 partition
dosfsck has encountered technical errors and cannot continue. Script will ABORT
Script has completed operations
===================================
When I got home I checked the SD card through windows (no errors) then your script through Max's 4EXT app and no split second reading this time, it read:
===================================
DROIDZONE'S FILESYSTEM FIXER SCRIPT
===================================
Script started at Thu Sep 22 04:57:43 GMT 2011
Ext4 file system found...
e2fsck running
Your ext4 file system was checked and was clean..No repair was necessary.
Sdcard found..
Attempting to unmount sdcard
DosFsck running...
Your Fat32 file system was checked and was clean..No repair was necessary.
Script has completed operations
So a very big thank you to you and Max
Great tool! Thanks very much, have been looking for something like this for ages.
Hi Droidzone,
something goes wrong for me, i explain it with log below:
recovery.log
Code:
-- Installing: /sdcard/FixFS.zip
mtd: successfully wrote block at 0
I:Set boot command "boot-recovery"
Finding update package...
I:Update location: /sdcard/FixFS.zip
Opening update package...
Installing update...
about to run program [/tmp/pre.sh] with 1 args
===================================
DROIDZONE'S FILESYSTEM FIXER SCRIPT
===================================
Script started at Thu Sep 22 10:38:42 GMT 2011
Ext4 file system found...
e2fsck running
/tmp/pre.sh: line 56: /tmp/e2fsck: not found
One or more errors were found in your ext4 partition
e2fsck has encountered technical errors and cannot continue. Script will ABORT
Sdcard found..
Attempting to unmount sdcard
umount: can't umount /sdcard: Device or resource busy
DosFsck running...
/tmp/pre.sh: line 86: /tmp/fsck_msdos: not found
One or more errors were found in your Fat32 partition
dosfsck has encountered technical errors and cannot continue. Script will ABORT
Script has completed operations
The log file has been copied to sdcard_repairlog.txt
script result was [|______________________________________________|]
minzip: Extracted file "/tmp/e2fsck"
minzip: Extracted file "/tmp/fsck_msdos"
minzip: Extracted file "/tmp/pre.sh"
________________________________________________
| |
| PARTITION CHECK & REPAIR TOOL |
| ================================== |
| - DROIDZONE - |
| |
| This is an On-Demand Partition Fix tool. |
| If you find too many force closes or freezes |
| on your phone, it may be the first indication|
| of increasing corruption on your ext4 partit-|
| ion. Running this tool will fix most of them.|
| |
| |
| [*]Checking and Fixing File system... |
| [*]Checking Fat32 File system... |
| [*]Checking ext4 File system... |
| [*]Done |
| [*]Repair log in sdcard/repairlog.txt |
|______________________________________________|
Install from sdcard complete.
So, without reboot i connected my adb shell and i'd try manually (with /sdcard alredy unmounted)
Code:
/tmp # ls -ail
ls -ail
213 drwxr-xr-x 2 root root 0 Sep 22 10:38 .
1 drwxr-xr-x 19 root root 0 Sep 22 10:03 ..
722 -rw-rw-rw- 1 root root 10 Sep 22 10:04 4ext_version
721 -rw-rw-rw- 1 root root 3 Sep 22 10:04 batt_level
756 -rwxrwxrwx 1 root root 111492 Aug 1 2008 e2fsck
730 -rw-rw-rw- 1 root root 5 Sep 22 10:04 free_space
757 -rwxr-xr-x 1 root root 22640 Aug 1 2008 fsck_msdos
758 -rwx------ 1 root root 2490 Aug 1 2008 pre.sh
692 -rw-rw-rw- 1 root root 8502 Sep 22 10:49 recovery.log
715 -rw-rw-rw- 1 root root 72 Sep 22 10:03 sd_fstypes
764 -rwxr-xr-x 1 root root 255904 Sep 22 10:38 update_binary
/tmp # /tmp/e2fsck -af /dev/block/mmcblk0p2
/tmp/e2fsck -af /dev/block/mmcblk0p2
/sbin/sh: /tmp/e2fsck: not found
/tmp # /tmp/fsck_msdos -pf /dev/block/mmcblk0p1
/tmp/fsck_msdos -pf /dev/block/mmcblk0p1
/sbin/sh: /tmp/fsck_msdos: not found
/tmp # pre.sh
pre.sh
/sbin/sh: pre.sh: not found
/tmp # ./pre.sh
./pre.sh
===================================
DROIDZONE'S FILESYSTEM FIXER SCRIPT
===================================
Script started at Thu Sep 22 10:58:36 GMT 2011
Ext4 file system found...
e2fsck running
./pre.sh: line 56: /tmp/e2fsck: not found
One or more errors were found in your ext4 partition
e2fsck has encountered technical errors and cannot continue. Script will ABORT
Sdcard found..
Attempting to unmount sdcard
umount: can't umount /sdcard: Invalid argument
umount: can't forcibly umount /sdcard: Invalid argument
DosFsck running...
./pre.sh: line 86: /tmp/fsck_msdos: not found
One or more errors were found in your Fat32 partition
dosfsck has encountered technical errors and cannot continue. Script will ABORT
Script has completed operations
The log file has been copied to sdcard_repairlog.txt
/tmp # ./tmp/fsck_msdos -pf /dev/block/mmcblk0p1
./tmp/fsck_msdos -pf /dev/block/mmcblk0p1
/sbin/sh: ./tmp/fsck_msdos: not found
i can't understand why ./pre.sh: line 56: /tmp/e2fsck: not found
recovery is kidding me!?
anyway all seems ok using e2fsck built in recovery 4EXT 2.1.3RC4 (i used verbose option):
Code:
~ # e2fsck -afv /dev/block/mmcblk0p2
e2fsck -afv /dev/block/mmcblk0p2
730 inodes used (0.56%)
25 non-contiguous files (3.4%)
1 non-contiguous directory (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 720
259347 blocks used (49.47%)
0 bad blocks
0 large files
707 regular files
14 directories
0 character device files
0 block device files
0 fifos
0 links
0 symbolic links (0 fast symbolic links)
0 sockets
--------
721 files
Weird indeed that the files in /tmp cant be accessed. Anyway, I'll add code to abort script if the binaries cant be found..it doesnt look good with the script saying everything's working.. I didnt add verbose early because of the output (confuses newbies?), but I'll add it too.
Edit: Forgot to mention that I use 4ext too, and no such issues here.
Droidzone said:
Weird indeed that the files in /tmp cant be accessed
Click to expand...
Click to collapse
nope, file can be accessed! with cat /tmp/e2fsck i see correct output
Droidzone said:
I'll add code to abort script if the binaries cant be found..it doesnt look good with the script saying everything's working..
Click to expand...
Click to collapse
+1 lol
did you try with 4EXT 2.1.3RC4 too?
Droidzone said:
You will have to do a manual e2fsck from the shell, since that usually means it is waiting for user intervention due to some errors. Though the automatic options I specified should correct minor issues, some seem to still need intervention
Sent from my HTC Desire using Tapatalk
Click to expand...
Click to collapse
Really appreciate for your kind explanation ^^;
Then, could somebody inform me how to to do a manual e2fsck from the shell or any links shows relative information? I've already questioned it at Q & A, but so far nobody has answered...
limscap1 said:
Really appreciate for your kind explanation ^^;
Then, could somebody inform me how to to do a manual e2fsck from the shell or any links shows relative information? I've already questioned it at Q & A, but so far nobody has answered...
Click to expand...
Click to collapse
It was there in Ultrakiller's quote.
Code:
e2fsck -afv /dev/block/mmcblk0p2
The command is found in /system/bin usually..My flasher also copies that file to /tmp. So:
Code:
chmod 755 /tmp/e2fsck
/tmp/e2fsck -afv /dev/block/mmcblk0p2
I would be linked in first post, for all that users who can't use the droidzone's script.
Reboot in Recovery, and connect adb shell.
EXT4 REPAIR/CHECK
Code:
e2fsck -afv /dev/block/mmcblk0p2
e2fsck will check and repair ext4 partition if needed.
an example:
Code:
e2fsck -afv /dev/block/mmcblk0p2
730 inodes used (0.56%)
25 non-contiguous files (3.4%)
1 non-contiguous directory (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 720
259347 blocks used (49.47%)
0 bad blocks
0 large files
707 regular files
14 directories
0 character device files
0 block device files
0 fifos
0 links
0 symbolic links (0 fast symbolic links)
0 sockets
--------
721 files
FAT32 REPAIR/CHECK
mount usb partition on pc using recovery menu.
Once connected usb cable and opened cmd on pc type:
Code:
chkdsk /R f:\
in my case fat32 partition is f:
chkdsk can take a while (around 20min)
an example of output here (sorry, italian OS, anyway in my case no errors found)
Code:
Il file system è di tipo FAT32.
Numero di serie del volume: B996-8582
Verifica dei file e delle cartelle in corso...
Verifica dei file e delle cartelle completata.
Verifica dello spazio disponibile in corso...
Verifica dello spazio disponibile completata.
Verifica del file system effettuata. Nessun problema rilevato.
13.525.072 KB di spazio totale su disco.
2.408 KB in 295 cartelle.
6.963.592 KB in 1.891 file.
6.559.064 KB disponibili.
8.192 byte in ogni unità di allocazione.
1.690.634 unità totali di allocazione su disco.
819.883 unità di allocazione disponibili su disco.
If i helped someone please hit thanks button!
First of all, thanks Droidzone for your work
I have run the tool and had this
e2fsck running
One or more errors were found in your ext4 partition
e2fsck has encountered technical errors and cannot continue. Script will ABORT
Sdcard found..
Attempting to unmount sdcard
DosFsck running...
One or more errors were found in your Fat32 partition
dosfsck has encountered technical errors and cannot continue. Script will ABORT
Script has completed operations
-----
Click to expand...
Click to collapse
When running e2fsck from adb doesn't find anything wrong:
(sorry can't copy/paste, I have attached an image)
And if I run a script (founded in a MIUI rom, a didn't remember what version) from gscript, called check sd it says:
Will be Check your SD Card from kernel message:
===============================================
[ 19.726623] mmcblk0: mmc1:b368 USD 7.46 GiB
[ 19.727478] mmcblk0: p1 p2 p3
[ 20.836303] EXT4-fs (mmcblk0p2): mounted filesystem without journal. Opts: noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue
[ 24.104003] EXT4-fs (mmcblk0p2): mounted filesystem without journal. Opts: noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue
[ 24.484558] EXT4-fs (mmcblk0p3): mounted filesystem without journal. Opts: noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue
[ 26.537750] EXT4-fs (mmcblk0p3): mounted filesystem without journal. Opts: noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue
===============================================
If you found error between two lines, then your SD card is broken.
Click to expand...
Click to collapse
The commands on that script are:
mkdir /sdcard/gscript/resources>/dev/null
clear
echo "echo Will be Check your SD Card from kernel message:" > /sdcard/gscript/resources/temp.sh
echo "echo ===============================================" >> /sdcard/gscript/resources/temp.sh
echo "dmesg|grep mmcblk0" >> /sdcard/gscript/resources/temp.sh
echo "echo ===============================================" >> /sdcard/gscript/resources/temp.sh
echo "echo If you found error between two lines, then your SD card is broken." >>/sdcard/gscript/resources/temp.sh
su</sdcard/gscript/resources/temp.sh
rm /sdcard/gscript/resources/temp.sh
Click to expand...
Click to collapse
If someone can help, I'll be really grateful. I have also tried repartitioning the whole SD card with gparted, but the problem still appears. I'm using Alex-V ROM d2ext with default kernel (snq-)
Thanks in advance
blackhawk_LA said:
First of all, thanks Droidzone for your work
I have run the tool and had this
When running e2fsck from adb doesn't find anything wrong:
(sorry can't copy/paste, I have attached an image)
And if I run a script (founded in a MIUI rom, a didn't remember what version) from gscript, called check sd it says:
The commands on that script are:
If someone can help, I'll be really grateful. I have also tried repartitioning the whole SD card with gparted, but the problem still appears. I'm using Alex-V ROM d2ext with default kernel (snq-)
Thanks in advance
Click to expand...
Click to collapse
That check in Miui seems to be at the kernel level..However imho I dont see an error...that line just seems to be the kernel output saying what ext4 options have been used for the mount (should be present for everyone ). Do you see any actual issues while using the card?
I haven't see any big issues, just noticed that the sdext restore from a nandroid seemed to take too much time (7-8 minutes for just 300mb) and that's why i used your tool and have a look at this post.
But everything is working fine (or it seems so), just wanted to know if my files could be starting to get corrupted or something.
Thanks
As far as my script is concerned..it depends on error code from e2fsck to report file system state. That particular error code means that a standard error level was not returned, so only a command line manual e2fsck will show exactly what was the system response. See Post #14 for how to do that.
Mmm this is what I did, I think. See the attached image in my other message; it seems there was no erros (0 bad blocks)
Hi, got an error in clockwork recovery : error in fixfsv0.2.zip ( status 0 ) installation aborted ..
any clues ?

Boot loop Unresolvable? Hardware problem?

Hey all, new to xda. Hope I'm not asking stupid questions.
My friend gave me a Galaxy S to fix. Model: GT-I9003.
It has a boot loop problem, cycling the Samsung introduction animation (and sound first time round). The recovery mode didn't work to start with - also trapped in a boot loop.
I followed the instructions here (using Odin3 v1.85) and flashed XXKPE. It seemed to all work fine, but the boot loop remained. I booted it into recovery mode and the following error messages appear.
E:failed to mount /data (No such file or directory)
Click to expand...
Click to collapse
and under -- Wiping data...
E:format_volume: rfs format failed on /dev/block/mmcblk0p3
Click to expand...
Click to collapse
then
Data wipe failed.
Click to expand...
Click to collapse
From my research I believe it's a corrupted internal SD-Card and is fixed via parted? Could anyone go into more detail on how I would do this?
Many thanks.
I am facing a similar problem on my Galaxy SL... Need a solution too... I would appreciate any help...
Data partition has been corrupted, try flashing userdata.rfs with heimdall. A friend of mine had an stock/untouched phone and this happened to it, even with the corrupted partition i was able to boot cyanogenmod, and tried a lot of things, but nothing worked, it was on warranty, so i flashed back the original firmware and he took it to the service center.
If you want to try do this:
Flash bam kernel PDA_BCK_CF-root_universal_beta14fix.tar (http://forum.xda-developers.com/showthread.php?t=1355675)
Then from CWM flash cyanogenmod (i used cm7, but you can try with cm9)
after that the phone should boot into cyanogemod and give an error on the notification bar
extract the 6 files off the zip i attached and copy them to /xbin
from terminal emulator or adb shell run this for the 6 files:
Code:
chmod 0755 <file>
then run:
Code:
parted /dev/block/mmcblk0 mkfs ext2
When it asks for the partition number, enter 3
finally reboot, and if it worked you can flash a stock rom again, thats it, good luck
My phone boots up, but there are random reboots. Tried a lot of stock and custom ROMs... Nothing works... Warranty expired last week...
Thanks for your time. I appreciate it.
bruisedcrow said:
Thanks for your time. I appreciate it.
Sorry, I'm very new at this - my first hour doing this kind of thing. Could you explain the procedure in more detail - I would like to learn (make the best of a bad situation).
Am I right to say that the Bam Custom Kernel gives super-root level privileges? Allowing the CWM to fiddle with partions?
I've downloaded the normalboot.img for BCK. How do I flash this to my device? Could you link me to a tutorial?
EDIT: Alternatively could you point me to all the prerequisites I need to properly understand the problem and the methods required to fix it?
Click to expand...
Click to collapse
I tried that... My phone was booting up...
I have Android SDK on my PC... It includes some tools like ADB.
If your phone is rooted, you can use ADB to do things, like formatting...
Connected my phone. Booted into recovery. From Command Prompt, I went to ADB folder, then typed "adb shell". Then, typed in the parted command, and followed steps. Successfully done...
But the problem continues...
I have found many other users have faced this problem -- http://forum.xda-developers.com/showthread.php?t=1736118
I am disappointed. My phone is no longer in warranty... I am too late...
it is possible that using cyanogenmod and S2E (simple2ext) will work as a workaround until you send it to service center.
grab a copy of s2e and push it to /system/app/
Repartition your External-SD using the same method used for phones with low storage capacity, warning: it will erase all the data in it, so make backups
Start s2e and mark to move:
App and Private app
Applications data
Dalvik and download cache
This makes another partition, and it does not fix data, but at least you should be able to install apps.
I face this problem too. Please someone give us the solution.
Update: I flashed BAM Custom Kernel and put it in recovery mode. Attached it to the computer, but I'm stuck at this error message.
Thanks again.
More information
EDIT: There doesn't seem to be a /data partition at all! I feel I'm getting closer to fixing this.
There are 2 storages chips on this phone, one is mmc and the other is onenand.
I think the mmc chip is dead... it contains both /data and internal-SD, the onenand still works, it contains (system cache and dbdata), you can still use the phone with cyanogenmod if you mount everything that should go on /data on a partition in the external-SD, (the method i described with s2e). However there are some drawbacks, the SD needs to be class 6 or above to maintain the system speed, and the life of the sd is going to be reduced because of the more intensive use.
alfrix said:
There are 2 storages chips on this phone, one is mmc and the other is onenand.
I think the mmc chip is dead... it contains both /data and internal-SD, the onenand still works, it contains (system cache and dbdata), you can still use the phone with cyanogenmod if you mount everything that should go on /data on a partition in the external-SD, (the method i described with s2e). However there are some drawbacks, the SD needs to be class 6 or above to maintain the system speed, and the life of the sd is going to be reduced because of the more intensive use.
Click to expand...
Click to collapse
Thanks. Is there a way to replace the mmc chip without sending it to Samsung?
I've flashed XXFPE then Bam Custom Kernel then when I try install cm7 from CWM it gives:
Checking state of RFS/EXT4...
assert failed: run_program("/tmp/updater.sh") == 0
E: Error in /emmc/update-cm-7.1.0-GalaxySL-Kang-singed.zip
(Status 7)
Installation aborted.
Trying with MIUI instead.
EDIT: MIUI does this too.
How do I get around this? Can't I flash cm7 via Odin like the stock roms?
bruisedcrow said:
Thanks. Is there a way to replace the mmc chip without sending it to Samsung?
I've flashed XXFPE then Bam Custom Kernel then when I try install cm7 from CWM it gives:
Checking state of RFS/EXT4...
assert failed: run_program("/tmp/updater.sh") == 0
E: Error in /emmc/update-cm-7.1.0-GalaxySL-Kang-singed.zip
(Status 7)
Installation aborted.
Trying with MIUI instead.
EDIT: MIUI does this too.
How do I get around this? Can't I flash cm7 via Odin like the stock roms?
Click to expand...
Click to collapse
I think that the problem is when /tmp/updater.sh tries to mount /emmc your internal memory (EDIT: I've just noticed you tried with CM7, so, if I remember correctly, /emmc is the external memory, but I think that the problem is always the impossibility to mount the internal memory.) to backup your /efs directory. Because of the not avaible internal memory (/emmc) it simply exits and aborts the installation.
A simple change in updater.sh will allow you to install CyanogenMod, but wait for a confirmation from alfrix, maybe there's something more.
Anyway here there's a thread of a user with the same problem, he solved this by using the external SD as internal SD, as alfrix suggested.
strange, before touching anything try with the release i used that time (14.12.2011), if it doesn't work, then edit the updater.sh and remove
Code:
if ! /tmp/busybox mount -t ext4 /dev/block/mmcblk0p3 /data ; then
/tmp/busybox umount /data
/tmp/make_ext4fs -b 4096 -g 32768 -i 8192 -I 256 -a /data /dev/block/mmcblk0p3
fi
EDIT: is there any mmcblk on /dev/block?
Code:
ls /dev/block/
Weird the has mmcblk0 reappeared.
Code:
~ # ls /dev/block
ls /dev/block
bml0!c bml6 loop6 ram13 ram9 stl6 tfsr2
bml1 bml7 loop7 ram14 stl1 stl7 tfsr3
bml10 bml8 mmcblk0 ram15 stl10 stl8 tfsr4
bml11 bml9 mmcblk0p1 ram2 stl11 stl9 tfsr5
bml12 loop0 platform ram3 stl12 tfsr0!c tfsr6
bml13 loop1 ram0 ram4 stl13 tfsr1 tfsr7
bml2 loop2 ram1 ram5 stl2 tfsr10 tfsr8
bml3 loop3 ram10 ram6 stl3 tfsr11 tfsr9
bml4 loop4 ram11 ram7 stl4 tfsr12
bml5 loop5 ram12 ram8 stl5 tfsr13
So I tried
Code:
C:\Users\Bruised>adb shell
~ # /sbin/parted /dev/block/mmcblk0 mkfs ext2
/sbin/parted /dev/block/mmcblk0 mkfs ext2
Warning: The existing file system will be destroyed and all data on the
partition will be lost. Do you want to continue?
/sbin/parted: invalid token: ext2
Yes/No? y
y
y
Partition number? 3
3
3
Error: Partition doesn't exist.
~ #
That mmcblk is you externalSD its 0 because the internal is missing/broken and it has only 1 partition, because you didn't do the Repartition yet.
Sent from my GT-I9003 using xda app-developers app
alfrix said:
That mmcblk is you externalSD its 0 because the internal is missing/broken and it has only 1 partition, because you didn't do the Repartition yet.
Sent from my GT-I9003 using xda app-developers app
Click to expand...
Click to collapse
What should I try next? 14.12.2011 download link is down.
try with this:
https://dl.dropbox.com/u/5013311/test_for_broken_mmc_cm-9-20120626-UNOFFICIAL-galaxysl.zip
alfrix said:
try with this:
https://dl.dropbox.com/u/5013311/test_for_broken_mmc_cm-9-20120626-UNOFFICIAL-galaxysl.zip
Click to expand...
Click to collapse
It installs it.
Code:
Checking state of RFS/EXT4...
Install from sdcard complete.
After I reboot CM9 boot screen loads then I get "Encryption unsuccessful" as shown here
After rebooting I get
Code:
CWM-based Recovery v5.5.0.4
Formatting /data...
E:format_volume: make_extf4fs failed on /dev/block/mmcblk0p3
Formatting /cache...
Data wipe failed.
Heres the log file from the sdcard:
Code:
+ /tmp/busybox test -e /sdcard/backup/efs/nv_data.bin
+ /tmp/busybox mount -t ext4 /dev/block/stl9 /system
+ /tmp/busybox mount -t ext4 /dev/block/stl10 /dbdata
+ /tmp/busybox mount -t ext4 /dev/block/stl11 /cache
+ /tmp/busybox umount -l /system
+ /tmp/busybox umount -l /cache
+ /tmp/busybox umount -l /data
umount: can't forcibly umount /data: Invalid argument
+ /tmp/busybox umount -l /dbdata
+ /tmp/busybox umount -l /efs
umount: can't forcibly umount /efs: Invalid argument
+ exit 0

Mounting Internal Storage as a USB Mass Storage Device and Recovering Data

CleverCoder's Guide to Mounting Android’s Internal Storage As A Mass Storage USB Device
I found inspiration from this guide: http://mohammadag.xceleo.org/mounting-your-android-devices-internal-storage/
His process did not work exactly, but by changing the “lun” to “lun0” and the path to the “android_usb” device, I was able to get this to work with my rooted Samsung Note 10.1. The instructions below were verified on my Note 2.
I was motivated to find this solution after I accidentally deleted my daughters world that she worked so hard to create in Survivalcraft. Ultimately, I wasn’t able to recover her world, but I learned a lot in the process. Enjoy!
Steps:
Boot into recovery mode (Usually holding volume (and home) down while powering up). I find the Wiki on CyanogenMod to be helpful to find device-specific bootloader instructions.
Invoke a root shell using ADB: “adb shell" (Note: This assumes you have the Android SDK installed and /platform-tools are in your PATH)
Find the /data partition, determine the block device that corresponds to it:
Code:
mount | grep /data
…
/dev/block/mmcblk0p16 on /data type ext4 (rw,seclabel,relatime,user_xattr,barrier=1,data=ordered)
…
Click to expand...
Click to collapse
Make a note of the block device name. In my case, it's "/dev/block/mmcblk0p16". Unmount the /data partition to allow mounting as a mass storage device:
Code:
umount /data
Locate the “mass storage” device LUN entry. (In my case, it was ..\lun0 rather than ..\lun):
Code:
find /sys -name lun*
…
/sys/devices/platform/s3c-usbgadget/gadget/lun0
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun0
…
Click to expand...
Click to collapse
In this case, we want to make a note of the entry with "f_mass_storage" in it. This is the entry that corresponds to a USB Mass Storage device.
Map the block device to the mass storage logical device LUN “file”. Note, this will be a file called “file” within the LUN folder. For example:
"/sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file":
~# echo BLOCK_DEVICE_HERE > LUN_FILE_PATH_HERE
For example:
Code:
echo /dev/block/mmcblk0p16 > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun0/file
Note: the ADB shell appears to wrap at around 80 characters, making it look like the line is split.
Reconfigure the USB device in “mass storage” mode. This has to be done in one command, since it will terminate the ADB connection. Also, the path varies to the “android_usb” device. It may be:
/sys/devices/virtual/android_usb/android0/
/sys/class/android_usb/android0/
You can use "find /sys -name *android0*" to help narrow the options. I believe either entry will work. YMMV
On my Note 2 the following worked:
Code:
echo "echo 0 > /sys/devices/virtual/android_usb/android0/enable && echo \"mass_storage,adb\" > /sys/devices/virtual/android_usb/android0/functions && echo 1 > /sys/devices/virtual/android_usb/android0/enable" > enable_mass.sh
sh enable_mass.sh &
This should terminate the ADB connection and cause a new USB device to appear, representing the /data volume mounted as a mass storage device.
At this time, the block device associated with the /data partition should show up as a USB mass storage device on your computer. I verified this with OSX. OSX did not support the ext3/4 filesystem, however, Unix utilities that support it will work.
Recovering Files
Once the device is mounted on your host machine, you can use PhotoRec (http://www.cgsecurity.org/wiki/PhotoRec) to recover files. It performs a file signature based recovery, is very powerful, and works with any file you can think of. It’s also easy to add support for your own file types.
I hope this helps others.
Cheers!
- Sean
Have anyone tried it?
Failed while do the step with the lun0/file.
Permission denied
Quite interesting :good: and works as expected with lun/file
Thanks for this amazing post
great
command done for E300K over Wifi adb
while system running normally
working great thanks
Code:
echo /dev/block/mmcblk0p20 > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun0/file
echo 0 > /sys/devices/virtual/android_usb/android0/enable
echo "mass_storage,adb" > /sys/devices/virtual/android_usb/android0/functions
echo 1 > /sys/devices/virtual/android_usb/android0/enable
---------- Post added at 05:10 AM ---------- Previous post was at 05:08 AM ----------
wondering how we could mount many partition at the same time
will see
Edit : seems to be related to the module that provide mass storage gadget, it's set to 1 emulation for the moment... i think i have to recompile that stuff and/or the kernel to have this feature... any way not for now ^^
Note : an alternative to check deleted files is R-Studio work well
Some Hint Please?
CleverCoder said:
CleverCoder's Guide to Mounting Android’s Internal Storage As A Mass Storage USB Device
I found inspiration from this guide: http://mohammadag.xceleo.org/mounting-your-android-devices-internal-storage/
His process did not work exactly, but by changing the “lun” to “lun0” and the path to the “android_usb” device, I was able to get this to work with my rooted Samsung Note 10.1. The instructions below were verified on my Note 2.
I was motivated to find this solution after I accidentally deleted my daughters world that she worked so hard to create in Survivalcraft. Ultimately, I wasn’t able to recover her world, but I learned a lot in the process. Enjoy!
Steps:
Boot into recovery mode (Usually holding volume (and home) down while powering up). I find the Wiki on CyanogenMod to be helpful to find device-specific bootloader instructions.
Invoke a root shell using ADB: “adb shell" (Note: This assumes you have the Android SDK installed and /platform-tools are in your PATH)
Find the /data partition, determine the block device that corresponds to it:
Code:
mount | grep /data
Make a note of the block device name. In my case, it's "/dev/block/mmcblk0p16". Unmount the /data partition to allow mounting as a mass storage device:
Code:
umount /data
Locate the “mass storage” device LUN entry. (In my case, it was ..\lun0 rather than ..\lun):
Code:
find /sys -name lun*
In this case, we want to make a note of the entry with "f_mass_storage" in it. This is the entry that corresponds to a USB Mass Storage device.
Map the block device to the mass storage logical device LUN “file”. Note, this will be a file called “file” within the LUN folder. For example:
"/sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file":
~# echo BLOCK_DEVICE_HERE > LUN_FILE_PATH_HERE
For example:
Code:
echo /dev/block/mmcblk0p16 > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun0/file
Note: the ADB shell appears to wrap at around 80 characters, making it look like the line is split.
Reconfigure the USB device in “mass storage” mode. This has to be done in one command, since it will terminate the ADB connection. Also, the path varies to the “android_usb” device. It may be:
/sys/devices/virtual/android_usb/android0/
/sys/class/android_usb/android0/
You can use "find /sys -name *android0*" to help narrow the options. I believe either entry will work. YMMV
On my Note 2 the following worked:
Code:
echo "echo 0 > /sys/devices/virtual/android_usb/android0/enable && echo \"mass_storage,adb\" > /sys/devices/virtual/android_usb/android0/functions && echo 1 > /sys/devices/virtual/android_usb/android0/enable" > enable_mass.sh
sh enable_mass.sh &
This should terminate the ADB connection and cause a new USB device to appear, representing the /data volume mounted as a mass storage device.
At this time, the block device associated with the /data partition should show up as a USB mass storage device on your computer. I verified this with OSX. OSX did not support the ext3/4 filesystem, however, Unix utilities that support it will work.
Recovering Files
Once the device is mounted on your host machine, you can use PhotoRec (http://www.cgsecurity.org/wiki/PhotoRec) to recover files. It performs a file signature based recovery, is very powerful, and works with any file you can think of. It’s also easy to add support for your own file types.
I hope this helps others.
Cheers!
- Sean
Click to expand...
Click to collapse
Hello sir, I want to ask you.
What recovery version do you use? Philz Touch? TWRP or another? can you please help me.? I am using Galaxy Note II device (GT-N7100)
When I am using TWRP recovery I can do all steps you provide but no luck. Then I am try using Philz Touch, adb shell is error, Device Not Found.
What can I do? Can you please help me? :good:
I need to recover some photos that I accidentally deleted.
Hi Sean,
This is a great idea!!! I've been struggling for the past two weeks to recover data from my HTC One M7 ever since I accidentally hit the factory reset button!:crying:
I got a few questions...
Does this method work on my M7 which has only the internal memory and no SD card?
IIf I'm trying this directly on a terminal window on he phone, how would the last command change?
Also, once done, how do we mount /data back?
Sorry for the noob questions!
Thanks a lot!
No response from HTC One M7
Hello Experts,
I tried the above mentioned method on my HTC One M7. It was lun0 in my case. I have unmounted /data. However, I still found that mmcblkp037 that was mounted on /data was still linked to /sdcard for some reason. I proceeded to unmount /sdcard too. (There is no SD card in my device btw).
After unmounting both /data and /sdcard, I proceeded to edit the lun0/file and then the long command all in one go. Unfortunately nothing happens, the adb shell remains active and I do not see a USB device appearing on My Computer. I've added the snapshots from the terminal window.
Can someone please help?:crying:
Thanks!!!
So i am trying to run this so that i can do a photo recovery on the internal storage. At first i wasn't getting the list of mmcblk0p and what they were assigned to. I found a different command that I think returns the correct information ( mmcblk0p26) when i make it to the end, it mounts it on my pc as the cd rom drive, but i cant do anything with it and it doesnt show up in my recovery program. I ran the command again and i got ( mmcblk0p26-orig) but again at the end, i still only have the cd rom that it mounts. im not sure if im not pointing to the correct mmcblk or what im missing. Any help is appreciated.
anyone?
Issues with step 4 umount
Hi together,
I have issues by proceeding step 4. "umount /data" it all the times says: "umount: bad /etc/fstab: No such file or directory"
I tried so many things to solve it.
Could you please help me?
I am unable to switch to mass_storage on my Moto G 2013.
I tried with DriveDriod Android App and it successfully enabled mass_storage but I am unable toreplicate the same manually.
This is what I tried:
[email protected]:/sdcard # find /sys -name lun*
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun
/sys/devices/platform/msm_hsusb/gadget/lun0
[email protected]:/sdcard #
[email protected]:/sdcard # mount | grep /data
/dev/block/mmcblk0p36 on /data type f2fs (rw,seclabel,nosuid,nodev,noatime,nodiratime,background_gc=on,user_xattr,inline_xattr,acl,inline_data,nobarrier,active_logs=6)
[email protected]:/sdcard #
[email protected]:/sdcard # echo "/dev/block/mmcblk0p36" > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file
[email protected]:/sdcard #
[email protected]:/sdcard # setprop sys.usb.config mass_storage,adb
Click to expand...
Click to collapse
No luck in mounting the partition as UMS.
Please Help.
Thanks.
@CleverCoder im trying this on a OneplusX but it ends up showing as unallocated space in gparted. Any clue?
All worked fine with a bq aquaris a4.5.
~#: umount /data
umount: can't umount /data: Invalid argument
Click to expand...
Click to collapse
Why can't I unmount the /data partition?
Any hints please?
Useful guide. Thanks. :good:
Additionally, you may look into kernel source of your device or simply into these USB related initramfs files for further details what you need to edit on your device:
/init.qcom.usb.rc
/init.usb.rc
/init.recovery.usb.rc (on TWRP)
Click to expand...
Click to collapse
You can find in these files the USB vendor id and product id values provided by your device manufacturer or Google. These values should be fed to corresponding files so that PC may properly identify your phone as a USB mass storage device. In given example, 2717 is USB Vendor ID of Xiaomi; manufacturer of Redmi Note 4.
Sample init.qcom.usb.rc (RN4/mido):
Code:
# Following are the parameters required for usb functionality. They provide configurable options like
# product_id/vendor id and allows specifying required functions:
#
# Required parameters:
#
# /sys/class/android_usb/android0/enable: Enables/disables usb composition
# Value: 0 (disable), 1 (enable)
[...]
# /sys/class/android_usb/android0/functions: Stores name of the function drivers used in usb composition.
# Value: Passed one per function driver. e.g. diag[,adb]
[...]
on property:sys.usb.config=mass_storage,adb && property:sys.usb.configfs=0
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/iSerial ${ro.serialno}
write /sys/class/android_usb/android0/idVendor 2717
write /sys/class/android_usb/android0/idProduct FF28
write /sys/class/android_usb/android0/functions adb,mass_storage
write /sys/class/android_usb/android0/enable 1
start adbd
setprop sys.usb.state ${sys.usb.config}
#Mass-storage only composition
on property:sys.usb.config=mass_storage && property:sys.usb.configfs=0
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/iSerial ${ro.serialno}
write /sys/class/android_usb/android0/idVendor 2717
write /sys/class/android_usb/android0/idProduct FF20
write /sys/class/android_usb/android0/functions mass_storage
write /sys/class/android_usb/android0/enable 1
setprop sys.usb.state ${sys.usb.config}
A good source is https://android.googlesource.com/kernel/common/+/bcmdhd-3.10/Documentation/usb/mass-storage.txt
Code:
[B]mido:/ #[/B] (find / -maxdepth 1 -type f) | while read fyle; do grep -iE "/sys.{,}lun" "$fyle" && printf ">>> $fyle\n\n"; done
/sys/class/android_usb/android0/f_mass_storage/lun/file
/sys/class/android_usb/android0/f_mass_storage/lun/file
>>> /init.usb.rc
[...]
[B]mido:/ #[/B] find /sys -iname lun*
/sys/devices/soc/7000000.ssusb/7000000.dwc3/gadget/lun0
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun
[...]
[B]mido:/ #[/B] file /sys/class/android_usb/android0/f_mass_storage/lun
/sys/class/android_usb/android0/f_mass_storage/lun: symbolic link to ../../../../soc/7000000.ssusb/7000000.dwc3/gadget/lun0
[B]mido:/ #[/B] file /sys/class/android_usb/f_mass_storage/lun
/sys/class/android_usb/f_mass_storage/lun: symbolic link to ../../../../soc/7000000.ssusb/7000000.dwc3/gadget/lun0
[B]mido:/ #[/B] file /sys/devices/virtual/android_usb/android0/f_mass_storage/lun
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun: symbolic link to ../../../../soc/7000000.ssusb/7000000.dwc3/gadget/lun0
[B]mido:/ #[/B] file /sys/class/android_usb/android0
/sys/class/android_usb/android0: symbolic link to ../../devices/virtual/android_usb/android0
So, the original files to modify are:
/sys/devices/soc/7000000.ssusb/7000000.dwc3/gadget/lun0
and
/sys/devices/virtual/android_usb/android0
Click to expand...
Click to collapse
All others are symlinks. Check your devices accordingly.
Simply use these files:
Code:
echo '0' > /sys/class/android_usb/android0/enable
echo '/dev/block/mmcblk0p**' > /sys/class/android_usb/android0/f_mass_storage/lun/file; # replace ** with partition number
echo 'mass_storage,adb' > /sys/class/android_usb/android0/functions
If your /data partition is encrypted and TWRP can decrypt it, you should use:
Code:
echo '/dev/block/dm-0' > /sys/class/android_usb/android0/f_mass_storage/lun/file
Additional settings:
Code:
setprop persist.sys.usb.config mass_storage,adb
setprop sys.usb.config mass_storage,adb; # disabling mtp will probably cause adb unauthorized
If you want to mount /data read-only, being on safe side or to avoid overwrite if want to recover deleted stuff:
Code:
echo '1' > /sys/class/android_usb/android0/f_mass_storage/lun/ro
And finally:
Code:
echo '1' > /sys/class/android_usb/android0/enable
Don't try this in running ROM, it's only for recovery mode.
Don't forget to unmount /data from your computer before disconnecting. Otherwise eMMC may get corrupted.
You can mount other partitions having a filesystem (like /system or /cache) in similar way, but that's rarely needed.
Can you tell me how to disable mass_storage again? revert everything back?
osrl said:
Can you tell me how to disable mass_storage again? revert everything back?
Click to expand...
Click to collapse
"sysfs" is a volatile filesystem. Everything is reset on reboot. Or you may revert changes manually:
Code:
echo 0 >/sys/class/android_usb/android0/enable
echo "" >/sys/class/android_usb/android0/f_mass_storage/lun/file
setprop persist.sys.usb.config adb
setprop sys.usb.config adb
echo 1 >/sys/class/android_usb/android0/enable
honor 9 error lun
Hello, On my Honor 9 I'm trying to do the same but I'm stuck on
find /sys -name lun*
Click to expand...
Click to collapse
because this command gives no lines found, it seems that I don't have any directory with "lun" written in it, so I'm unable to continue the tutorial, what am I doing wrong?
eyewee said:
honor 9 error lun
Hello, On my Honor 9 I'm trying to do the same but I'm stuck on
because this command gives no lines found, it seems that I don't have any directory with "lun" written in it, so I'm unable to continue the tutorial, what am I doing wrong?
Click to expand...
Click to collapse
i met this same problem. My phone is OPPO R15x PBCM.
i have ever installed an apk named UMS interface which can be downloaded from coolapk and found its code in github . this apk can allow root user create an image in their sdcard and mount it as a usb device or mount an external sd card as a usb device. the latter is like ums enabler .
it work normally, until i reinstalled OS of my phone. then it always return Mass storage Unit is not ready. i take a glance at the code of the apk, and found this warning exist only when /sys/devices/virtual/android_usb/android0/f_mass_storage/lun doesn't exist. exactly, /sys/devices/virtual/android_usb/android0/f_mass_storage/ doesn't exist. when i ls /sys/devices/virtual/android_usb/android0, it only return f_audio_source f_midi power state subsystem uevent, not
Code:
f_mass_storage
. no matter i reinstalled OS for many times, nothing become normal.
Code:
grep f_mass_storage /init.usb.rc
will return
Code:
chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file
chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file
, but i don't know its meaning. i don't have enough knowledge about android.
thanks anyone for help!

[Q] Soft bricked tab (GT-P3100)

Hello guys I've run into a weird problem.
I installed SlimLP alpha builds, everything was fine. One day, after trying to format /system etc. before flashing latest version, the tab started rebooting itself every 20 seconds. I tried to uninstall some apps, when I rebooted the tab the apps were back. I booted back into CWM recovery and when I tried to flash old version of this rom, it just stuck at the start. Moreover, when I try to exit recovery it always says "Root access probably lost. Fix?" But that does nothing.
I went into Odin and tried flashing two different stock roms, but it gave error "Complete(Write) operation failed" at system.img .It displayed my model number as "i9505" I then tried to flash through old Odin(v1.75) and it worked. But when I rebooted, it went back into SlimLP. I tried flashing TWRP and latest cwm version but it went back to previous version. The "download count" in Download Mode remained constant. I tried formatting /system and /data through cwm. There was no error but tab still boots straight into SlimLP.
I then tried my luck with ADB in cwm by trying to change file permission. With "chmod 755 /system" it gave the error "Read-only file system" With "mount" , it gave error "Operation not permitted". I booted into slimlp, quickly enabled root for "apps and ADB" through developer options and tried the commands but same error.
I also tried "NAND wipe all" in Odin, but it stuck at "Erase...." and then gave error after sometime.
Is there a way to completely wipe the OS now so I can flash stock one through Odin?
Which recovery version of cwm you have? Probably it will be lower than 6.0.4.4
It is 6.0.4.5
If you're tab still boots then try installing twrp using app called rashr
Tab reboots after 20 seconds, can't install app in that duration.
I9505 means you flashed the wrong firmware to your tablet, I 9505 is an international S4 phone rom.
You need a new tablet.
Reading is very important when it comes to flashing your Samsung devices.
Pp.
PanchoPlanet said:
I9505 means you flashed the wrong firmware to your tablet, I 9505 is an international S4 phone rom.
You need a new tablet.
Reading is very important when it comes to flashing your Samsung devices.
Pp.
Click to expand...
Click to collapse
I downloaded the correct firmware from sammobile, checked many times. Also, I flashed from other Odin version, which didin't display any model number. I just checked Odin3, and even without the device connected, it displays i9505 at top.
EDIT: Well downloaded Odin3 from another site, It didn't show any model number. Guess "i9505" was just a title edit.
I think there is a big in cwm, there are many having this problem with that recovery, all Android andi about it, try sending private message to him, our some other developer
Thanks, I'll try that and post it here.
Please do the following:
Boot/try to boot system
Try to get a dmesg using adb
Boot into recovery
Use adb to pull last_kmesg
Please get a recovery.log after wiping.
Attach the files here.
Send from OnePlus One using Tapatalk
Android-Andi said:
Please do the following:
Boot/try to boot system
Try to get a dmesg using adb
Boot into recovery
Use adb to pull last_kmesg
Please get a recovery.log after wiping.
Attach the files here.
Send from OnePlus One using Tapatalk
Click to expand...
Click to collapse
I tried the commands like "adb shell dmesg > dmesg.txt" But got error "access is denied" Then I copied dmesg from console window, and pulled other files.
ssqw1 said:
I tried the commands like "adb shell dmesg > dmesg.txt" But got error "access is denied" Then I copied dmesg from console window, and pulled other files.
Click to expand...
Click to collapse
Can you upload the cwm you flash first and send me on pm?
Want to check if it's for our tab.
Will check your logs later.
Send from OnePlus One using Tapatalk
Did you used rommanager for cwm?
Send from OnePlus One using Tapatalk
Nope
Looks like a broken EMMC...
Please boot into recovery and use "adb shell":
Code:
adb shell mount -t ext4 /dev/block/mmcblk0p9 /system
if it mounts without problems do the same for data
Code:
adb shell mount -t ext4 /dev/block/mmcblk0p10 /data
Moutns without problem?
Please unmount now.
Code:
adb shell umount /system
adb shell umount /data
Let´s try to check the partitions now:
Code:
adb shell e2fsck -vf /dev/block/mmcblk0p9
adb shell e2fsck -vf /dev/block/mmcblk0p10
if you got error messages, please inform me.
Maybe we can reformat the partition by using adb shell.
Android-Andi said:
Looks like a broken EMMC...
Please boot into recovery and use "adb shell":
Code:
adb shell mount -t ext4 /dev/block/mmcblk0p9 /system
if it mounts without problems do the same for data
Code:
adb shell mount -t ext4 /dev/block/mmcblk0p10 /data
Moutns without problem?
Please unmount now.
Code:
adb shell umount /system
adb shell umount /data
Let´s try to check the partitions now:
Code:
adb shell e2fsck -vf /dev/block/mmcblk0p9
adb shell e2fsck -vf /dev/block/mmcblk0p10
if you got error messages, please inform me.
Maybe we can reformat the partition by using adb shell.
Click to expand...
Click to collapse
It mounts without problem. Here are the results for checking:
First command:
Code:
C:\Program Files (x86)\Minimal ADB and Fastboot>adb shell e2fsck -vf /dev
e2fsck 1.41.14 (22-Dec-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
1699 inodes used (2.59%)
16 non-contiguous files (0.9%)
1 non-contiguous directory (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 1355
182363 blocks used (69.57%)
0 bad blocks
0 large files
1148 regular files
207 directories
0 character device files
0 block device files
0 fifos
0 links
335 symbolic links (335 fast symbolic links)
0 sockets
--------
1690 files
Second:
Code:
e2fsck 1.41.14 (22-Dec-2010)
/dev/block/mmcblk0p10: recovering journal
Superblock needs_recovery flag is clear, but journal has data.
Run journal anyway<y>?
It doesn't proceed, tried typing Y, Yes and all other keys.
Can you give me the output from:
Code:
adb shell ls -l /dev/block
Please from recovery and booting rom.
Have you tried flashing stockrom + pit file to repartition?
Send from OnePlus One using Tapatalk
For reference http://forum.xda-developers.com/showthread.php?t=2627490
Send from OnePlus One using Tapatalk
Please give me mount output too.
Code:
adb shell mount
Sorry for the late reply, here are the files.
EDIT: I tried flashing the pit file with stock rom 2 times with Odin version 1.75, it flashed successfully but tab booted straight into SlimLP again.

Patching Adbd Binary

Hi everyone, I'm trying to patch the adbd binary in my phone (rooted and with Android 11) in order to run it as root.
I found out that the binary was located in /apex/com.android.adbd/bin/, which, according to this link, comes from /system/apex/com.android.adbd.apex.
The apex file can be opened like a zip, so I extracted the files and found the apex_payload.img file, which is indeed mounted in /apex/com.android.adbd/.
Now, the problem is that I have to mount the img file in order to patch it, so I tried to do it with the command "mount -t ext4 -o loop apex_payload.img apex_payload" (yes, this folder exists) but I got the error "mount: '/dev/block/loop28'->'apex_payload': Invalid argument", and if I repeat the command the number after loop increases by one every time. I thought that maybe the image file had a read-only lock, like many partitions such as system,vendor,product etc..., and in fact the image has the shared_blocks feature (checked with "tune2fs -l apex_payload.img"), and I tried to remove it with "e2fsck -y -E unshare_blocks apex_payload.img", and this is the output: e2fsck 1.45.4 (23-Sep-2019)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information
apex_payload.img: 38/48 files (2.6% non-contiguous), 1932/1939 blocks
It doesn't return errors, and the exit code is 0, but it doesn't actually remove the read-only lock on the image file (checked again with tune2fs), so now I'm stuck with that problem. Does anyone know how to solve this or if there are other ways to modify an ext4 image?
Thank you very much.
hmmm. im trying to do something similar, but i have a system shell -- you have any luck?

Categories

Resources