Flashable Filesystem Check and Repair Tool

Search This thread

ethan_hines

Senior Member
Jun 19, 2012
136
28
Google Glass
Samsung Galaxy S21
Hi, got an error in clockwork recovery : error in fixfsv0.2.zip ( status 0 ) installation aborted ..
any clues ?
I get the same error. I have a feeling it has to do with the updater-script. I think CWM needs a update script instead. :confused:

---------- Post added at 02:11 AM ---------- Previous post was at 02:07 AM ----------

I get this error when trying to run your script in adb shell recovery
DosFsck running...
pre.sh: line 103: fsck_msdos: not found
I checked the permissions and did a chmod 755 on fsck_msdos in /tmp
/tmp # fsck_msdos
fsck_msdos
/sbin/sh: fsck_msdos: not found
/tmp # ls
ls
e2fsck fsck_msdos pre.sh recovery.log
/tmp # fsck_msdos
fsck_msdos
/sbin/sh: fsck_msdos: not found
/tmp # ls -l
ls -l
-rwxr-xr-x 1 root root 111492 Aug 11 2011 e2fsck
-rwxr-xr-x 1 root root 22640 Aug 11 2011 fsck_msdos
-rw-rw-rw- 1 root root 2933 Jul 28 05:43 pre.sh
-rw-rw-rw- 1 root root 3916 Jul 28 05:31 recovery.log
/tmp # chmod 755 fsck_msdos
chmod 755 fsck_msdos
God I find linux tedious!
 

leodom01

Member
Nov 17, 2016
9
2
Ravenna
If i've got a Motorola Motog 3rd gen. can i use it on it, i got marshmallow 6.0?
Because i had a quiet boring problem and i've deleted 'keylogger' which was a file in the 'bin' folder under the 'system' folder, and i think that it cares about access password and now i can neither access to my phone with my pin, lso if it's correct (I've to use okGoogle) so i nned to restore this file; do you know a way?
 

JL70

New member
May 1, 2017
3
0
Android device Stucked in the logo? Save info, bckp, check filesystems (req ADB+CWM)

I had a device stucked in the logo by software problem, i was unable to install the app (memory was not recognized), but i can use ADB, so this solved my problem. so, i started with the installation of right version of CWM.

Even if your android device is stucked in the logo, collect internal info, data backup(full with app and customization) and check filesystems

PREPARATION: Create a backup folder, go to this folder and start CMD
mkdir backup
cd backup (if you have fully installed the adb you can change your actual location)

PART 1: get information
adb pull /proc/partitions .
adb pull /proc/self/mountinfo .
adb shell "ls -la /sbin/*fs* > /tmp/availables_native_filesystem_tools.txt" (To know your filesystems check tools)
adb pull /tmp/availables_native_filesystem_tools.txt
adb shell "ls -la /sbin/*fs* > /tmp/etc_files_properties.txt" (To know your etc/files links, mounts points, usr/grp/other properties "permissions"), fell free to save this info about every important folder )
adb pull /tmp/etc_files_properties.txt
adb pull /etc/vold.fstab (to know your actual internal and external sdcard asignation - some app/FW move everything to external memory so after a recovery this file is crucial or your device keep on bootlopp - caution this files are linux/unix type text, so don't change nor add any format like end line adjust )

adb shell "df -k /dev/block/st* > /tmp/filesystems_info.txt"

PART 2: The most important files to backup (/efs keep info to regenerate IMEI + WIFI MAC + BT MAC)
This part thanks to rotohammer 2010-12-05

adb pull /efs .
adb shell su -c "dd if=/dev/block/bml1 of=/sdcard/boot.bin bs=4096"
adb shell su -c "dd if=/dev/block/bml2 of=/sdcard/pit.pit bs=4096"
adb shell su -c "dd if=/dev/block/stl3 of=/sdcard/efs.rfs bs=4096"
adb shell su -c "dd if=/dev/block/bml4 of=/sdcard/Sbl.bin bs=4096"
adb shell su -c "dd if=/dev/block/stl6 of=/sdcard/param.lfs bs=4096"
adb shell su -c "dd if=/dev/block/bml7 of=/sdcard/zImage bs=4096"
adb shell su -c "dd if=/dev/block/stl9 of=/sdcard/factoryfs.rfs bs=4096"
adb shell su -c "dd if=/dev/block/stl10 of=/sdcard/dbdata.rfs bs=4096"
adb shell su -c "dd if=/dev/block/stl11 of=/sdcard/cache.rfs bs=4096"
adb shell su -c "dd if=/dev/block/bml12 of=/sdcard/modem.bin bs=4096"
adb shell su -c "tar -czvf /sdcard/data.tar.gz /data"

adb pull /sdcard/param.lfs .
adb pull /sdcard/zImage .
adb pull /sdcard/factoryfs.rfs .
adb pull /sdcard/dbdata.rfs .
adb pull /sdcard/cache.rfs .
adb pull /sdcard/modem.bin .
adb pull /sdcard/efs.rfs .
adb pull /sdcard/boot.bin .
adb pull /sdcard/Sbl.bin .
adb pull /sdcard/pit.pit .
adb pull /sdcard/data.tar.gz .

... Feel free to add aditionals filesystems and folders to backup...

Note:
1.-You will be prompted for superuser permissions on the Tabs LCD on every dd command but if you are ROOT with CWM or any permanente root APP, you can get an error so delete the "su -c " parameter...
2.-If you don't have the tar command on your tab, install Busybox Installer from the market.

I just paste the above commands in the my command shell window and when you're done all the files are siting in your current (backup) directory. Thanks to the Source: https://xdaforums.com/showthread.php?t=850359

PART 3: Check filesystem to fix fs errors (by your own hands):

adb shell "umount /efs"
adb shell "fsck_msdos -pf /dev/block/stl3"
adb shell "umount /cache"
adb shell "fsck_msdos -pf /dev/block/stl11"
adb shell "umount /dbdata"
adb shell "fsck_msdos -pf /dev/block/stl10"
adb shell "umount /data"
adb shell "fsck_msdos -pf /dev/block/stl9"
adb shell "fsck_msdos -pf /dev/block/stl11"
(Of course this is not permited : adb shell "umount /system" because you are there at this time)

PART 4: Use one of this reboot options after every adb restart to keep the filesystems and memory healty...
Only if Wipe+Hardreset is required: adb shell "reboot recovery"
Only if Download is required: adb shell "reboot download"
any other way: adb shell "reboot"

PART 5: Restore (Requires Heindall / Odin / Flash sw).
This part thanks to rotohammer 2010-12-05

First flash the data back:
Code:
adb push data.tar.gz /sdcard/data.tar.gz
adb shell su -c "tar -zxvf /sdcard/data.tar.gz"
adb reboot download
Now flash the dumps with Heimdall:
Code:
heimdall flash --kernel zImage --factoryfs factoryfs.rfs --modem modem.bin --cache cache.rfs --dbdata dbdata.rfs --param param.lfs
Of course you could tar the files right n the Tab and flash via Odin if you really want to:
Code:
adb shell
cd /sdcard
tar -cf mybackup.tar cache.rfs dbdata.rfs factoryfs.rfs modem.bin param.lfs zImage
exit
adb pull /sdcard/mybackup.tar .

Disclaimer

This is an individual and personal compilation so, i sincerely hope this extract help someone, sometime, somewhere, but... Myself nor anybody will take responsibility for any actions you take using these instructions or applications. ROM flashing can void your warranty and should be the last option. Please proceed with caution and at your own accord and risk. Flashing will completely erase your device's memory. Make a backup of everything you need, for this objective i present 1 backup option, please use this and any other that you know. I am not responsible for bricked devices, dead SD cards, thermonuclear war, or you getting fired because the alarm app failed. Please do some research if you have any concerns about features or actions here included!
I test this solution (till part 4) on my own device but YOU are choosing to make these actions, and if you point the finger at me for messing up your device, sorry I won't cry with you.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    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
    2
    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! ;)
    1
    Nice one. If I had a partition to check, I'd definitely use this!

    Ha ha.. :D
    1
    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
    1
    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...

    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