Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

Sometimes my SD card gets "corrupted" and this leads to many read/write errors. Usually, connecting the SD card to the windows 7 and selecting the "Error Checking" (Right click the drive > Tools > Error Checking) option finds the corruption and fixes it.

Is there any tool or app for checking SD cards for drive errors and fixing the same from within the android itself?

I'd also like to mention that I'm on rooted froyo with busybox installed.

share|improve this question
Have you tried with a terminal app, doing a su and running the /system/bin/fsck.exfat? –  Izzy Jan 31 '13 at 15:58
@Izzy Gives me No such file or directory –  Power-Inside Jan 31 '13 at 16:06
Check different locations, maybe it's in /system/xbin instead? Try cding into the directory, and ls fsc* to check what's available. Must be somewhere :) –  Izzy Jan 31 '13 at 16:11
@Izzy Just typing fsck seems to run the binary. (shows Fsck (busybox 1.21.0-Stericson.. blah blah) I don't really know the syntax or anything much. I'm a windows user. So maybe you could post an answer below? –  Power-Inside Jan 31 '13 at 16:16
Exactly. Busybox tries to be as slim as possible. Try aunt Google with "man mount", works fine :) And see my answer below. If something's unclear, comment there (or see me in chat -- though I won't be available there for the next few hours, there are still other knowing members to help you out :) –  Izzy Jan 31 '13 at 16:39

6 Answers 6

up vote 9 down vote accepted

You can fix this with the help of root and a terminal emulator (e.g. Android Terminal Emulator (or, alternatively, using adb shell). The binary to do the job is called fsck, and usually located in either /system/xbin or /system/bin. Sometimes you need a special variant of it, which might e.g. be called fsck.exfat or the like. So first let's make sure we find the right binary:

cd /system/xbin
ls fsc*

If not found, repeat with /system/bin. I will assume here it was found in the first place, and is simply called fsck (adjust the following correspondingly if that's not the case).

As fsck comes from the "Linux core", we can consult its man page for the syntax. Though there might be some options not working on Android, the most basic ones should. See the linked man page for details (or run a Linux VM and use man fsck in case that page disappears) -- I will stick to the basics here:

First we need to find the device your SD card is bound to. If it's mounted, the mount command will assist us:


That's it, basically: Check the output and see where your SD card sits. Usually this is something using vold, but it's different between devices. Output may include something like /dev/block/vold/179:17 on /mnt/storage/sdcard -- in that case, the first part of my quote is our device. In order to repair the "drive", you need to unmount it first. This can be done via the settings menu, or, as we're just in the terminal, by issuing

umount /dev/block/vold/179:17

Now we can go for the repair job. Basic syntax is:

fsck [options] [-t fstype] <filesystem> [fsoptions]

So we first try the simplest approach and hope fsck figures out everything itself:

fsck -C -r /dev/block/vold/179:17

Which basically means: Show progress (-C), and always ask the user to repair (-r) any errors on /dev/block/vold/179:17. If this does not work out, check with the linked man page for further options.

share|improve this answer
You can also save yourself the cd steps if you want by using ls /system/bin/fsc* and ls /system/xbin/fsc* from whatever your current working directory is. You could even combine the two into one command with ls /system/xbin/fsc* /system/bin/fsc*. –  user981 Jan 31 '13 at 16:52
on some systems the command may also be named e2fsck, such as on my stock Australian Galaxy Nexus. –  Lie Ryan Nov 9 '13 at 11:14
@LieRyan Sure you don't confuse things? e2fsck is the file system checker for extFS. So if it has a different name, it's rather fsck.fat or fsck_msdos (the latter a real world example from an old 2.2 ROM off my Moto). –  Izzy Nov 9 '13 at 12:48
No, I don't confuse things, what I wasn't aware of is that this question is actually about SD card. So yeah, I actually did confuse some things. Well strictly speaking, you can format your SD card as ext as well, so that might apply to people that does that. –  Lie Ryan Nov 9 '13 at 12:57
Point taken. Though the "average user" (or the one "in doubt") might better stick with FAT, at least for interoperability. At least until ExtFS is supported on the majority of OSs easily and by default without additional drivers required (guess Windows is and will remain a pitfall here, as usual). –  Izzy Nov 9 '13 at 13:08

thank for this, it saves my day :)

root@android:/ # mount | grep -i sdcard
/dev/block/nandk /mnt/sdcard vfat rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=ascii,shortname=mixed,errors=remount-ro 0 0

root@android:/ # /system/bin/fsck_msdos -y /dev/block/nandk
share|improve this answer

If you repeatedly have errors on your SD card, you should make sure that it is really of the stated capacity using H2testw (link only in German, software in German and English. I believe this is the official home despite appearances to the contrary). Bad SD cards will automatically corrupt.

share|improve this answer
Thanks for the upvote on this long-forgotten answer. Should probably be a comment, but I probably didn't have the reputation for that at the time. I'll leave this here for now until the comment gets upvoted and is visible. –  Code Bling Jul 8 at 4:49

If I'm not mistaken you can force android to fsck both the internal and external storage on reboot by doing the following depending on your rom.

run terminal app and type

touch /forcefsck

Then reboot

source: http://forum.xda-developers.com/showpost.php?p=57027579&postcount=20

share|improve this answer

I've found an app on the market that can "Repair damaged sdcard and scan for bad blocks" etc.


share|improve this answer
255|shell@android:/ $ sdcard                                                   
no path specified
usage: sdcard [-l -f] <path> <uid> <gid>

        -l force file names to lower case when creating new files
        -f fix up file system before starting (repairs bad file name case and group ownership)

try to run sdcard -f

share|improve this answer
-1. /system/bin/sdcard doesn't do what you think it does, and "sdcard -f" won't do what the querent wants. –  unforgettableid Jul 8 at 3:23

protected by Community Jul 15 at 12:46

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.