Android OS Forum banner

Fixes for SDCARD issues for all versions of CyanogenMod

305K views 305 replies 82 participants last post by  nevertells 
#1 · (Edited by Moderator)
Here are a some fixes that should help with some (most?) of those having
'sdcard' issues (or hoping to avoid them):

The first fix should be applied by everyone. It fixes the fsck_msdos
program. This program is used to check your 'sdcard' for errors before
using it. This program can also correct many of these errors. After
this fix is applied, you should see a notification after booting:

Preparing SD card
Checking for errors.

This notification will last until it is done checking. That will last
around 30 seconds (can vary greatly depending on size of 'sdcard' and
number of files on it, etc.). If this notifcation is replaced with
one that states 'Damaged SD Card', then the fsck_msdos was unable
to correct the errors. Hopefully, with this fix (barring some other
major incident), all of the minor errors on the 'sdcard' will get
fixed before they become major errors that it cannot fix.

The fsck_msdos fix: http://www.mediafire...g52q4zr03c3z1gx
Apply with your favorite recovery software.

NOTE: The fsck_msdos fix should be applied before any of the other fixes.
Also, you should boot at least once after applying the fix to allow
it to check/fix the 'sdcard'.

The other fixes are not true fixes, but work-arounds for the 50+
apps on sdcard issue. One of them allows you to increase the size
of your 'Internal storage' so you do not have to move apps to the
'sdcard'. The other allows you to move these apps back to the
'Internal storage' after you have encountered the 50+ issue.

After the "Preparing SD card" notification goes away, after about
a minute (can vary), do you see the following notification:

Removed SD card
SD card removed. Insert a new one.

If so, that (most likely) means that you have encountered the
50+ issue. To fix it, you will need to move apps back from
the 'sdcard' to the 'Internal storage' (or 'phone').

The next fix/workaround allows you to 'stash' some of the apps
on the 'sdcard' so that the 50+ issue does not come into play.
This will allow you to move apps back from the 'sdcard' without
encountering the "Removed SD card" error while attempting to do so.
Each time you apply this 'fix', it will 'stash' all but 40 of
the apps on the 'sdcard'.

So, apply this fix once. Then move apps back from the 'sdcard' to
the 'phone' (or 'Internal storage'). Note that apps that have been
'stashed' might show with a greyed-out icon with an 'SD Card' symbol
and the letters 'SD' -- do not attempt to move these. After you
have moved the apps from the 'sdcard' back to 'phone' (those that
haven't been 'stashed'), you apply the fix again. Applying the
fix the second time will 'unstash' the remaining apps (remember
that it will not allow more than 40 apps to be 'unstashed') thus
allowing you to move them off the 'sdcard' too.

Get it here: http://www.mediafire...4n3fhag1d33127q
Apply with your favorite recovery software.

The last fix/workaround allows you to increase the size of your
'Internal storage'. This will allow you to store more apps on
your 'Internal storage' and avoid having them on the 'sdcard'.

To check your current 'Internal storage' space, go to
Settings/Storage and note the values under 'Internal Space'.
If the size of the 'Available Space' is not enough to hold
all the apps you are moving back from the 'sdcard' (or apps
that you will install in the near future), you will need
to increase the size of your 'Internal Space'.

You can increase the size of your 'Internal space' (or /data)
in increments of 256MB, 512MB, 1024MB and 2048MB. You apply
these 'fixes' with recovery software (tested with CWM and TWRP),
however, please note the warnings below.

********** PLEASE READ ALL WARNINGS BELOW **********
********** PLEASE READ ALL WARNINGS BELOW **********
data_plus_256mb: http://www.mediafire...gxqjki8s255lwpw

data_plus_512mb: http://www.mediafire...wh83t6urhnf82ad

data_plus_1024mb: http://www.mediafire...zaeh4fd3pjinaga

data_plus_2048mb: http://www.mediafire...xyxdx7xscee6mex
********** PLEASE READ ALL WARNINGS BELOW **********
********** PLEASE READ ALL WARNINGS BELOW **********

WARNINGS:

1) BACKUPS. BACKUPS. BACKUPS. As always, and especially when you
are resizing filesystems, you should have backups. This means
backups of all data (that you would care about losing) on the
Touchpad. These backups should be stored off of the Touchpad.

2) Before attempting to resize your 'Internal space' make sure
you have enough free space on your 'sdcard' to do so. Check
this from Settings/Storage/SD card/Available Space. You should
have enough space plus a very healthy 'safety margin'.
DO NOT ATTEMPT TO TAKE ALL (OR CLOSE) AVAILABLE SPACE FROM SDCARD.

3) Before applying this 'fix', make sure you have plenty of charge
on your battery.

