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

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

OP tonygoes

17th December 2011, 05:22 AM   |  #1  
OP Junior Member
Thanks Meter: 2
 
28 posts
Join Date:Joined: Apr 2011
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?
17th December 2011, 06:00 AM   |  #2  
zman0900's Avatar
Senior Member
Flag Columbus, OH
Thanks Meter: 219
 
269 posts
Join Date:Joined: Jan 2010
More
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
The Following 2 Users Say Thank You to zman0900 For This Useful Post: [ View ]
17th December 2011, 06:02 AM   |  #3  
toadlife's Avatar
Recognized Developer
Flag Lemoore, CA
Thanks Meter: 1,015
 
1,202 posts
Join Date:Joined: Aug 2008
Donate to Me
More
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.
The Following 2 Users Say Thank You to toadlife For This Useful Post: [ View ]
17th December 2011, 10:03 PM   |  #4  
zman0900's Avatar
Senior Member
Flag Columbus, OH
Thanks Meter: 219
 
269 posts
Join Date:Joined: Jan 2010
More
Quote:
Originally Posted by toadlife

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 by zman0900; 17th December 2011 at 10:15 PM.
The Following 2 Users Say Thank You to zman0900 For This Useful Post: [ View ]
17th December 2011, 10:13 PM   |  #5  
Senior Member
O 'Fallon, MO
Thanks Meter: 406
 
1,485 posts
Join Date:Joined: Jun 2011
More
Quote:
Originally Posted by zman0900

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

Code:
e2fsck -fv /dev/block/stl10

How bout mtd?

sent from my always aosp epic
17th December 2011, 10:16 PM   |  #6  
KennyG123's Avatar
RC-RT Committee / Senior Moderator / Spider-Mod
Flag Right behind you!
Thanks Meter: 27,322
 
28,982 posts
Join Date:Joined: Nov 2010
Donate to Me
More
Please consider posting questions in Q&A next time. Thank you.
18th December 2011, 03:09 AM   |  #7  
OP Junior Member
Thanks Meter: 2
 
28 posts
Join Date:Joined: Apr 2011
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.
23rd April 2013, 07:05 PM   |  #8  
Colliebudz's Avatar
Member
Flag efs partition...
Thanks Meter: 5
 
73 posts
Join Date:Joined: Sep 2011
More
Quote:
Originally Posted by zman0900

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
24th April 2013, 03:00 PM   |  #9  
zman0900's Avatar
Senior Member
Flag Columbus, OH
Thanks Meter: 219
 
269 posts
Join Date:Joined: Jan 2010
More
Quote:
Originally Posted by Colliebudz

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".
6th August 2013, 04:08 AM   |  #10  
TheByteSmasher's Avatar
Recognized Contributor
Flag Atlantis
Thanks Meter: 705
 
995 posts
Join Date:Joined: Jan 2010
Donate to Me
More
Quote:
Originally Posted by Colliebudz

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

The Following User Says Thank You to TheByteSmasher For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes