Jump to content

Welcome to CyanogenMod

Welcome to our forum. Like most online communities you must register to post, but don't worry this is a simple free process that requires minimal information for you to signup. Be a part of the CyanogenMod Forum by signing in or creating an account. You can even sign in with your Facebook or Twitter account.
  • Start new topics and reply to others
  • Subscribe to topics and forums to get automatic updates
  • Get your own profile and make new friends
  • Download files attached to the forum.
  • Customize your experience here
  • Share your CyanogenMod experience!
Guest Message by DevFuse
 

SOLVED: messed up partitions on internal storage


  • Please log in to reply
60 replies to this topic

#1 raskolnik

raskolnik
  • Members
  • 16 posts
  • Country:
    us - United States
  • Device Model:
    Incredible
  • CM Version:
    7.0.3-Inc
  • Recovery Image:
    ClockworkMod

Posted 07 September 2010 - 10:30 PM

So, because I'm dumb, pretty sure I've bricked my phone.  I managed to accidentally format the internal storage, so most of the partitions are gone.  At least I'm pretty sure that's what happened (Clockwork can't mount DATA or CACHE, and nothing can install properly).  I found a post on another forum where someone was able to use parted to recreate the partitions, but Clockwork apparently doesn't come with parted (I certainly can't find it).

I've also seen a listing for a vanilla nandroid back-up, but (a) I'm not sure if that'll help at all, and (b) I can't try it, because the only link I can find is to mediafire, which is down.

I've been asking everywhere and no one has been able to help so far.  I'm hoping my luck'll change and that I don't have a $500 paperweight.

UPDATE:  With the help of steveo and ciwrl, it's now up and running.  See below for the fix.

Edited by raskolnik, 10 September 2010 - 08:21 PM.


#2 ciwrl

ciwrl

    Whose bright idea was it to put me in charge?

  • Administrators
  • 1621 posts
  • Twitter:ciwrl
  • Country:
    us - United States
  • Device Model:
    DS|N1|NS|G2|SGS|SGN|N4|N5
  • CM Version:
    [Latest]
  • Recovery Image:
    ClockworkMod

Posted 07 September 2010 - 10:36 PM

View Postraskolnik, on 07 September 2010 - 10:30 PM, said:

So, because I'm dumb, pretty sure I've bricked my phone.  I managed to accidentally format the internal storage, so most of the partitions are gone.  At least I'm pretty sure that's what happened (Clockwork can't mount DATA or CACHE, and nothing can install properly).  I found a post on another forum where someone was able to use parted to recreate the partitions, but Clockwork apparently doesn't come with parted (I certainly can't find it).

I've also seen a listing for a vanilla nandroid back-up, but (a) I'm not sure if that'll help at all, and (B) I can't try it, because the only link I can find is to mediafire, which is down.

I've been asking everywhere and no one has been able to help so far.  I'm hoping my luck'll change and that I don't have a $500 paperweight.

So you're saying you destroyed data and cache partitions? How the heck you manage that?

If you can still access the bootloader on your device, you should be able to apply the Inc s-off SPL (i hear the unrevoked guys have one) that should re-create anything you destroyed.

#3 raskolnik

raskolnik
  • Members
  • 16 posts
  • Country:
    us - United States
  • Device Model:
    Incredible
  • CM Version:
    7.0.3-Inc
  • Recovery Image:
    ClockworkMod

Posted 07 September 2010 - 11:22 PM

View Postciwrl, on 07 September 2010 - 10:36 PM, said:

So you're saying you destroyed data and cache partitions? How the heck you manage that?

If you can still access the bootloader on your device, you should be able to apply the Inc s-off SPL (i hear the unrevoked guys have one) that should re-create anything you destroyed.

To answer your question: gnome disk utility + carelessness :/.

Well, it's a start...it's not giving the error message about not being able to mount the DATA partition any more, but it still can't mount the CACHE.  It also still won't boot, even after re-installing an OS :/.  I get the following:
E: Can't mount /dev/block/mmcblk0p2 (File exists)
E: Can't mount CACHE:recovery/log
E: Can't mount /dev/block/mmcblk0p2 (File exists)
I should note that said file doesn't exist (I get the same error when it does and when it doesn't).

A little more info: my fstab file is set to mount the cache at /dev/block/mtdblock5.  Going through the adb shell, running mount says (among others): "/dev/block/mtdblock5 on /cache type yaffs (rw)" ... doing "mount -a", I get two error messages:
mounting /dev/block/mmcblk0p1 on /data failed: Invalid argument
mounting /dev/block/mmcblk1p2 on /sd-ext failed: No such file or directory

Thanks for the idea...any other thoughts?

Edited by raskolnik, 07 September 2010 - 11:30 PM.


#4 ciwrl

ciwrl

    Whose bright idea was it to put me in charge?

  • Administrators
  • 1621 posts
  • Twitter:ciwrl
  • Country:
    us - United States
  • Device Model:
    DS|N1|NS|G2|SGS|SGN|N4|N5
  • CM Version:
    [Latest]
  • Recovery Image:
    ClockworkMod

Posted 08 September 2010 - 12:12 AM

View Postraskolnik, on 07 September 2010 - 11:22 PM, said:

To answer your question: gnome disk utility + carelessness :/.

Well, it's a start...it's not giving the error message about not being able to mount the DATA partition any more, but it still can't mount the CACHE.  It also still won't boot, even after re-installing an OS :/.  I get the following:
E: Can't mount /dev/block/mmcblk0p2 (File exists)
E: Can't mount CACHE:recovery/log
E: Can't mount /dev/block/mmcblk0p2 (File exists)
I should note that said file doesn't exist (I get the same error when it does and when it doesn't).

A little more info: my fstab file is set to mount the cache at /dev/block/mtdblock5.  Going through the adb shell, running mount says (among others): "/dev/block/mtdblock5 on /cache type yaffs (rw)" ... doing "mount -a", I get two error messages:
mounting /dev/block/mmcblk0p1 on /data failed: Invalid argument
mounting /dev/block/mmcblk1p2 on /sd-ext failed: No such file or directory

Thanks for the idea...any other thoughts?

Just so I can follow along, what DOES work?

Do you have a functioning recovery?
Is it the stock recovery or Clockwork?
Did you flash the s-off SPL I suggested?

You're not 'bricked' in the traditional sense, but boy did you do a number to your device :(

#5 raskolnik

raskolnik
  • Members
  • 16 posts
  • Country:
    us - United States
  • Device Model:
    Incredible
  • CM Version:
    7.0.3-Inc
  • Recovery Image:
    ClockworkMod

Posted 08 September 2010 - 12:17 AM

View Postciwrl, on 08 September 2010 - 12:12 AM, said:

Just so I can follow along, what DOES work?

Do you have a functioning recovery?
Is it the stock recovery or Clockwork?
Did you flash the s-off SPL I suggested?

You're not 'bricked' in the traditional sense, but boy did you do a number to your device :(

Recovery is functioning, yes.  It's clockwork 2.5.0.5.  And yes, I did the s-off from unrevoked.  That helped (it made the errors about not being able to mount DATA go away), but CACHE is still an issue.

I also tried flashing a new recovery ROM with flash_image, but it told me the misc partition was out of space (may be because it's in the recovery thing right now).

#6 -Stevo-

-Stevo-
  • Members
  • 1297 posts
  • Country:
    us - United States
  • Location:
    Salt Lake City, Utah
  • Device Model:
    HTC Vision G2
  • CM Version:
    CM7.0.0-RCX
  • Recovery Image:
    ClockworkMod

Posted 08 September 2010 - 04:56 AM

Just so everyone is aware, I think we got this problem fixed.

Parted DID work to repartition the /data and /cache partition and made them mountable, cm6 installation proceeded but began to bootloop. We wondered if this was due to the partitions being ext2 rather than ext3

Now at this stage we decided to try and downgrade back to 2.1 stock, still no dice. The problem? Sdcard was fat and not fat32, after format downgrade was successful.

I suspect the downgrade wasn't necessary, froyo mounts the sdcard in a strange way due to apps2sd, i think cm6 would have loaded without the sdcard, or after it was formatted.

I'm not sure if the downgrade fixed things or if it was parted and the sdcard being fat. nonetheless, problem solved hopefully the info was useful.

#7 raskolnik

raskolnik
  • Members
  • 16 posts
  • Country:
    us - United States
  • Device Model:
    Incredible
  • CM Version:
    7.0.3-Inc
  • Recovery Image:
    ClockworkMod

Posted 08 September 2010 - 11:41 AM

Here's the solution.

The problem was that I managed to screw up the partitions on my internal storage card, so basically nothing would work properly.  I could still get into recovery, though.  That's key.

Here's what you'll need:
  • Working recovery, basic knowledge of adb & the shell
  • Parted (download here)
  • stock PB31IMG.zip

Note also that I had run unrevoked forever (so my phone was S-OFF) ... I'm not sure if that's required or not.

So, grab parted from the link above.  Now you need to extract the individual binaries from the .zip (the 6 files in the sdparted folder within the zip), ideally to your android-sdk\tools directory.  Now push all 6 files (adb push [file] /sbin/).  Next, we need to make them useable, so go into the shell (adb shell).  Change to your /sbin/ directory, and run: chmod 0755 <file> on each of the 6 files.

Now, we need to fix the partitions.  This is assuming that the partitions are there, just the wrong format (which is what happened to me .. I accidentally made them FAT32 instead of ext).  So, run the following: parted /dev/block/mmcblk0 mkfs ext2.  It will ask if you want to continue, hit yes.  When it asks for the partition number, enter 1.  Next, when it asks for the format, enter ext2.  Let it do its thing.  Now, once it's done, run parted again.  This time, enter partition 2 (everything else is the same).

Once all that's done, your recovery program should be able to mount both the /data and /cache partitions.  If that's true, you're pretty much done!  One thing I found was that I couldn't directly install a new OS (I tried both Cyanogen and Ultimate).  In both cases, it would look for stuff in the davik-cache that it couldn't find, so something wasn't installing correctly I think.  So, if that happens, flash back to the stock PB31IMG.zip (put it in the root of your /sdcard/ and let hboot install it), and then root your phone anew.  That's what I ended up doing.

Again, huge credit for this goes to -Steveo- and ciwrl for helping me figure out which partitions were the right ones (and for supplying parted, which I hadn't been able to find anywhere).  If something doesn't end up working, just drop me a pm and we'll see what we can do.

Edited by raskolnik, 10 September 2010 - 08:23 PM.


#8 ahshah

ahshah
  • Members
  • 27 posts
  • Country:
    us - United States
  • Device Model:
    Droid Incredible
  • CM Version:
    6.0.2
  • Recovery Image:
    Cyanogen

Posted 08 September 2010 - 02:48 PM

So to recap: bad partitions was causing this error:
E: Can't mount /dev/block/mmcblk0p2 (File exists)

Is that correct?

#9 shoman24v

shoman24v
  • Members
  • 5 posts
  • Twitter:shoman24v
  • Country:
    us - United States
  • Location:
    Fresno
  • Device Model:
    Droid Incredible
  • CM Version:
    CM 6.0.1, S-OFF
  • Recovery Image:
    ClockworkMod

Posted 08 September 2010 - 08:38 PM

It's not messed up till it doesn't power on.

#10 raskolnik

raskolnik
  • Members
  • 16 posts
  • Country:
    us - United States
  • Device Model:
    Incredible
  • CM Version:
    7.0.3-Inc
  • Recovery Image:
    ClockworkMod

Posted 08 September 2010 - 09:12 PM

View Postahshah, on 08 September 2010 - 02:48 PM, said:

So to recap: bad partitions was causing this error:
E: Can't mount /dev/block/mmcblk0p2 (File exists)

Is that correct?

That's the error I was getting, yes.  In addition, Clockworkmod couldn't format either DATA or CACHE.  I won't say those're the only things that could cause that error, but as I said that is one I got.

#11 m52power

m52power
  • Members
  • 5 posts
  • Device Model:
    Dinc
  • CM Version:
    6.02
  • Recovery Image:
    Cyanogen

Posted 09 September 2010 - 02:07 AM

OMG so there is some hope for my phone! Rather than start a new thread I figured I'd post in here. I am in a somewhat similar situation let me explain it as follows...

Running CM6.02, unrevoked forever (s-off)
Using my 8GB SDHC card from my old phone (It's about 2.5 yrs old)

Over the past few weeks the SD card will randomly go corrupt, I can't recover data and must format it.
SD card went corrupt again 2 days ago. This time it refuses to format. I tried formatting it in the phone, and 2 laptops, no go.
I ordered a new SDHC (class 6) from newegg and it's in the mail. I don't have any other SDHC cards to use.
In the meantime, today the phone was acting weird so I decided to reboot it. The phone gets to the CM6 boot animation andd gets 2/3 through it and then it loops over and over, never getting into android OS.
Did a battery pull, removed SDHC card completely and it still won't get past the CM6 boot animation.

OK... so I go into bootloader and perform a "CLEAR MEMORY" in hopes to get the phone to boot into CM6.

NOW the phone doesn't get past the lock screen, it just sits there forever.
Another battery pull.
Getting desperate and I go into clockworkmod and hit "clear data/cache" and it pops up lots of errors that it can't mount the internal volumes!!!


I have just found your thread and followed post #7. Everything goes fine until I run  parted /dev/block/mmcblk0

It simply displays:
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)

So maybe my partitions aren't there at all??

I looked at HELP in parted and typed in the print command and recieved:
print
Model: MMC HYNIX (sd/mmc)
Disk /dev/block/mmcblk0: 8095MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End	 Size	Type	 File system  Flags
 1	  8192B   797MB   797MB   primary
 2	  797MB   1007MB  210MB   primary
 3	  1007MB  8095MB  7088MB  primary  fat32		lba

(parted)

From here on out I am clueless as to the next step. Please help  :blink:

#12 m52power

m52power
  • Members
  • 5 posts
  • Device Model:
    Dinc
  • CM Version:
    6.02
  • Recovery Image:
    Cyanogen

Posted 09 September 2010 - 02:32 AM

For whatever reason now instead of showing the Dinc splash screen it goes straight to FASTBOOT. It looks like bootloader but has options:

BOOTLOADER
REBOOT
REBOOT BOOTLOADER
POWER DOWN

wth?:confused:

#13 raskolnik

raskolnik
  • Members
  • 16 posts
  • Country:
    us - United States
  • Device Model:
    Incredible
  • CM Version:
    7.0.3-Inc
  • Recovery Image:
    ClockworkMod

Posted 09 September 2010 - 11:22 AM

 m52power, on 09 September 2010 - 02:07 AM, said:

OMG so there is some hope for my phone! Rather than start a new thread I figured I'd post in here. I am in a somewhat similar situation let me explain it as follows...

Running CM6.02, unrevoked forever (s-off)
Using my 8GB SDHC card from my old phone (It's about 2.5 yrs old)

Over the past few weeks the SD card will randomly go corrupt, I can't recover data and must format it.
SD card went corrupt again 2 days ago. This time it refuses to format. I tried formatting it in the phone, and 2 laptops, no go.
I ordered a new SDHC (class 6) from newegg and it's in the mail. I don't have any other SDHC cards to use.
In the meantime, today the phone was acting weird so I decided to reboot it. The phone gets to the CM6 boot animation andd gets 2/3 through it and then it loops over and over, never getting into android OS.
Did a battery pull, removed SDHC card completely and it still won't get past the CM6 boot animation.

OK... so I go into bootloader and perform a "CLEAR MEMORY" in hopes to get the phone to boot into CM6.

NOW the phone doesn't get past the lock screen, it just sits there forever.
Another battery pull.
Getting desperate and I go into clockworkmod and hit "clear data/cache" and it pops up lots of errors that it can't mount the internal volumes!!!


I have just found your thread and followed post #7. Everything goes fine until I run  parted /dev/block/mmcblk0

It simply displays:
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)

So maybe my partitions aren't there at all??

I looked at HELP in parted and typed in the print command and recieved:
print
Model: MMC HYNIX (sd/mmc)
Disk /dev/block/mmcblk0: 8095MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End	 Size	Type	 File system  Flags
 1	  8192B   797MB   797MB   primary
 2	  797MB   1007MB  210MB   primary
 3	  1007MB  8095MB  7088MB  primary  fat32		lba

(parted)

From here on out I am clueless as to the next step. Please help  :blink:

Hmm...try running: parted /dev/block/mmcblk0 mkfs ext3.  I was thinking that running it with just the partition would get it to go through all the options like it did for me, but I guess you need to give it a little bit more.  It also is strange to me that the internal partitions would randomly get screwed up ... when it happened to me, it was because I accidentally formatted them.  Still, hope this helps.

#14 m52power

m52power
  • Members
  • 5 posts
  • Device Model:
    Dinc
  • CM Version:
    6.02
  • Recovery Image:
    Cyanogen

Posted 09 September 2010 - 02:08 PM

 raskolnik, on 09 September 2010 - 11:22 AM, said:

Hmm...try running: parted /dev/block/mmcblk0 mkfs ext3.  I was thinking that running it with just the partition would get it to go through all the options like it did for me, but I guess you need to give it a little bit more.  It also is strange to me that the internal partitions would randomly get screwed up ... when it happened to me, it was because I accidentally formatted them.  Still, hope this helps.

Ok so I ran that line and it worked! kinda.... I was able to successfully format partitions 1 and 2. From there I rebooted the phone, wiped data/factory reset in clockwordmod and installed a rom of my choice (ruby).

Unfortunately the phone still hangs at the splash screen forever. I went back into clockworkmod and performed wipe data/factory reset It formats like normal now (it didn't do this before I ran that line of code you just posted). Then I format the dalvik cache and it spits out 1 error:

E:Can't mount /dev/block/mmcblk1p2
(file exists)
Dalvik cache wiped.

Should I attempt to format the 3rd partition that the print command shows in parted?

BTW thanks for your help so far, I'm paypaling you some money if you can help me get this phone working again :)

#15 raskolnik

raskolnik
  • Members
  • 16 posts
  • Country:
    us - United States
  • Device Model:
    Incredible
  • CM Version:
    7.0.3-Inc
  • Recovery Image:
    ClockworkMod

Posted 10 September 2010 - 12:46 AM

 m52power, on 09 September 2010 - 02:08 PM, said:

Ok so I ran that line and it worked! kinda.... I was able to successfully format partitions 1 and 2. From there I rebooted the phone, wiped data/factory reset in clockwordmod and installed a rom of my choice (ruby).

Unfortunately the phone still hangs at the splash screen forever. I went back into clockworkmod and performed wipe data/factory reset It formats like normal now (it didn't do this before I ran that line of code you just posted). Then I format the dalvik cache and it spits out 1 error:

E:Can't mount /dev/block/mmcblk1p2
(file exists)
Dalvik cache wiped.

Should I attempt to format the 3rd partition that the print command shows in parted?

BTW thanks for your help so far, I'm paypaling you some money if you can help me get this phone working again :)

First, sorry it took me so long to reply.  Life getting in the way and all that :).

On my phone, at least, mmcblk1p2 corresponds to the partition used to install apps to the SD card, a feature introduced in Froyo (Android 2.2).  I actually get the same error trying to mount /sd-ext/ (which is what it calls that partition) from Clockwork.  So I don't think that affects your OS's ability to boot, just your ability to install apps to the SD card.

Did you re-install the stock OS (PB31IMG.zip) and then re-root?  I ran into the same problem (boot loops) before doing that.  If you need to install that, make sure you format your SD card to FAT32 via Windows or your OS of choice (the default is plain-old FAT), or else the PB31IMG.zip won't install.  Hope this helps.

#16 m52power

m52power
  • Members
  • 5 posts
  • Device Model:
    Dinc
  • CM Version:
    6.02
  • Recovery Image:
    Cyanogen

Posted 10 September 2010 - 02:57 AM

Installed a rooted OTA (virtuos) and now it's working!!!!!!!! :D :D

What's your paypal?

#17 raskolnik

raskolnik
  • Members
  • 16 posts
  • Country:
    us - United States
  • Device Model:
    Incredible
  • CM Version:
    7.0.3-Inc
  • Recovery Image:
    ClockworkMod

Posted 10 September 2010 - 11:07 AM

 m52power, on 10 September 2010 - 02:57 AM, said:

Installed a rooted OTA (virtuos) and now it's working!!!!!!!! :D :D

What's your paypal?

Glad it's working.  Don't worry about it :).

#18 m52power

m52power
  • Members
  • 5 posts
  • Device Model:
    Dinc
  • CM Version:
    6.02
  • Recovery Image:
    Cyanogen

Posted 10 September 2010 - 12:19 PM

OK, Thanks again!!! :D:D

#19 sp1k3ster

sp1k3ster
  • Members
  • 1 posts
  • Device Model:
    |2|
  • CM Version:
    22
  • Recovery Image:
    Cyanogen

Posted 17 September 2010 - 06:02 AM

thanks this helped!

#20 mayhemw1ns

mayhemw1ns
  • Members
  • 1 posts
  • Device Model:
    HTC Incredible
  • CM Version:
    6.0.2
  • Recovery Image:
    Cyanogen

Posted 21 September 2010 - 06:55 PM

Awesome post. This fixed my issue when i was switching between ROMs.

Thanks for the help  raskolnik your post was great.