4) Do not reboot, reset or otherwise interrupt the touchpad while
applying this 'fix'.

5) As soon as this 'fix' is complete, use the recovery software's
reboot command to reboot the system. Do not do anything else
in recovery after applying this 'fix'. This 'fix' does things
that recovery software are not designed to do and does not
expect to happen. REBOOT IMMEDIATELY AFTER APPLYING FIX.
 
See less See more
#5 ·
Excellent to see an alternative method to increase the internal partition size that is far more accessible, kudos for the post. About the fsck_msdos fix: What is the fix changing? Adding/changing command flags, using a different version, etc? Always curious before I apply any changes. Thanks.
 
#6 ·
It was found that the original Android version of fsck_msdos did not work well with how webOS wrote data to the filesystem, so it was disabled.
The version that webOS uses (actually dosfsck from dosfstools) was tried, but the version that webOS uses (2.11) is fairly old and it did not port
over to the Android libs very well. The latest version of dosfstools (3.0.12), however, ported over to the Android libs much better. I used that
and modified the command-line parameters and return values so that they are more consistent with what Android expects from fsck_msdos.

This version has been in 'limited testing' for the last week (137 downloads currently) and seems to be working quite well. There were a couple
revisions prior to this one that didn't have the return values/parameters quite right (it can be difficult to uncover these issues until you get it
out to people with filesystem errors to test).
 
#7 · (Edited by Moderator)
First, thanks, JC for some excellent work on cm7 and the fixes you have developed. They are greatly appreciated. I installed your fschk fix and see that the touchpad checks the file system at each boot. That part worked great. I then attempted to install the 1024 system. Space increase but it failed. I am using TWRP 2.0 instead of CWM for flashing and cannot get a screenshot of the failure but this is the output from TWRP:

Preparing tools
Checking media
Media : 10896 =>9872 cm-data : 1536 => 2560
Media_fs tot = 10885 sz=3034 free = 7851
Checking cm-data
Fsck cm-data failed rc=4
>>FAILED
 
#8 · (Edited by Moderator)
This means it is refusing to do the resize because it found 'uncorrectable errors' on the /data partition.
It will automatically fix errors that are deemed 'always safe to fix'. However, it will not attempt to fix
those that are not 'always safe to fix'.

There is another mode that can be used that will attempt to fix anything it can. Fix, in this sense,
means that the filesystem is in a consistent state. That could mean that some files that are not
in a consistent state are removed. However, if it remains in an inconsistent state, worse could
happen. If you would like to perform this 'more aggressive' filesystem check/fix, you can do
so with this update: http://www.mediafire...vfrwbox4a9i6y2o This update does not try to
resize the filesystem, it only performs the more aggressive check. If you go ahead with it (and
it does not fail), you can then try the resize again.

UPDATE/WARNING:
Since this 'more aggressive' filesystems check/fix may remove files, you may need to recover
from backups after running it.
 
#20 · (Edited by Moderator)
Hi JC,

I just applied the first fsck_msdos fix and it seemed to go well. I saw the notification for preparing SD card, checking for errors and there was no dialog suggesting errors.

I was thinking about doing the fix to expand internal storage, so I went into Settings/Storage to see how much space I had. I set my TP aside while I was reading this thread and my screen timed out as usual after 2 minutes. When I pressed power to bring it back up, I got a FC message. This FC seems to be just in Settings/Storage and is repeatable. I get the FC whether my screen times out, or I press power to shut off the screen. I also tried bringing the screen back up with the "hard" home button and still get the FC.

It's not really a big deal because I'll hardly ever be in the storage screen but I figured I would let you know. Thanks.

Btw, I cleared data in settings but the issue still persists.

Edit: I'm not so sure that this wasn't already an issue with 3.5, maybe just a coincidence that I happened to see it after installing the fix???

Mike T
 
#23 ·
James, appreciate the informative posting and research.

Was moving app data over to sdcard, a few apps at a time. But then received error, similar to "no sd-ext found" and "E: unknown volume for path [sd-ext]". I suspect I hit the 50+ app limit. Unfortunately discovered this very informative thread AFTER I did a factory reset via CWM Recovery. Then after that I remembered I had done a CWM Recovery Backup the night before (duh), so I ran a restore.

So all appears well in that regard (except losing data to apps which were installed after the orginal backup). No biggy.

However looking at /sdcard in File Manager listings, it appears that orphaned app data directories/files now litter the directory and subdirectories. How would one identify and remove orphaned/unwanted app data files or at least compare to current files/directories.

On a related note, do any WebOS apps and Android/CM7 apps use the very same data directories to store data files, possibly with same filenames? For example, Angry Birds HD/Seasons/Rio ? What might be the implications (pro and con)?

