[HOWTO] [GUIDE] Repairing corrupted /data partition

Search This thread

kamilmirza

Senior Member
Dec 4, 2011
1,884
1,532
OnePlus 6
hello guys
i bought hammerhead today, i only used it for 10 mins :'(
unlocked the device and flashed twrp (no toolkits used) and was about to take backup
and then faced "unable to mount", tried all recoveries
and i can't boot into my stock ROM, the boot animation keeps on going and i can see the brightness increases but stay in boot animation
and sadly i have no warranty
i am downloading factory image and will report back
is there any method to re-partition data/storage partition? :confused: like THIS on HTC One

EDIT: well finally it's resolved by flashing factory image :D
 
Last edited:

Datsun.510

Senior Member
May 18, 2009
640
1,372
Las Vegas
About my problem.

Installed a ROM using MultiRom. After trying the new ROM out and rebooting my device to boot my internal ROM, my device was stuck in a bootloop at the bootanimation. I restarted the device again and it went into recovery by itself, restarted it again with and same result. My SD Card was empty in the Recovery. I tried to ADB Push a new ROM to Recovery and then reinstalling the ROM but it said "Unable to mount Data". Tried to flash TWRP through fastboot and was successful but was not able get the phone booted, as it went straight to the Recovery again.

I started doing research to see how I could fix this issue and I was lucky enough to run across this thread.

This line.... saved my phone.

Enter: ‘e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata’

After running this line and hitting 'yes' about 40 times, I rebooted my recovery once it finished. Now my SD Card was showing up again. I tried booting the ROM and it wouldn't work. So I dirty flashed my ROM and then it booted successfully.

I have now backed up my phone and will wipe it completely to make sure there are no more errors in the partitions.

Thank you so much for this information.
 
Last edited:

trschober

Member
Jul 29, 2010
44
9
Santiago
As a long time linux admin, I knew my data partition was corrupted the minute my phone started force closing, and I knew i made it worse when I force rebooted.
This little trick to run e2fsck from recovery saved the day! thanks!
 

Bladeage

Member
Jan 24, 2012
22
3
Probably Saved my Nexus 5 and my nerves

This Guide helped me a lot! Thanks for this!

ATM I am pulling all data from /data/media to my computer.


I still cannot explain how this happened to me. I updated my Kernel (ElementalX to v0.38) and after 3 or 4 hours it somehow restarted and bootlooped. Then I went into my Recovery -> sdcard was empty and mounting data was impossible!!!!

Everything will be backed up in the future, to be prepared for everything.

BTW: This Guide needs to be pushed. It saved the Nexus 5's of so many people out there :)
 

Potetsjokolade

Senior Member
Jan 3, 2012
122
5
a. Enter: ‘e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata’​

I got:

~ # ←[6ne2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata
e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata
e2fsck 1.41.14 (22-Dec-2010)
/dev/block/platform/msm_sdcc.1/by-name/userdata: clean, 872/838832 files, 133291
/3351034 blocks

but still no signal
 

uzzo85

Senior Member
Apr 23, 2012
201
24
hello guys, i have the same problem: unable to mount data, already tried the guide but it says: superblock corrupt, at last with flashing factory the phone is riborn! anyway thanks for the guide
 

ashu347

Member
Apr 23, 2013
9
0
phoenix
nexus 4 - stuck in boot loop

Stuck on boot screen

Okay..this is how it happened...
when i checked my mobile couple of days back ..apps were crashing..."[app] stopped working" message was coming for many of the goggle apps....In past - a restart used to fix this.
I restarted my phone - but it got stuck in the bootloop (circles)

What i need next
went in bootloader menu (power and - volume)
selected factory reset
power button

blank black screen

nothing happened for a long time


then i searched on google ..downloaded SDK, nexus 4 image ..and tried to flash ..evrything went fine I till tried to flash the bootloader image and got message "failed (remote flash write failure)"

And I am stuck at this stage please advise

