SD card lost with message "Removed SD card" after update to cyanogenmod - G1 General

Did not get any help in cyanogenmod thread, so creating a separate thread here.
I am in trouble. After I updated my ROM to cyanogenmod 3.6.7.2 (with his recovery image 1.3.1 and latest radio) I get a message saying: "Removed SD Card" in the notification and I am getting force closes in apps which access sd card.
Why did it remove my sd card? I have the following partition structure"
c (formatted fat32) 2GB - this is what used for upgrading the radio and rom.
83 (formatted ext4) 6GB
c (formatted fat32) 7GB
82 (mkswapped) whatever left off from 16GB card.
Is this structure causing the issues? I used Linux 2.6.30 and e2fsprogs 1.41.7 to format ext4 and dosfstools 3.0.2 to format fat32 FSs.
I ran fix_permissions from recovery console because I was getting FCs in powermanager (which logs files on SD card).
Also, if I boot into the recovery console, I can mount /sdcard and it automatically mounts the first fat32 partition on /sdcard. I can 'fdisk -l' and see all my partitions are there. So, its not a hardware issue. Some sort of chicken&egg because of apps2sd.
I just mounted the partition2 (which is ext4) in recovery console and I can see there are "app app-private dalvik-cache lost+found" folders on it. So, it looks like normally initialized.
Does anybody know what's going on here? Appreciate your help!