I wish to locate a good overview of CM7 and WebOS directory/file structures on the TouchPad and the potential boot system/file system interaction issues. Any recommends?

Thanks again for the helpful posting.
 
#48 · (Edited by Moderator)
Was moving app data over to sdcard, a few apps at a time. But then received error, similar to "no sd-ext found" and "E: unknown volume for path [sd-ext]". I suspect I hit the 50+ app limit.
Re: my previous post #23...Ran the fsck_msdos fix. On reboot observed the preparing/checking notification. I did not run the other two fixes.

When I run CWM backup, I continue to observe "No sd-ext found".

In the File Manager I observe sd-ext directory, but it is empty.

I assume this sd-ext is the "internal Space" referred to in Settings > Storage?

What specifically is the function of "sd-ext" and why is backup not finding it and/or why is it empty?
 
#24 ·
I have never had any "noticeable" SD card problems, but I installed the " fsck_msdos fix", and rebooted,
I could see the notification, but no warnings or anything.

I then tried running "data_plus_1024mb" and got the "cm-data failed rc=4" so I made a backup and ran
webOS Doctor and ACMEUninstaller, and then after webOS was back up I manually removed all files that
I put on the HP Touchpad and what was left from Android, and then ran ACMEInstaller and only installed
"Clockwork Recovery" and Moboot, when "Clockwork Recovery" and Moboot were installed I restored
from backup, and then tried the "more aggressive filesystems check" and it shows "cm-data failed rc=1"

What now?
 
#25 · (Edited by Moderator)
I just ran webOS Doctor again, but before I did I put "Clockwork Recovery" and Moboot into cminstall,
so that I could bypass webOS setup, after ACMEInstaller, I ran "Clockwork Recovery" and tried the
"more aggressive filesystems check" first, and it still shows "cm-data failed rc=1"

I then ran "wipe data/Factory reset" and tried the "more aggressive filesystems check" again and it still
shows "cm-data failed rc=1"

I also retried the data_plus_1024mb" and got the "cm-data failed rc=4"
 
#26 · (Edited by Moderator)
I had the same "cm-data failed rc=4" issue and was able to get past it.
1. Took a nandroid backup of my Alpha 3.0 and copied it to my PC
2. Used the ACMEUninstaller to uninstall CyanogenMod
3. Logged into WEBOS and connected the TP to my PC.
4. Formatted the HP Touchpad disk (FAT32 - Quick Format)
5. Created the cminstall folder, copied the installation and followed the steps to install CyanogenMod Alpha 3.0
6. Followdd the steps to check the card for errors and installed the data plus 2048mb successfully
7. Copied the Nandroid backup to clockworkmod/backup directory and restored the backup.

Im not sure this will work but, you could just copy everything from your touchpad to your PC, format the drive and recopy everything back. Take the backup before you try this though.
 
#27 ·
I had the backup on my computer already, I did the webOS setup/login and ACMEUninstaller, then formatted with
"Disk Utility" under OS X, I restarted webOS, then made the "cminstall" and "clockworkmod/backup" folders for my
backup and the "Clockwork Recovery" and Moboot files, then ran ACMEInstaller, then ran the restore, then booted into
android, restarted, then installed "fsck_msdos fix", restarted, then tried running "data_plus_2048mb" and still got the
"cm-data failed rc=4".

Is it my backup, if so how do I fix it?
 
#30 ·
I have four touchpads. One for my wife and one for each of my kids. One was a clean install today of 3.5. Anyway, all of them worked with the first fix (sd card check), and none of them work with the "more aggressive fix" and none of them worked with trying to increase the internal storage fixes. I always get the "cm-data failed rc=4". Made sure data was not mounted (CWM), and ran fixes, but all failed. Not sure if I am missing something, but it sounds like this is not working for a lot of people. I appreciate the effort though....
 
#32 · (Edited by Moderator)
The only real issue that I've seen reported is due to corruption on the /data filesystem. This has been mentioned by six people (including you).
Only one person has reported not being able to (thus far) be able to correct those errors with the steps I've provided in this thread. I would
suggest using ACMEUninstaller (see previous posts) to get rid of the corruption on the /data partition.

UPDATE:
The current number of people who report not being able to apply the fixes after following the steps I've provided in this thread: ZERO.
 
#34 ·
I really do not know how this happened, but I seem to have lost the FS on my SDCard. When I connect it to my PC and try to mount it, Windows sees it as a RAW device and wants to format it. Linux sees it similarly:

