Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
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. – Code Bling Jul 8 '15 at 4:46
up vote 13 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*. – eldarerathis 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

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

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 '15 at 4:49
I've upvoted your comment. – unforgettableid Nov 27 '15 at 16:37
@unforgettableid Thanks, just want to make sure that everyone knows about this risk. It really sucks to lose data. – Code Bling Nov 27 '15 at 17:17
OK, so now that the comment has been upvoted, you can delete this answer. :) – unforgettableid May 30 at 18:50
@unforgettableid will leave both for now, for visibility – Code Bling Jun 6 at 23:06

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.

If your phone is not rooted, this will definitely fail.


share|improve this answer
What do you mean by "depending on your ROM"? – unforgettableid Nov 27 '15 at 16:37
That trick might not work on all phones. different phones may fail to do anything. Also your phone needs to be rooted. – Trekeyus Nov 28 '15 at 17:59
Once I've rebooted, how can I know whether or not fsck actually ran or not? – unforgettableid Dec 14 '15 at 8:12
I'm not sure is andoid has a /var/log/fsck you can check but you can guess that it is workign if the bootup takes a little longer then normal – Trekeyus Dec 15 '15 at 15:19
-1. I have downvoted your post. Here's why: I've spent more time looking into the matter. Your suggested technique is probably 100% mistaken. It may deceive readers into thinking that it helps, but the technique actually does nothing. – unforgettableid Jun 3 at 15:00
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. Instead, it does something else. Therefore, "sdcard -f" won't do what the querent wants. I know you meant well, but whenever you're not sure, please edit your answer to make it very clear that your answer is only a guess. – unforgettableid May 30 at 18:54

protected by Community Jul 15 '15 at 12:46

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

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.