Now when i retstart phone goes directly into bootloader menu - may as i have erased other stuff while flashing..
Please help me ---- I do not want to loose my phone....
 

kamilmirza

Senior Member
Dec 4, 2011
1,884
1,532
OnePlus 6
Stuck on boot screen

Okay..this is how it happened...
when i checked my mobile couple of days back ..apps were crashing..."[app] stopped working" message was coming for many of the goggle apps....In past - a restart used to fix this.
I restarted my phone - but it got stuck in the bootloop (circles)

What i need next
went in bootloader menu (power and - volume)
selected factory reset
power button

blank black screen

nothing happened for a long time


then i searched on google ..downloaded SDK, nexus 4 image ..and tried to flash ..evrything went fine I till tried to flash the bootloader image and got message "failed (remote flash write failure)"

And I am stuck at this stage please advise

Now when i retstart phone goes directly into bootloader menu - may as i have erased other stuff while flashing..
Please help me ---- I do not want to loose my phone....

why you used Nexus 4 image? :eek: it will mess up your device pretty bad
I don't think there is nothing you can do but to use stock Nexus 5 image :rolleyes:
 

Flyview

Senior Member
May 17, 2010
2,557
1,675
Toronto/San Diego
Thanks for the guide!

I am trying it myself but in the all important step of trying to repair the data partition, I see this:

Botched_Nexus5 said:
e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata
e2fsck 1.41.14 (22-Dec-2010)
e2fsck: No such file or directory while trying to open /dev/block/platform/msm_sdcc.1/by-name/userdata
Possibly non-existent device?

EDIT: Weird, it somehow worked, device booted after I rebooted...
EDIT2: And then froze at the lockscreen and went black...now it won't boot again or mount any partitions (same as before)
 
Last edited:

b0toxXP

New member
Oct 1, 2007
3
1
Hey everyone,

i also had the corrupted userdata.
The Guide didn't helped me because e2fsck told me the corrupt superblock.

But locking again the bootloader and unlocking it a second time solved it for me. (i think the erasing-process on unlocking solved it).

(sorry for bad english ;) )
 
  • Like
Reactions: GuyIncognito721

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
9,428
8,754
26
Salford, Greater Manchester, UK
quinny898.co.uk
Why wasn't this here when I last messed up my /data? :S
It worked, somehow messed up mine playing a game and the device froze, hard reboot, bootloop. I thought "crap, seen this before", rebooted into TWRP, long splash. By this time I was cursing. I'm on holiday, I don't have my stuff with me, just a netbook and TeamViewer
Using this guide, I got CWM to connect to adb on Ubuntu, see here for "insufficient permissions": UDEV
And got this to work. Saved my bacon as they say. Backing up now. Thank you so much.

Do you have a PayPal donation email? I have money in my account from StartApp that I can't pay out right now and would like to buy you a light refreshment for the guide
 
Last edited:

harsh2193

Senior Member
Mar 7, 2013
320
85
Los Angeles
I had an experience the other night that I found rather frightening and enlightening, and felt the need to contribute my learning. I attempted to install a new ROM on my Nexus 5 and encountered a freeze during the /system write process. I waited 30 minutes and decided it wasn’t going to finish, so I powered off. As an avid and experienced ROM flasher I knew this could hurt, and knew it was an inevitable requirement.

Upon rebooting back to recovery (I had already wiped /system /data, etc. in preparation for a new ROM) I found that I was unable to mount /data and subsequently /sdcard. I received a few different errors depending on which recovery I attempted (fastboot flashed). I was given neat things like “Enter password to decrypt /data” – TWRP, or “E: Unable to mount /data, invalid argument”, “E: Error mounting /data”, “E: Error mounting /sdcard”.

