Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,808,145 Members 36,361 Now Online
XDA Developers Android and Mobile Development Forum

Flashable Filesystem Check and Repair Tool

Tip us?
 
Droidzone
Old
(Last edited by Droidzone; 22nd September 2011 at 12:33 PM.)
#1  
Droidzone's Avatar
Recognized Developer - OP
Thanks Meter 2,192
Posts: 5,470
Join Date: Sep 2010
Location: Kerala

 
DONATE TO ME
Talking 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
Attached Files
File Type: zip FixFS.zip - [Click for QR Code] (233.4 KB, 977 views)
File Type: zip FixFSv0.2.zip - [Click for QR Code] (233.6 KB, 1707 views)

The Following 10 Users Say Thank You to Droidzone For This Useful Post: [ Click to Expand ]
 
Droidzone
Old
#2  
Droidzone's Avatar
Recognized Developer - OP
Thanks Meter 2,192
Posts: 5,470
Join Date: Sep 2010
Location: Kerala

 
DONATE TO ME
Any followups....

 
rootSU
Old
#3  
rootSU's Avatar
Senior Member
Thanks Meter 11,396
Posts: 22,424
Join Date: Aug 2010
Location: Oxenhope, West Yorkshire, UK
Nice one. If I had a partition to check, I'd definitely use this!
Want to root/unroot? All important guides and info threads are contained within the "Sticky Roll-up" thread in General. Click the link below to get there!

**Sticky Roll-up: All Guides snd Info Threads linked here**



Philz Touch Recovery with passkey secure lock

I do NOT reply to support queries over PM.
 
Droidzone
Old
#4  
Droidzone's Avatar
Recognized Developer - OP
Thanks Meter 2,192
Posts: 5,470
Join Date: Sep 2010
Location: Kerala

 
DONATE TO ME
Quote:
Originally Posted by rootSU View Post
Nice one. If I had a partition to check, I'd definitely use this!
Ha ha..

The Following User Says Thank You to Droidzone For This Useful Post: [ Click to Expand ]
 
limscap1
Old
(Last edited by limscap1; 22nd September 2011 at 02:04 AM.)
#5  
limscap1's Avatar
Member
Thanks Meter 8
Posts: 53
Join Date: Sep 2011
===================================
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
Kernel : Gingercakes 0.8f
 
Droidzone
Old
#6  
Droidzone's Avatar
Recognized Developer - OP
Thanks Meter 2,192
Posts: 5,470
Join Date: Sep 2010
Location: Kerala

 
DONATE TO ME
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

The Following User Says Thank You to Droidzone For This Useful Post: [ Click to Expand ]
 
beanbean50
Old
#7  
beanbean50's Avatar
Senior Member
Thanks Meter 839
Posts: 2,255
Join Date: Jul 2008
Location: London
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
 
siliconaddict
Old
#8  
siliconaddict's Avatar
Senior Member
Thanks Meter 34
Posts: 629
Join Date: Sep 2003
Location: Tuckerville, the Netherlands
Great tool! Thanks very much, have been looking for something like this for ages.
Samsung Galaxy S4 LTE (GT-I9505) 16GB Black & Samsung 64GB micro SD Pro Class 10 UHS-I
Rooted via mskip's Android Toolkit | TWRP Recovery | some AOSP ROM | some AOSP kernel | custom tweaks & enhancements

Retired:
Nokia 1610->Nokia 3110->Nokia 6110 & 3Com Palm III->Nokia 6210/6310 & Compaq iPAQ 3630->O2 XDA (HTC Wallaby)->Qtek 9090->HTC S620->HTC TyTN P4500->HTC TyTN II P4550->HTC Desire (A8181)->Samsung Galaxy SIII (GT-I9300)
 
Ultrakiller
Old
(Last edited by Ultrakiller; 22nd September 2011 at 12:14 PM.)
#9  
Senior Member
Thanks Meter 114
Posts: 172
Join Date: Oct 2010
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
Old:
HTC Desire (sold, i miss u!)
Motorola Droid Razr (handed back)
HTC Sensation (2x z710, 1x z715e)

Current:
LG Nexus 4 16GB (LGE960)
Nexus 7 32GB 3G (Tilapia)
HUAWEI U8150 = {BootBuilder-U8150, UltraJack-Recovery v6.2.2 (06/03/2011)};
 
Droidzone
Old
(Last edited by Droidzone; 22nd September 2011 at 12:35 PM.)
#10  
Droidzone's Avatar
Recognized Developer - OP
Thanks Meter 2,192
Posts: 5,470
Join Date: Sep 2010
Location: Kerala

 
DONATE TO ME
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.


Tags
fix partition, partition corruption, repair ext
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes