[Q]How to fsck /data or /system?

Search This thread

tonygoes

Member
Apr 2, 2011
30
3
Does anybody know of a way to fsck the system or data partitions? I've run into a few times where I had data errors on /data, and the only way I could think of to fix them was to do a backup and restore. I was worried about losing data during the backup process, as the filesystem was already questionable.

I have e2fsck in my rom, but I can't run it from a normal shell as the filesystems are already mounted. Is there a way to make a rom automatically check and repair the filesystems on boot, and if so, how can I control the options it passes to fsck? Are there other ways to get to an unmounted system or data partition? Does clockworkmod have any kind of shell or fsck utilities built in? Are there other recovery programs that may have something like that?
 

toadlife

Inactive Recognized Developer
Aug 19, 2008
1,208
1,012
Lemoore, CA
You should be able to do it while booted into recovery through ADB.

Boot to recovery
connect usb cable to PC
run `adb shell`
Code:
unmount /data
unmount /system
fsck /dev/block/stl9
fsck /dev/block/stl10

syntax for above commands needs to be checked.
 

zman0900

Senior Member
Jan 20, 2010
277
230
Columbus, OH
You should be able to do it while booted into recovery through ADB.

Boot to recovery
connect usb cable to PC
run `adb shell`
Code:
unmount /data
unmount /system
fsck /dev/block/stl9
fsck /dev/block/stl10

syntax for above commands needs to be checked.

Just tried this out myself. Here's the correct syntax for the fsck command:

Code:
e2fsck -fv /dev/block/stl10

EDIT: Forgot to mention also that unmount should actually be umount. Or you could just use the CWR menus to unmount partitions.
 
Last edited:

tonygoes

Member
Apr 2, 2011
30
3
Sorry for the "newbie spam"! But that worked perfectly - I didn't realize that adb shell worked when booted from cwm. That's exactly what I was looking for.
 

Colliebudz

Senior Member
Sep 30, 2011
74
3
efs partition...
Just tried this out myself. Here's the correct syntax for the fsck command:

Code:
e2fsck -fv /dev/block/stl10

EDIT: Forgot to mention also that unmount should actually be umount. Or you could just use the CWR menus to unmount partitions.

Thanks for this, this is why i love xda!
I have e2fsck in my /bin
On a samsung galaxy s2 i9100
How do i identify my /system & /data blocks
I cant remember how to find out!

So mine would be
e2fsck -fv /dev/block/????
Thanks
 

zman0900

Senior Member
Jan 20, 2010
277
230
Columbus, OH
Thanks for this, this is why i love xda!
I have e2fsck in my /bin
On a samsung galaxy s2 i9100
How do i identify my /system & /data blocks
I cant remember how to find out!

So mine would be
e2fsck -fv /dev/block/????
Thanks

If you run mount with no arguments, it will show a list of mounted partitions like "xxx on /system".
 

vincy24

Member
Aug 12, 2011
25
1
Boston
Thanks for this, this is why i love xda!
I have e2fsck in my /bin
On a samsung galaxy s2 i9100
How do i identify my /system & /data blocks
I cant remember how to find out!

So mine would be
e2fsck -fv /dev/block/????
Thanks

the easiest was to find what /system and /data mount points actually are

cat /etc/fstab

to see a list of mount points.
 
  • Like
Reactions: Phil_Smith

rod.gui

Member
Aug 25, 2010
23
3
Belo Horizonte
You should be able to do it while booted into recovery through ADB.

Boot to recovery
connect usb cable to PC
run `adb shell`
Code:
unmount /data
unmount /system
fsck /dev/block/stl9
fsck /dev/block/stl10

syntax for above commands needs to be checked.

How do I get the Moto X in Recovery mode to accept the adb command?
Because when I put in Recovery (Android Robot lying down) mode, the command adb and fastboot are not recognized.
 

mandgeo

Senior Member
May 16, 2012
195
30
My phone is Huawei G525. It doesn't have CWM or any custom stuff, just rooted.

My problem is that it reports an imagic flagged inode and it recommends to fsck the partition (/system). The logs are saved in sdcard folder.

I can use adb and fastboot, but fastboot shell doesn't work and /system is mounted when i can use adb.

Is there any solution for me to run e2fsck on /system partition?

Or is there the case to worry about that error? The phone works fine...no random reboots, no crashes, no force closes.

Another thing...I've tried to make a romdump and system archive is damaged. Cannot be opened even with 7-zip.
 

AndyYan

Recognized Contributor
Jan 30, 2012
4,773
4,401
Beijing
My phone is Huawei G525. It doesn't have CWM or any custom stuff, just rooted.

My problem is that it reports an imagic flagged inode and it recommends to fsck the partition (/system). The logs are saved in sdcard folder.

I can use adb and fastboot, but fastboot shell doesn't work and /system is mounted when i can use adb.

Is there any solution for me to run e2fsck on /system partition?

Or is there the case to worry about that error? The phone works fine...no random reboots, no crashes, no force closes.

Another thing...I've tried to make a romdump and system archive is damaged. Cannot be opened even with 7-zip.

G525 DOES have CWM recovery available, find and install one so that you can fsck from recovery using adb.

Sent from Google Nexus 4 @ CM11
 

mandgeo

Senior Member
May 16, 2012
195
30
G525 DOES have CWM recovery available, find and install one so that you can fsck from recovery using adb.

Sent from Google Nexus 4 @ CM11

As far as I understand from here... http://bbs.dospy.com/thread-16432606-1-823-1.html , the bootloader needs to be unlocked. I've submitted for an update code and i'll wait. The chinese guy talks about U8950, but there are five different types. I've selected the first one, U8950-1. Maybe i'm lucky.

I've also tried to boot directly into the recovery found here... http://www.needrom.com/mobile/huawei-g525-u00/ , but that command is not allowed, maybe because the bootloader is locked. That was the only recovery i found that seems to be in english.

I'll try the same procedure to boot into recovery (fastboot boot recovery.img) because i don't want to mess things more that they are. I didn't found any tutorial in english and google translate is confusing.

Thanks!

LE. Does anybody know if Huawei rewrites the custom recovery if it's not the stock one.
 
Last edited:

AndyYan

Recognized Contributor
Jan 30, 2012
4,773
4,401
Beijing
As far as I understand from here... http://bbs.dospy.com/thread-16432606-1-823-1.html , the bootloader needs to be unlocked. I've submitted for an update code and i'll wait. The chinese guy talks about U8950, but there are five different types. I've selected the first one, U8950-1. Maybe i'm lucky.

I've also tried to boot directly into the recovery found here... http://www.needrom.com/mobile/huawei-g525-u00/ , but that command is not allowed, maybe because the bootloader is locked. That was the only recovery i found that seems to be in english.

I'll try the same procedure to boot into recovery (fastboot boot recovery.img) because i don't want to mess things more that they are. I didn't found any tutorial in english and google translate is confusing.

Thanks!

LE. Does anybody know if Huawei rewrites the custom recovery if it's not the stock one.

Well, you know this forum is dedicated for discussion about Samsung Epic 4G, not Huawei G525... But to help you out I might be able to dig in a bit more later this week when I have time. I'm a Chinese myself and can (hopefully) understand these procedures.

Sent from Google Nexus 4 @ CM11
 
  • Like
Reactions: mandgeo

paulkoan

Member
May 20, 2012
7
0
Well, you know this forum is dedicated for discussion about Samsung Epic 4G, not Huawei G525... But to help you out I might be able to dig in a bit more later this week when I have time. I'm a Chinese myself and can (hopefully) understand these procedures.

Sent from Google Nexus 4 @ CM11

My phone is a Note 2 LTE N7105 - I realise not the same as this thread, but this is the only thread I have found that is discussing this. My /data partition needs an fsck, however, while I can adb to the phone when it is booted, I can't when it is in recovery.

I have TWRP 2.7.1.0 installed, and everything else works fine. When the phone is booted, I get the GT-N7105 driver appearing in portable devices in device manager, but when recovery is booted, I just get t0lte in "other devices".

Seems like the Samsung USB driver only works when the phone is properly booted, and doesn't match when booted to recovery.

Any ideas how to work around this?
 

paulkoan

Member
May 20, 2012
7
0
My phone is a Note 2 LTE N7105 - I realise not the same as this thread, but this is the only thread I have found that is discussing this. My /data partition needs an fsck, however, while I can adb to the phone when it is booted, I can't when it is in recovery.

I have TWRP 2.7.1.0 installed, and everything else works fine. When the phone is booted, I get the GT-N7105 driver appearing in portable devices in device manager, but when recovery is booted, I just get t0lte in "other devices".

Seems like the Samsung USB driver only works when the phone is properly booted, and doesn't match when booted to recovery.

Any ideas how to work around this?

Yes, the workaround is to not use stupid Windows.

Works fine on linux.
 

Illuvitar

Senior Member
Jan 26, 2011
71
11
run terminal app:
su
touch /forcefsck

Then reboot. It might depend on your ROM, but give it a go.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    You should be able to do it while booted into recovery through ADB.

    Boot to recovery
    connect usb cable to PC
    run `adb shell`
    Code:
    unmount /data
    unmount /system
    fsck /dev/block/stl9
    fsck /dev/block/stl10

    syntax for above commands needs to be checked.

    Just tried this out myself. Here's the correct syntax for the fsck command:

    Code:
    e2fsck -fv /dev/block/stl10

    EDIT: Forgot to mention also that unmount should actually be umount. Or you could just use the CWR menus to unmount partitions.
    3
    You should be able to boot into CWM, unmount the partitions, connect with adb and run it from there. At least if your version of CWM has fsck in it.

    Sent from my SPH-D700 using xda premium
    3
    You should be able to do it while booted into recovery through ADB.

    Boot to recovery
    connect usb cable to PC
    run `adb shell`
    Code:
    unmount /data
    unmount /system
    fsck /dev/block/stl9
    fsck /dev/block/stl10

    syntax for above commands needs to be checked.
    1
    Thanks for this, this is why i love xda!
    I have e2fsck in my /bin
    On a samsung galaxy s2 i9100
    How do i identify my /system & /data blocks
    I cant remember how to find out!

    So mine would be
    e2fsck -fv /dev/block/????
    Thanks
    Better to do /dev/block/platform/(your processor)/by-name/xxxx. Less chance of error
    1
    Thanks for this, this is why i love xda!
    I have e2fsck in my /bin
    On a samsung galaxy s2 i9100
    How do i identify my /system & /data blocks
    I cant remember how to find out!

    So mine would be
    e2fsck -fv /dev/block/????
    Thanks

    the easiest was to find what /system and /data mount points actually are

    cat /etc/fstab

    to see a list of mount points.