It's the same response you've been getting in the other section.
Try backing up your data on your computer, and completely formatting your card to fat32.
From there, instead of making the partitions on the computer, use the Recovery Console (accessed from Cyano's Recovery) and re-create the partitions as you like.

Ok, I delete the 3rd and 4th partitions, and it seems to be working fine now. So, it seems like there is an assumption about the partition structure in the code somewhere.

devsk said:
Ok, I delete the 3rd and 4th partitions, and it seems to be working fine now. So, it seems like there is an assumption about the partition structure in the code somewhere.
Click to expand...
Click to collapse
So you are all good now?
What exactly did you do? Just remove the 3rd & 4th partition, without formatting?

akapoor said:
So you are all good now?
What exactly did you do? Just remove the 3rd & 4th partition, without formatting?
Click to expand...
Click to collapse
Yeah, I just removed the 3rd and 4th partitions from recovery console and the card is recognized and working fine. Now, I need to find out why is it hard coded like that.

It seems like something doesn't like more than 3 partitions on the SD card. I now have 3 partitions with 'c' (fat32), '83' (ext4) and 'c' (fat32) codes and it seems to work fine.

An ext partition of more than 1.5gb can cause problems
Most roms will not work with the way you had it set up (at least not well)
They follow a 3 partition scheme as such
FAT32 > EXT > SWAP

B-man007 said:
An ext partition of more than 1.5gb can cause problems
Most roms will not work with the way you had it set up (at least not well)
They follow a 3 partition scheme as such
FAT32 > EXT > SWAP
Click to expand...
Click to collapse
I've heard this repeated elsewhere but nobody ever actually says what the problem is with partitions greater than 1.5gb. I'm very curious to know, because I haven't noticed anything wrong.
Except that /sdcard won't automount if my sd card has 4 partitions defined on it. As soon as I mark the 4th one empty and reboot, it's fine again. But that has nothing to do with the size of the ext fs on partition 2. Something with vold is funky, because I can mount /sdcard manually from adb.

Related

Corrupted SD Card

I'm running CM 4.1.11.1 I think and just recently new apps wouldn't install, so I rebooted and all of a sudden all of the apps just turned into the standard icon and none of them said they were installed except for like 3 or 4 of them. I think the SD card is alright, but must have some kind of error in the ext filesystem as I can see all of the files on the FAT32 portion just fine. Do you guys know of any way to just fix the errors on the ext portion without reformatting it? Or do I have to kill all of the partitions and redo them?
You could use the repair ext filesystem option if you are running a recovery image that has it (Cyanogen 1.4 or RA 1.2.3) or just reformat the ext partition using gparted under linux.
Yeah, the repair ext thing didn't work. I think I may just have to clear off the entire card and start from scratch.
I got the same problem
then I backup all the apps up with: tar cvf /sdcard/backup.tar /data/app/*
then copy backup.tar to your desktop pc
then reformat your tf card and repart the partitions
when it's done,move it to your tf card FAT32 partition again
insert to your Phone
the install CM ROM
when it's done
enter the terminal or adb shell
cd /data/app
tar xvf /sdcard/backup.tar
(if it says read only filesystem something you can try reboot )
then check to make sure all the .apk files are under the /data/app directory
then type
fix_permissions
when it's all done reboot
if some apps' error
reinstall them
that's all I did
good luck to you ;-)
oh,I suggest that the size of your ext3 partition should under 400MB
that't the key to solve the problem I thought

Apps 2 SD on Modaco 1.1 ROM

Hi there,
I've got everything working on my newly reflashed Sprint Hero. (Thanks to everyone that contributed to the gigantic thread....read all (currently) 28 pages...you guys made it easy).
My question is whether apps 2 sd is actually working?
I've put completely bare ROMs on my hero (reverted back to stock ROM, wiped it, wiped & partitioned the sdcard to fat32, ext2 & swap, then flashed with 1.1). I then go to install an app and it doesn't show up on the SD card and my internal memory decreases (indicating that its not on the SD card?)
Don't think I've missed any relevant details, but Im keen to get this working.
Any help would be greatly appreciated.
It sounds like you did everything correctly.
try this:
adb shell
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cd /system/sd
ls
This should say:
[0;0mapp [0m
[0;0mapp-private [0m
as in /system/sd/app
/system/sd/app-private
then type:
cd /system/sd/app
ls
this should list the programs on the ext2 partition of your sdcard and, if you type:
cd /data/app
ls
you would still see the programs listed, but it is just telling you what you have installed they are not actually there, from what I understand.
Also, the internal memory on my phone also went down, but it went down 5 or so mb instead of 20 or so mb.
While I'm here would you mind telling me if when you said
dom2114 said:
(reverted back to stock ROM, wiped it,...
Click to expand...
Click to collapse
do you mean you reverted to a Nandroid backup then you performed a factory reset, and then flashed with 1.1, because I was wondering if this is possible?
hi there crake
really appreciate the detailed reply.
did everything you said and everything was exactly as you described, except that in /system/sd, i also have a lost+found folder
did the next 2 steps you outlined and yes, /data/app was a duplicate of /system/sd/app. I didn't realize that these were the locations (one being the actual location and the other being the 'symlink') of the ext2 partition.
One final question for you. How big was your fat32 partition? It didn't look like there was a way to control how big you want the fat32 partitions relative to the ext2 partition (& the swap partition...not sure what that is).
In answer to your question: yes, thats exactly what I did.
I wanted a 100% free implementation of modaco 1.1 (i.e. no apps etc). Here's what i did just FYI:
Flashed my nandroid backup back on
Hard reset it
Turned the phone on and just put my basic gmail/facebook login details in
Turned it off and decided to take another nandroid backup in case I wanted to go back to this state...(so I now have 2 nandroid backups)
Enabled USB transfer and copied this new backup off
Wiped the SD card & dalvik cache and then partitioned the card to fat32, ext2 and swap
Transferred the Modaco ROM to the SD Card
Flashed the phone w/ Modaco
End result was a 100% 'stock' Modaco ROM...if that makes any sense.
Appreciate an answer and any info as to the partition sizes.
EDIT:
Realized that this 'new backup' I performed (in the 4th step above) is useless if I end up wiping/repartioning the sdcard as this ROM refers to apps that the modaco ROM moved to the SD. These will obviously be removed after a format/repartition.
Thanks for the info, I used the 2gb (1.8-ish) sd card that came with my phone, after partitioning, the fat32 partition was somewhere around 1.4 gb. There was no option to modify partition size so I assumed it partitions the ext2 to a predetermined size and the rest is partitioned as fat32.
crake001 said:
Thanks for the info, I used the 2gb (1.8-ish) sd card that came with my phone, after partitioning, the fat32 partition was somewhere around 1.4 gb. There was no option to modify partition size so I assumed it partitions the ext2 to a predetermined size and the rest is partitioned as fat32.
Click to expand...
Click to collapse
I believe its around 450MB, mine is like 446MB as ext2, the rest of my 8GB sd card is FAT32. It automatically did this, but when I go to All Applications, Apps to SD isn't even listed as an installed application. I went to the market place and installed Apps to SD 2, and it told me I needed to read the tutorial (wtf ?).
So my guess is, the MoDaCo ROM does all the work for you that the Apps to SD program would normally do, and it just always saves it to your SD card.
simplyphp said:
I believe its around 450MB, mine is like 446MB as ext2, the rest of my 8GB sd card is FAT32. It automatically did this, but when I go to All Applications, Apps to SD isn't even listed as an installed application. I went to the market place and installed Apps to SD 2, and it told me I needed to read the tutorial (wtf ?).
So my guess is, the MoDaCo ROM does all the work for you that the Apps to SD program would normally do, and it just always saves it to your SD card.
Click to expand...
Click to collapse
Yeah, thats the conclusion I came to. In the adb shell, if you type apps2sd, something starts happening...Im not smart enough to know what though. Figured Id mention if someone wants to play around
Thanks you all for the info. This was exactly what I was looking for. Wanted to know the size of the ext2 partition and how to control it if we even could but looks like it's automatic as stated. Then to find a way to check to make sure the apps were getting installed on the partition.
I installed the MoDaCo 1.1 over top of all my apps/settings etc. I do have my SD card partitioned via my recovery image option.
What do I need to do to get all those apps over to my sd card and off my phone?

ICS Device Encryption and SDCARD Impact

Damnit.. My company required encryption of the data on my Nexus S when I was testing ICS Beta with Email / Exchange.
Went ahead and encrypted the device.
Then, I wanted to install ICS Combo Beta 11, so I formatted /system /data /boot and tried to install from /sdcard/*.zip.
No luck.
Clockworkmod recovery cannot mount /sdcard anymore.
Wanted to try and format it, but the clockworkmod tries to mount it first, before formatting
HELP!
I'm stuck with only recovery now and no way to get the update package installed
Is there a way to install from zip via the command line?
You should be able to use fastboot to load the rom on your device. I haven't tried it this way before but it should work:
Code:
fastboot update rom.zip [-w if you want to erase data too]
Give it a spin.
The SDCard not being able to be mounted has been covered a few times but I can't recall the proper fix by heart - search around and you'll definitely get some results that can help you with that.
Greetz
Sounds like it's busted.
Sent from my Nexus S using xda premium
Can you still enable USB Mass Storage in recovery? Try reformat the SD from your desktop?
Si_NZ said:
Can you still enable USB Mass Storage in recovery? Try reformat the SD from your desktop?
Click to expand...
Click to collapse
Thought about that, but what filesystem? FAT32?
Sure
Greetz
I had the same problem with one of the first ICS betas.
Formatting to FAT32 on my Mac was not enough, I had also to reformat under Android. Hope, you backed up your data
dr911 said:
I had the same problem with one of the first ICS betas.
Formatting to FAT32 on my Mac was not enough, I had also to reformat under Android. Hope, you backed up your data
Click to expand...
Click to collapse
Definately backed up..
This was a real scare.. I couldn't mount or format from clockworkmodrecovery. All I had was the adb shell and the builtin /sbin commands.
LUCKILY I found this article;
http://forum.cyanogenmod.com/topic/...mmcblk0++mkfs++ext2__fromsearch__1#entry56396
It didn't exactly match what I was experiencing, but the key was the parted program.
Using it, I was able to reformat my media (partition 3) and am now able to repush things to it.
Stupid sdcard encryption..
Reinstalling ICS Beta 11 now
Blood pressure slowly decreasing.. damn that was a nightmare
So some lessons learned;
DON'T try to partition your SDCARD from clockworkmod or Windows or Mac. The USB storage presented to your computer is a single partiton from you mmcblk0 sd storage. If you partition it, you've got a partition inside a partition which will only make sense to your windows/mac system. Inside of Android, the partition is essentially corrupted and it won't mount.
Formatting from Windows only makes it appear to be working.. in reality you've created a second partition and it's corrupted from the Android point of view.
parted is the only way to fix it. from parted do mkfs type fat32 partiton 3 (media) that will reformat the partition correctly and give you access from Android and external USB hosts.
That's weird...
People have been able to format the SD as ext4 on a desktop using Ubuntu for example. I don't understand how that is different to mkfs.ext4 vs mkfs.vfat. I mean why am I confined to formatting on the phone itself? I'm really confused now.
On a side note. What you experienced is totally expected if you think about it carefully. It's like you have just lost the key to open your SD content by wiping the phone, of course it can no longer be mounted. But I'm not sure why it cannot be simply formatted in CWM.
nauckwj said:
Formatting from Windows only makes it appear to be working.. in reality you've created a second partition and it's corrupted from the Android point of view.
Click to expand...
Click to collapse
That means, I should check my SD Card, which I formatted under OSX with Disk Utility?
Maybe I'll do it next time I flash a new ROM, because for now it works fine.
nauckwj said:
Blood pressure slowly decreasing.. damn that was a nightmare
Click to expand...
Click to collapse
Yeah, I had a similar situation a few weeks after I got my beloved NS when I tried Whispercore. The hole NS got encrypted and formatting the system partition in CWM didn't work, but what I read it was luckily due to a problem with the CWM version. Flashing a newer Version of CWM solved the problem. First I was dying!
So, when I encrypted with ICS and got this problem I calmed down much faster
Si_NZ said:
That's weird...
People have been able to format the SD as ext4 on a desktop using Ubuntu for example. I don't understand how that is different to mkfs.ext4 vs mkfs.vfat. I mean why am I confined to formatting on the phone itself? I'm really confused now.
On a side note. What you experienced is totally expected if you think about it carefully. It's like you have just lost the key to open your SD content by wiping the phone, of course it can no longer be mounted. But I'm not sure why it cannot be simply formatted in CWM.
Click to expand...
Click to collapse
My problem was I used the Windows fdisk partitioning utility to repartition my /sdcard partition. That was part of the problem. I did also read how some people were repartitioning the /sdcard partition, which is kind of weird. I can understand why someone might want to reformat it as an ext4 filesystem, but why would you want to partition a partition?
The /sdcard partition is actually the third partition on your mmcblk0 device. If you partition it, most utilities will fail to recognize it as a valid media device anymore, because they expect to be able to read the filesystem data structures when they mount it. These won't exist if a partition table is sitting at the beginning of the blocks.
I couldn't reformat from within CWM because it first tries to mount the partition. if it fails to mount, CWM won't reformat it. Only way to reformat it was with parted, unless you have a working system installation.
Last night I was also able to reformat it from within ICS. Had to do a full factory-wipe from within ICS, then it indicated the sdcard was no longer valid and asked me if I wanted to reformat it. Once I said yes, all was back to normal.
Fun fun

[Q] Re: "Dualboot Mirage CM7 / ICS CM9 Image": can't resize sdcard volume.

This question probably belongs in the thread "[ROMS]NEW! Dualboot Mirage CM7 / ICS CM9 Image for SDcard [3/26]", except that I can't post there yet.
I was able to create a working dual boot card per the instructions. However, I could not make a working card that made use of all 16 GB of my card, rather than just the <4GB size of the image file. The card still worked when I used fdisk on my Mac to increase the size of the last, 'sdcard', partition to fill up the available space. However, that did not increase the capacity of the FAT volume in that partition, leaving the extra space still unavailable.
After saving the files from that volume, I then used the Mac's Disk Utility to erase the partition and re-create it as a FAT partition using all the available space. Once I did that, unfortunately, the Nook would then not recognize anything on the SD card and would only boot into the Nook's own ROM.
As an alternative, I tried leaving the existing partitions alone and editing the MBR with fdisk to create a new partition using the available space, which I then formatted as a FAT partition with Disk Utility. Again, the Nook would no longer recognize the SD card and would only boot into its stock ROM.
I actually tried the above with two 16GB SD cards, a SanDisk Class 4 and a Samsung Class 10, and with two Nooks. Moreover, I tried a number of manipulations of the MBR, mostly to make it identical to the original one except for necessary size changes. Nothing worked to get a card that would boot and use the full 16 GB. I'll admit I haven't tried everything, such as trying to resize to something less than the full 16GB, but I've put so much time into this already that I don't want to do any more until I get some feedback.
aarons510 said:
This question probably belongs in the thread "[ROMS]NEW! Dualboot Mirage CM7 / ICS CM9 Image for SDcard [3/26]", except that I can't post there yet.
I was able to create a working dual boot card per the instructions. However, I could not make a working card that made use of all 16 GB of my card, rather than just the <4GB size of the image file. The card still worked when I used fdisk on my Mac to increase the size of the last, 'sdcard', partition to fill up the available space. However, that did not increase the capacity of the FAT volume in that partition, leaving the extra space still unavailable.
After saving the files from that volume, I then used the Mac's Disk Utility to erase the partition and re-create it as a FAT partition using all the available space. Once I did that, unfortunately, the Nook would then not recognize anything on the SD card and would only boot into the Nook's own ROM.
As an alternative, I tried leaving the existing partitions alone and editing the MBR with fdisk to create a new partition using the available space, which I then formatted as a FAT partition with Disk Utility. Again, the Nook would no longer recognize the SD card and would only boot into its stock ROM.
I actually tried the above with two 16GB SD cards, a SanDisk Class 4 and a Samsung Class 10, and with two Nooks. Moreover, I tried a number of manipulations of the MBR, mostly to make it identical to the original one except for necessary size changes. Nothing worked to get a card that would boot and use the full 16 GB. I'll admit I haven't tried everything, such as trying to resize to something less than the full 16GB, but I've put so much time into this already that I don't want to do any more until I get some feedback.
Click to expand...
Click to collapse
Well you're missing just one step after fdisk. If Disk Utility is failing at it you could try terminal:
First you need to find out where your /sdcard is being mounted at. Use "diskutil list" to find out
Once you find out where it's being mounted (eg. /dev/disk4s7). You will then need to unmount the volumes before you can format it.
Code:
$ diskutil unmountDisk /dev/disk4s*
$ diskutil partitionDisk "/dev/disk*" 1 MBRFormat "MS-DOS FAT32" "sdcard" "*M"
Replace * with the actual values needed. You might need "sudo" to perform the format command. Make sure you're formatting the correct mount point or else you might end up wiping your system. But if you were able to use fdisk, I'm sure you have a good understanding of terminal.
Haven't tried it myself. But it should(might) work.
-Racks
Won't "diskutil partitionDisk ..." wipe out all volumes on disk?
racks11479 said:
[See previous post!]
Click to expand...
Click to collapse
When I type
Code:
diskutil partitionDisk
in Terminal to get usage info, I see, inter alia, the following:
Code:
(Re)Partition an existing disk. All volumes on this disk will be destroyed.
But that is clearly not what I want to do. Am I missing something?
Updated update:
I have tried, several times and on both SD cards and both Nooks, diskutil eraseVolume, a presumably more powerful version of the erase option in Disk Utility. I tried one or another of the commands:
Code:
diskutil eraseVolume MS-DOS sdcard /dev/disk4s7
diskutil eraseVolume 'MS-DOS FAT32' sdcard /dev/disk4s7
on cards that were booting, but with the small sdcard partition or the small volume on the enlarged partition. I also tried at least one of those commands on a card that was already not working after modification. In all cases, the commands ran without error but produced a non-booting card. Changing the 'ob' partition id back to 'oc' with fdisk didn't help, nor did any restoration of the original fdisk MBR info.
In sum, the only change that I have been able to make to a card as originally written from the image without making it unbootable was to enlarge the sdcard partition while leaving the sdcard volume untouched, and therefore not using most of the capacity of the partition.
Some more general but related questions.
Since I've got your attention, Racks, let me ask a few questions whose answers might help me and others understand what is going on here and what might go wrong with this and other Nook Color boot setups. Of course, also please point out where anything I think I know is, in fact, wrong.
1) I understand that the firmware boot code on the Nook first looks for something on an inserted SD card to boot from. It seems it looks for a file named u-boot.bin on the first partition of the inserted card to which to transfer control. Does it also check other things on the card before transferring control to u-boot.bin? Does it look at the file MLO? Does it look at the partition labeled sdcard, or at any other partition, before doing so?
2) Presuming that it does transfer control to u-boot.bin, what does the latter check before either booting from the (default) ROM on the card or, if the Home button is being held down, going to the interactive boot dialogue? My experience has been that, when using one of my 'non-working' cards, the Nook goes quickly to the ROM on internal memory without showing any visible signs of doing anything else first. In other words, it 'knows' that it can't boot from a ROM on the sdcard before actually trying to do so.

Copying from one partitioned SD card to another

I'm trying to understand the most convenient way to make a copy of an SD card that has an EXT partition on it. This would need to be done anytime you upgrade from a smaller to a larger SD card, so I have to believe a number of people on these forums have dealt with it.
This is what I'm expecting to be done... please confirm if it's correct:
Make a nandroid backup, stored on the old SD card
Copy the nandroid backup to PC
Install new SD card and partition it accordingly
Copy nandroid backup to new SD card
Perform a nandroid restore
At this point, everything should be as it was, with the larger SD card. Correct? I've also noticed an alternative that would probably work, that being a partition management program like EaseUS.
My 32Gb SD card arrived so I downloaded Mini-Partition to set it up. Then when I went to copy the EXT3 partition from my 8Gb SD card, the option wasn't possible. Apparently I can't copy it into a larger EXT3 space, only unallocated space. So, I removed the target EXT3 partition, making it unallocated, and then tried to copy and resize. Apparently the tool won't let you resize an existing EXT3 partition. I installed EaseUS to try this operation and encountered the same thing.
From what I've just experienced, I'm now thinking that if I try to restore a nandroid backup onto my new card, it will override the newly minted EXT3 partition with the smaller EXT3 partition.
Searching around turned up a lot of Ubuntu/Linux information, requiring one to boot up in those operating systems and execute a long series of commands to enlarge the EXT3 partition. I'd rather not go down that path right now. Is there some easier way of doing this? If not... then I'm thinking what I need to do is move as many apps having data I need to my phone, then just opt not to restore the EXT3 partition and go back to manually move apps to the EXT3 partition again.
* bump * .... anyone?
cytherian said:
* bump * .... anyone?
Click to expand...
Click to collapse
What rom are you running?
Shelnutt2 said:
What rom are you running?
Click to expand...
Click to collapse
Presently running CM7.2, which supports EXT3. I'm just not getting how I can manage the EXT3 partition. When I switch to a new ROM and wipe the system, then all apps installed on the EXT3 partition would be deleted, correct?
So, what this ultimately means is that each and every time I switch ROMs, the EXT3 partition must be wiped and applications manually moved back there. It's annoying, but I haven't found any other way around this.

Categories

Resources