Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Flashable Filesystem Check and Repair Tool

OP Droidzone

22nd September 2011, 12:12 AM   |  #1  
Droidzone's Avatar
OP Recognized Developer
Flag Kerala
Thanks Meter: 2,214
 
5,471 posts
Join Date:Joined: Sep 2010
Donate to Me
More
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, 1089 views)
File Type: zip FixFSv0.2.zip - [Click for QR Code] (233.6 KB, 1875 views)
Last edited by Droidzone; 22nd September 2011 at 01:33 PM.
The Following 10 Users Say Thank You to Droidzone For This Useful Post: [ View ]
22nd September 2011, 12:14 AM   |  #2  
Droidzone's Avatar
OP Recognized Developer
Flag Kerala
Thanks Meter: 2,214
 
5,471 posts
Join Date:Joined: Sep 2010
Donate to Me
More
Any followups....
22nd September 2011, 12:14 AM   |  #3  
rootSU's Avatar
Senior Member
Flag Oxenhope, West Yorkshire, UK
Thanks Meter: 13,791
 
24,958 posts
Join Date:Joined: Aug 2010
More
Nice one. If I had a partition to check, I'd definitely use this!
22nd September 2011, 12:16 AM   |  #4  
Droidzone's Avatar
OP Recognized Developer
Flag Kerala
Thanks Meter: 2,214
 
5,471 posts
Join Date:Joined: Sep 2010
Donate to Me
More
Quote:
Originally Posted by rootSU

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: [ View ]
22nd September 2011, 03:01 AM   |  #5  
limscap1's Avatar
Member
Thanks Meter: 8
 
53 posts
Join Date:Joined: 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
Last edited by limscap1; 22nd September 2011 at 03:04 AM.
22nd September 2011, 06:28 AM   |  #6  
Droidzone's Avatar
OP Recognized Developer
Flag Kerala
Thanks Meter: 2,214
 
5,471 posts
Join Date:Joined: Sep 2010
Donate to Me
More
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: [ View ]
22nd September 2011, 07:34 AM   |  #7  
beanbean50's Avatar
Senior Member
Flag London
Thanks Meter: 874
 
2,288 posts
Join Date:Joined: Jul 2008
More
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
22nd September 2011, 08:47 AM   |  #8  
siliconaddict's Avatar
Senior Member
Flag Tuckerville, the Netherlands
Thanks Meter: 35
 
630 posts
Join Date:Joined: Sep 2003
More
Great tool! Thanks very much, have been looking for something like this for ages.
22nd September 2011, 01:06 PM   |  #9  
Senior Member
Thanks Meter: 114
 
172 posts
Join Date:Joined: Oct 2010
Exclamation
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
Last edited by Ultrakiller; 22nd September 2011 at 01:14 PM.
22nd September 2011, 01:21 PM   |  #10  
Droidzone's Avatar
OP Recognized Developer
Flag Kerala
Thanks Meter: 2,214
 
5,471 posts
Join Date:Joined: Sep 2010
Donate to Me
More
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.
Last edited by Droidzone; 22nd September 2011 at 01:35 PM.

Post Reply Subscribe to Thread

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

Advanced Search
Display Modes