During all of this I realized I could get an ADB shell going from within Philz recovery (I am not sure if TWRP or CWM do this, nor did I try). After much research, and very much to my dismay, I was unable to find a complete guide or walkthrough for how to go about recovering from this. This is the procedure I glued together from my own digging and manual learning of the commands required. This procedure may or may not work in all cases but is a viable step to recovering your /data partition before going the nuke & pave route with the factory image!

(NOTE: I’ll try to keep this as simple as possible. I am not a dev. I do this for fun/learning in the little free time I get and am not typically available to assist, so please use this only if you feel comfortable with the material. Flashing a ROM/Kernel/etc. is one thing. Digging in the innards of the Android partitions/file system is a whole other beast! To be VERY clear: I am not responsible for damages or loss incurred by the use or misuse of this information.) Also note, if you have an ADB enabled recovery, you can probably try this process against your devices partitions as well.

The following instructions assume you are unable to mount /data or /sdcard on the Nexus 5 and are receiving errors. This also assumes that the wipe /cache function is not resolving the issue for you (as this seems to work for some depending on the issue).


Prerequisites:

- Philz recovery for LGE Nexus 5 (http://xdaforums.com/showthread.php?t=2565174)
- Android ADB interface drivers and software (Available from existing root toolkits and SDK)
- Fastboot executable (Also available from existing root toolkits and SDK)
***Note: I performed all of this from Windows 8. The toolkit I used was Wug’s Nexus Root Toolkit (http://xdaforums.com/showthread.php?t=2517778). If you are a Windows user, read and follow the toolkit instructions to install the drivers. Use the Advanced Utilities[Launch]->Manual Input[Launch CMD Prompt] to bring up a Command prompt and perform the steps below.
- For simplicity, ensure that the ADB and Fastboot binaries are in the same location if you are gathering these binaries from the SDK or other source.
- Create a folder that you can later use to pull recovered files from your phone. (if so desired)​

Terminologies used:

- Terminal = Command Prompt (Windows), Bash/etc (Linux), Terminal (MacOSX)
- Fastboot = Application that interfaces with the Bootloader (flash/wipe partitions, etc)
- ADB = Android Debug Bridge (Provides an interface to interact with Android filesystem)
- Binaries = Files containing executable code (for this context, ADB and Fastboot applications)
- Bootloader = Think of it as the EFI or BIOS equivalent for your phone. (Accessed with VOLDN+PWR)
- Recovery = CWM/TWRP/Philz (We will be using Philz, as this was what I used to write this guide)​

Steps:

1. Install all required drivers and prerequisites listed above.
a. Use Wug’s toolkit or whatever method gets your drivers installed for your OS.​
b. If you are not familiar with this process, then please research!​

2. Power off your phone and connect via USB to your PC.

3. Power your phone into the bootloader by holding the PWR+VOLDN keys

4. In a Terminal, browse to the location of your fastboot binaries. (See prerequisite note for Wug’s)
a. Enter ‘fastboot devices’ to verify that your phone is detected. If it returns a “<serialnumberofdevice> fastboot” then you may proceed. If it does not, please check your driver installation and start over.​

5. Flash and boot to Philz recovery:
a. Extract the ‘recovery.img’ file from Philz Recovery ZIP and place in the same location that fastboot and adb binaries are located.​
b. Enter ‘fastboot flash recovery recovery.img’ (without quotes) in the Terminal. This will write the new recovery.​
c. Once complete (takes a brief second usually), use the VOLUP/DN keys until the Bootloader shows “Recovery Mode” and press the power key. Your phone should now be booting into Philz recovery.​

6. Use ADB to launch a root shell from within Philz recovery
a. Ensure that the drivers are now detecting your device as an ADB ready device by entering: ‘adb devices’. If it returns “<serialnumberofdevice> recovery” then you are ready to proceed. If it does not, please verify your ADB driver installation and check again.​
b. Enter: ‘adb shell’ to gain full root shell access to the Android file system. (You should see a “~#” prompt to show that you’re now in a root shell)​

7. Attempt repair of /data partition. This partition includes /sdcard and dalvik. (/sdcard is linked to /data/media) At the ~# prompt:
a. Enter: ‘e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata’​
b. You should now be prompted to repair or fix errors. Press [Enter] key to use the default answer of (y) for yes. If you are not, then this fix may not apply to you.​
c. Continue pressing [Enter] until the process completes.​
d. Proceed to next step if you have gotten this far.​

8. Attempt to manually mount the data partition.
a. We are going to mount /data as read-only for now. To do this, enter: ‘mount /dev/block/platform/msm_sdcc.1/by-name/userdata /data’​
b. If mount is successful, it will simply drop down to the next blank shell prompt. If it fails, you will receive an error. If you receive an error, then the repair has failed.​
c. If you did not receive an error, you can now browse to your /data and /sdcard partitions. This is accomplished by entering: ‘cd /data’ for /data, and ‘cd /data/media/0’ OR ‘cd /sdcard’ for your /sdcard (/sdcard is a link that will drop you directly to /data/media/0)​

9. BACKUP YOUR ENTIRE SDCARD TO YOUR COMPUTER!!! (Optional, but highly recommended)
a. Enter: ‘adb pull /data/media <path_on_computer>’​
b. <path_on_computer> will be a folder you created in the prerequisites.​
c. Wait for this process to complete.​

Congratulations! You may now proceed to launch recovery and flash at will. I highly recommend after making the backup in step 9 that you perform a full factory reset to correct any potential lingering issues with the partitions. You can then push the files back to your /sdcard by mounting /data as RW using ADB shell through Philz recovery (please reference the ‘mount’ and ‘adb’ command utilities for information about how to do this).

If you find yourself in the unfortunate position to have to use this, please share your results in the forum for others. If you find something does not work, please post it (I will check occasionally and update as I can). I do not frequent my PM’s, and again, I am not available to provide support. Please understand this and use at your own risk.

If this helped you, then my job here is done :). Thanks for reading!

(I am not affiliated with any of the devs that provide these tools. Be sure to thank them if you used their tools, as they deserve all credit for enabling and teaching us to do these things – even when we do break our own stuff!)


I followed the guide and the "e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata" line did find a lot of errors. After all of them were supposedly fixed, it gave a segmentation error and gave a blank line. I wasn't able to flash the recovery either as it gave me a "remote : flash write failure", so i just temp. booted into cwm while I used the adb commands. Problem now is that i still get the flash write failure when i try to do anything (literally anything that requires flashing) and when i temporarily boot into CWM or Philz touch (can't temp. boot into TWRP for some reason, it gets stuck at the twrp screen), it gives me an error "E : Failed closing /dev/block/platform/msm_sdcc.1/by-name/misc (I/O error)". I wasn't able to temp boot philz recovery earlier either but after following your guide, I can so something clearly happened.

Still can't flash anything though and I'm stuck with an open bootloader. Don't mind if I can't bring the phone back but just want to relock the bootloader so i can at least get a replacement. Desperately need your help.
 

Juniluis

Member
Sep 29, 2014
15
2
About my problem.

Installed a ROM using MultiRom. After trying the new ROM out and rebooting my device to boot my internal ROM, my device was stuck in a bootloop at the bootanimation. I restarted the device again and it went into recovery by itself, restarted it again with and same result. My SD Card was empty in the Recovery. I tried to ADB Push a new ROM to Recovery and then reinstalling the ROM but it said "Unable to mount Data". Tried to flash TWRP through fastboot and was successful but was not able get the phone booted, as it went straight to the Recovery again.

I started doing research to see how I could fix this issue and I was lucky enough to run across this thread.

This line.... saved my phone.

Enter: ‘e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata’

After running this line and hitting 'yes' about 40 times, I rebooted my recovery once it finished. Now my SD Card was showing up again. I tried booting the ROM and it wouldn't work. So I dirty flashed my ROM and then it booted successfully.

I have now backed up my phone and will wipe it completely to make sure there are no more errors in the partitions.

Thank you so much for this information.
Where can enter this line how do i do it please help me

---------- Post added at 05:28 AM ---------- Previous post was at 04:45 AM ----------

I followed the guide and the "e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata" line did find a lot of errors. After all of them were supposedly fixed, it gave a segmentation error and gave a blank line. I wasn't able to flash the recovery either as it gave me a "remote : flash write failure", so i just temp. booted into cwm while I used the adb commands. Problem now is that i still get the flash write failure when i try to do anything (literally anything that requires flashing) and when i temporarily boot into CWM or Philz touch (can't temp. boot into TWRP for some reason, it gets stuck at the twrp screen), it gives me an error "E : Failed closing /dev/block/platform/msm_sdcc.1/by-name/misc (I/O error)". I wasn't able to temp boot philz recovery earlier either but after following your guide, I can so something clearly happened.

Still can't flash anything though and I'm stuck with an open bootloader. Don't mind if I can't bring the phone back but just want to relock the bootloader so i can at least get a replacement. Desperately need your help.

Mine didn't show the device serial number with recovery after it only shows the serial number and when i enter the line it says to e2fsk not found. Please help
 
I have same problem with fsck error:
~ # e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata
e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata
e2fsck 1.41.14 (22-Dec-2010)
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/block/platform
/msm_sdcc.1/by-name/userdata

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
I don't care about data so my first fix was:
(IN ADB SHELL @ RECOVERY)

mke2fs -T ext4 -b 4096 /dev/block/mmcblk0p28
( /dev/block/mmcblk0p28 is what my userdata symlinks)
but got two "internal storage" in MTP
Then I tried:
fastboot format userdata
and this deleted all files (inc. /sdcard ) but now everything works ok...
Hope it help someone :)
 
Last edited:
  • Like
Reactions: JBLogic

Top Liked Posts

  • There are no posts matching your filters.
  • 73
    I had an experience the other night that I found rather frightening and enlightening, and felt the need to contribute my learning. I attempted to install a new ROM on my Nexus 5 and encountered a freeze during the /system write process. I waited 30 minutes and decided it wasn’t going to finish, so I powered off. As an avid and experienced ROM flasher I knew this could hurt, and knew it was an inevitable requirement.

    Upon rebooting back to recovery (I had already wiped /system /data, etc. in preparation for a new ROM) I found that I was unable to mount /data and subsequently /sdcard. I received a few different errors depending on which recovery I attempted (fastboot flashed). I was given neat things like “Enter password to decrypt /data” – TWRP, or “E: Unable to mount /data, invalid argument”, “E: Error mounting /data”, “E: Error mounting /sdcard”.

    During all of this I realized I could get an ADB shell going from within Philz recovery (I am not sure if TWRP or CWM do this, nor did I try). After much research, and very much to my dismay, I was unable to find a complete guide or walkthrough for how to go about recovering from this. This is the procedure I glued together from my own digging and manual learning of the commands required. This procedure may or may not work in all cases but is a viable step to recovering your /data partition before going the nuke & pave route with the factory image!

    (NOTE: I’ll try to keep this as simple as possible. I am not a dev. I do this for fun/learning in the little free time I get and am not typically available to assist, so please use this only if you feel comfortable with the material. Flashing a ROM/Kernel/etc. is one thing. Digging in the innards of the Android partitions/file system is a whole other beast! To be VERY clear: I am not responsible for damages or loss incurred by the use or misuse of this information.) Also note, if you have an ADB enabled recovery, you can probably try this process against your devices partitions as well.

    The following instructions assume you are unable to mount /data or /sdcard on the Nexus 5 and are receiving errors. This also assumes that the wipe /cache function is not resolving the issue for you (as this seems to work for some depending on the issue).


    Prerequisites:

    - Philz recovery for LGE Nexus 5 (http://xdaforums.com/showthread.php?t=2565174)
    - Android ADB interface drivers and software (Available from existing root toolkits and SDK)
    - Fastboot executable (Also available from existing root toolkits and SDK)
    ***Note: I performed all of this from Windows 8. The toolkit I used was Wug’s Nexus Root Toolkit (http://xdaforums.com/showthread.php?t=2517778). If you are a Windows user, read and follow the toolkit instructions to install the drivers. Use the Advanced Utilities[Launch]->Manual Input[Launch CMD Prompt] to bring up a Command prompt and perform the steps below.
    - For simplicity, ensure that the ADB and Fastboot binaries are in the same location if you are gathering these binaries from the SDK or other source.
    - Create a folder that you can later use to pull recovered files from your phone. (if so desired)​

    Terminologies used:

    - Terminal = Command Prompt (Windows), Bash/etc (Linux), Terminal (MacOSX)
    - Fastboot = Application that interfaces with the Bootloader (flash/wipe partitions, etc)
    - ADB = Android Debug Bridge (Provides an interface to interact with Android filesystem)
    - Binaries = Files containing executable code (for this context, ADB and Fastboot applications)
    - Bootloader = Think of it as the EFI or BIOS equivalent for your phone. (Accessed with VOLDN+PWR)
    - Recovery = CWM/TWRP/Philz (We will be using Philz, as this was what I used to write this guide)​

    Steps:

    1. Install all required drivers and prerequisites listed above.
    a. Use Wug’s toolkit or whatever method gets your drivers installed for your OS.​
    b. If you are not familiar with this process, then please research!​

    2. Power off your phone and connect via USB to your PC.

    3. Power your phone into the bootloader by holding the PWR+VOLDN keys

    4. In a Terminal, browse to the location of your fastboot binaries. (See prerequisite note for Wug’s)
    a. Enter ‘fastboot devices’ to verify that your phone is detected. If it returns a “<serialnumberofdevice> fastboot” then you may proceed. If it does not, please check your driver installation and start over.​

    5. Flash and boot to Philz recovery:
    a. Extract the ‘recovery.img’ file from Philz Recovery ZIP and place in the same location that fastboot and adb binaries are located.​
    b. Enter ‘fastboot flash recovery recovery.img’ (without quotes) in the Terminal. This will write the new recovery.​
    c. Once complete (takes a brief second usually), use the VOLUP/DN keys until the Bootloader shows “Recovery Mode” and press the power key. Your phone should now be booting into Philz recovery.​

    6. Use ADB to launch a root shell from within Philz recovery
    a. Ensure that the drivers are now detecting your device as an ADB ready device by entering: ‘adb devices’. If it returns “<serialnumberofdevice> recovery” then you are ready to proceed. If it does not, please verify your ADB driver installation and check again.​
    b. Enter: ‘adb shell’ to gain full root shell access to the Android file system. (You should see a “~#” prompt to show that you’re now in a root shell)​

    7. Attempt repair of /data partition. This partition includes /sdcard and dalvik. (/sdcard is linked to /data/media) At the ~# prompt:
    a. Enter: ‘e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata’​
    b. You should now be prompted to repair or fix errors. Press [Enter] key to use the default answer of (y) for yes. If you are not, then this fix may not apply to you.​
    c. Continue pressing [Enter] until the process completes.​
    d. Proceed to next step if you have gotten this far.​

    8. Attempt to manually mount the data partition.
    a. We are going to mount /data as read-only for now. To do this, enter: ‘mount /dev/block/platform/msm_sdcc.1/by-name/userdata /data’​
    b. If mount is successful, it will simply drop down to the next blank shell prompt. If it fails, you will receive an error. If you receive an error, then the repair has failed.​
    c. If you did not receive an error, you can now browse to your /data and /sdcard partitions. This is accomplished by entering: ‘cd /data’ for /data, and ‘cd /data/media/0’ OR ‘cd /sdcard’ for your /sdcard (/sdcard is a link that will drop you directly to /data/media/0)​

    9. BACKUP YOUR ENTIRE SDCARD TO YOUR COMPUTER!!! (Optional, but highly recommended)
    a. Enter: ‘adb pull /data/media <path_on_computer>’​
    b. <path_on_computer> will be a folder you created in the prerequisites.​
    c. Wait for this process to complete.​

    Congratulations! You may now proceed to launch recovery and flash at will. I highly recommend after making the backup in step 9 that you perform a full factory reset to correct any potential lingering issues with the partitions. You can then push the files back to your /sdcard by mounting /data as RW using ADB shell through Philz recovery (please reference the ‘mount’ and ‘adb’ command utilities for information about how to do this).

    If you find yourself in the unfortunate position to have to use this, please share your results in the forum for others. If you find something does not work, please post it (I will check occasionally and update as I can). I do not frequent my PM’s, and again, I am not available to provide support. Please understand this and use at your own risk.

    If this helped you, then my job here is done :). Thanks for reading!

    (I am not affiliated with any of the devs that provide these tools. Be sure to thank them if you used their tools, as they deserve all credit for enabling and teaching us to do these things – even when we do break our own stuff!)
    3
    I would try formatting the partitions separately and then flashing new firmware/software
    fastboot erase system
    fastboot erase cache
    fastboot erase userdata
    fastboot erase recovery
    fastboot erase boot
    Then I would extract these images from here
    https://developers.google.com/android/nexus/images#hammerhead
    And start with bootloader
    fastboot flash bootloader nameofbootloader.extension
    .img .nb0 whatever
    Then
    fastboot flash radio nameofradio.img
    (maybe modem can't recall on these so look for modem if need be)
    fastboot flash recovery nameofrecovery.img
    fastboot flash system
    fastboot flash userdata
    fastboot flash cache
    And so on
    If any errors please post all input/output from cmd in codewraps here or pastebin link
    3
    Somehow it seems as though all of my partitions have been wiped/corrupted and I was directed to this thread as possible help. When trying to run step 7 command(had to do it with CWM v6.0.4.5 as it doesn't seem to want to keep philz when sideloading or fastboot flashing it), it gives me the following response:

    e2fsck: 1.41.14 (22-Dec-2010)
    e2fsck: Superblock invalid, trying backup blocks...
    e2fsck: Bad magic number in super-block while trying to open /dev/block/platform/msm_sdcc.1/by-name/userdata

    The super block could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device>


    My phone was having freezes and shutdowns so I decided to flash a new ROM to freshen things up and it failed and aborted. After that I've got no android to boot into and I can't mount or access any of the partitions. I've got fastboot and adb, but no clue where to begin as it seems like I have to recreate my partition table but can't find any info on doing that for the nexus 5 itself

    I had the same problem. This is how I got it sorted.
    follow these steps and you should get it sorted

    fastboot erase system -w
    fastboot erase boot
    fastboot erase recovery
    fastboot flash bootloader bootloader.img
    fastboot flash recovery recovery.img
    once it flashes, boot into recovery.
    format sdcard (i believe it is)
    Now adb sideload ROM and gapps

    I have class until this afternoon, but that should get it fixed
    If you have any hangups post it here and I'll help you when I'm free.

    Good Luck
    2
    Nice guide I'm sure this is going to be very useful for a lot of people. :thumbup::thumbup:

    Sent from my Nexus 5 using Xparent BlueTapatalk 2
    2
    Ok can you try it from here:
    fastboot flash recovery recovery.img (use this recovery if you have a grouper tab http://techerrata.com/browse/twrp2/grouper)
    once it flashes, boot into recovery.
    format sdcard (i believe it is) (keep in mind this will obviously wipe all of the data from the device)
    Now adb sideload ROM and gapps

    Hey Kilometers, he is having trouble with the N5 "Hammerhead", so make sure that you curtail your responses towards that. I know your issue was with the N7, but since the issues were extremely similar is why I ask.