Code:
<br />
[  198.378127] USB Mass Storage support registered.<br />
[  199.395003] scsi 3:0:0:0: Direct-Access	 HP	   webOS-device	 0327 PQ: 0 ANSI: 2<br />
[  200.202950] sd 3:0:0:0: Attached scsi generic sg2 type 0<br />
[  200.228155] sd 3:0:0:0: [sdb] Attached SCSI removable disk<br />
[  225.033488] sd 3:0:0:0: [sdb] 26738688 512-byte logical blocks: (13.6 GB/12.7 GiB)<br />
[  225.499597]  sdb: sdb1<br />
[  226.678585] FAT-fs (sdb1): bogus number of reserved sectors<br />
[  226.678589] FAT-fs (sdb1): Can't find a valid FAT filesystem<br />
How do I properly format the FS on my SDCard?
 
#39 ·
Hi JC,

Just wanted to let you know that I applied the data plus 2048mb fix today. Followed your instructions exactly and it went through beautifully. My 32gb TP had approx. 25.52gb SD total space before and 23.52gb after. My internal went from approx. 1.45gb total space to 3.45gb and all seems to be working well.

Thanks again,

Mike T
 
#42 ·
If one does a restore after applying these fixes.... does the restore overwrite the fsck fix ????
Yes it does. I installed the fsck fix, rebooted, saw it run, used Root Explorer to verify fsck_msdos was in the system/bin folder. I restored a backup and then looked in the system/bin folder and it was gone. So installed the fix again and it was there. As JC recommends, I strongly recommend everyone at least install this fix to protect their SD card.
 
#43 · (Edited by Moderator)
Hey JC,

You might want to add a sixth warning to the OP that if one restores a backup after flashing your fsck fix, that they will have to do it again as the backup does overwrite the file your fix installs.
Once they do a backup after your fix is installed, then they are ok. Also a note for your instructions, to see the output of what the fsck fix does, one must pop up the notifications so see it.

I ran your fix on both my TouchPads and neither showed any errors. However, neither would take the memory update successfully. I have already done the uninstall on the first one and
after reinstalling Android, the memory upgrade ran perfectly. Nice to see 3.5 gigs of internal memory. I tried installing the fsck fix at the same time I installed everything else, but it did not
appear to work. So ran it again and now it is there and working correctly. You really know your stuff. I can't imagine many people trying successfully what vsawri is suggesting doing in the
thread he started. Hope people reading his thread see your post about using your fixes.

Just curious, do you do any programming for the CM7 team? If not, they are missing out on some serious talent. Thanks for all your hard work.
 
#52 ·
Hey guys sorry if I posted in the wrong section, I'm new to this site. Ok this is the issue I'm having, I installed UbuntuChroot on my touchpad and I liked it but I didn't have a use for it, so I deleted the partition. Sooner or later it was one partition and another. Then I thought everything was ok and then I experienced in CyanogenMod 7.1 Alpha 3.5 "an sd card is required to download ______.txt or whatever a .pdf, I can't access my Usb in in Cyanogenmod "usb connected mode" to drag files to SD card from computer. the wheel spins and keeps spinning please help sorry if Im a pest. I applied this fix ,but it didn't fix the issue
 
#53 ·
So I assume you installed the sdcard check fix from the first post. Do you get the "Preparing sd card" "Checking for errors" notification
when it boots? After the "Preparing sd card" notification goes away, is it replaced by a different notification regarding the sdcard?
 
#56 ·
If you have the problem there will be a little SD card icon in your bottom bar with an exclamation point in it. When you go to check the message it will say that the SD card is disconnected. You will also not be able to access any apps or items saved on the SD partition and their icons will be missing.

If you aren't experiencing this you don't have the problem however keep in mind as you are installing more and more apps that if you get beyond 50 on the SD partition you may experience problems. Note that many apps automatically install to SD so even if you aren't manually moving apps there you still may end up with many of them on the SD partition.
 
#57 ·
I am really not familiar with how to fix this issue. The issue Im having is that when I am installing apps(Even to my internal drive since I know now not to put many apps on the external drive) today I started having the issue again where when I turn on the touchpad some of the apps will not show up(Like they dont exist) and right now Im having to restore again since under SD card I see that it says "Card unavailable" its really a nuisance and I Really wish that they would fix this issue..for me this is the BIGGEST issue and its a real pain in the butt that I have to always be so careful about how many apps I put on my touchpad and if I install one particular app maybe something will happen..its crazy
 
#58 ·
Have you read the op and followed JC's instructions on how to error check your sd card? Have you read through this entire thread as there are other tips on how to get all apps off your sd card and onto your internal memory? If having read all of the thread and tried the fixes that JC has created that will error check your sd card, increase your internal memory up to 2 gig in size for a total of 3.5 gigs and get all your apps off your sd card and you still have this problem, then I suggest you contact HP for a warranty repair.
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top