yashsingh1/xdaforums huggingface dataset:
[Nexus 4 General] sandy7874:
hi I cannot go further after this command -

/dd if=/dev/block/mmcblk0 of=/system/DDR bs=512 skip=15267840 count=2015

says invalid argument when I put command

/dd if=/system/DDR of=/dev/block/mmcblk0 bs=512 seek=30775296 conv=notrunc

, i tried with and without "/".

Can you guide me how to copy commands to CMD if i m doing anything wrong. I just do by ctrl+c and then right click on CMD and pase.

I m really hopeful on this post as this is the last method left for trying to bring 12 GB storage back on my Nexus 16GB.
[Nexus 4 General] jotecnologo:
Thanks a lot for the suggestion, I actually fix the problem following the tutorial http://xdaforums.com/showpost.php?p=43164157&postcount=1 and it was enough to boot the recovery image with

fastboot boot recovery-clockwork-touch-6.0.4.7-mako.img

go to "mounts and storage" and format all data and sdcard. Then rebooting and waiting to the OS to start (it took a looong time), I had the storage back to 12 GB! At the beginning it seems that I had a loop in the boot animation, but waiting for 30 min or more, it started with a full storage space. Doing again the "flash-all.sh/.bat" procedure didn't really help, also because I had problems with flashing with "update -w *image.zip" from the official image and it rather looked that I just needed to format the sdcard with the recovery tool and let the smartphone run until it was done.

I hope you solved the problem as well! ;)
[Nexus 4 General] prasanth kalas:
this doesn't fix my nexus

it is a waste of time. I tried every thing but it still shows the same 5.67gb storage on my N4. show me the video of the procedure and get us from this ****.
[Nexus 4 General] El Daddy:
Sorry it didn't work for you. This tutorial is nearly 3 years old. Things change...
[Nexus 4 General] sonny34:
Did you try to remove all duplicated folders like 1, 2,11? It worked for me
[Nexus 4 General] sandy7874:
Which folders you are talking? I dont see such folders in Explorer.
[Nexus 4 General] prasanth kalas:
tell me a detailed procedure, what you did to get back your nexus4

:confused:
[Nexus 4 General] sandy7874:
is here any one who can reply or let us know the proper way of executing these commands?

or guide us to another tutorial?
[Nexus 4 General] sonny34:
With a file Explorer I realize there were folders duplicated with different names such as 1, 11. What I did is to remove all the duplicated folders. Legacy folder was duplicated too.
[Nexus 4 General] aburyaan1:
Thanks that's solve my problem
[Nexus 4 General] pareash:
not working for me... :(

the last command is not working, got the error: archive dont have .sig files.... and phone stuck at google logo .. no OS

tried all things but still showing 5 gb memory available

pls help....!!!!
[Nexus 4 General] xdax1:
finally figured out how to enter stock recovery

found out once you in bootloader, you use vol to choose recovery, then when you see the RED triangle Android, you "Press and Hold POWER button and press vol up", that's how you really get to stock recovery to factory reset

I was trying to use fastboot to do factory reset, the phone will not boot after doing that.
[Nexus 4 General] wwazman:
I have tried to follow both guides to restore my nexus 4 to full storage capacity, but the closest I can get to is 12.92 gigs. I've gotten as far as a stock image (Lollypop, the final lick) cleared the cache and did a factory reset. Still 12.92 gigs. [sigh] ..well, it's a little more.. earlier it was showing 12.22 gigs.
[Nexus 4 General] dsbnz:
12.92gb is correct for internal storage. You don't get 16gb as indicated on the box, don't forget system/cache partitions etc all take space from the total of 16gb.
[Nexus 4 General] wwazman:
ahh.. ok, will quit formatting it then! ;) ...actually.. (sigh) it's back to 12.22.
[Nexus 4 General] dsbnz:
Have a look at storage in settings. You should 'total space 12.92gb', and I'm guessing 'available 12.22gb' which would indicate some files have been created on internal storage which is taking the space difference between total & available, quite likely in 'Android/Data'.
[Nexus 4 General] wwazman:
yep, you're right. I looked at the wrong section. I R Dum. lol! Thanks!
[Nexus 4 General] inventgm:
Boot Loop Removed

:) :) - Many Thanks! Got out of Bootloop after 12 hours of trying different solutions. Note1 - Worked...
[Nexus 4 General] Skoche:
How did you get out !

been almost 24 hours for me.

Tried lot of things

Flashed stock, Flashed Chroma, mount, format what not....

http://xdaforums.com/nexus-4/help/nexus-stuck-boot-loop-flashing-stock-rom-t3374611#post66750827
[Nexus 4 General] ace_venturia:
can't get back 16gb

Hello,

I tried every procedures mentioned here but still can't get back 16gb...

Any help?
[Nexus 4 General] erkamt:
have you tried this http://xdaforums.com/showpost.php?p=49708065&postcount=153

---------- Post added at 11:45 AM ---------- Previous post was at 11:42 AM ----------

A little complicated but try this: http://xdaforums.com/showpost.php?p=49708065&postcount=153

Worked in worst situations...
[Nexus 4 General] paulo_123:
Bricked my Nexus 4 because of these errors:

~ # /dd if=/system/sgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=30775296 conv
otrunc
/dd if=/system/sgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=30775296 conv=n
otrunc
dd: /dev/block/mmcblk0: Invalid argument
~ # /dd if=/system/DDR of=/dev/block/mmcblk0 bs=512 seek=30775296 conv=notrunc
/dd if=/system/DDR of=/dev/block/mmcblk0 bs=512 seek=30775296 conv=notrunc
dd: /dev/block/mmcblk0: Invalid argument

P.S. Just in case anyone is interested if the "umount /tmp" or ""umount /system" commands return:

"umount: can't umount /tmp: Device or resource busy"

"umount: can't umount /system: Device or resource busy"

Use:

umount -l /tmp
umount -l /system
[Nexus 4 General] rignaneseleo:
I flashed the stock rom manually with *.img files and fastboot.exe and after the boot I had 8gb instead 16.

I used the Nexus Root toolkit and with 'Flash Stock + Unroot', it redownload the ROM and it reflashed it automatically.

Now all works well and I can see 16gb of memory. :)
[Nexus 4 General] kshark27:
If anybody is still stuck and want to fix this issue. Read the steps below

Okay, so I flashed 5.1.1 Stock manually for Nexus 4 and see my internal storage decreased to 8 gb out of which around 6 gb was usable. I was like WTF, searched the forums and everywhere there were thousands of steps to fix this issue. I was like no way I can spend this much time so I fixed it using the steps below :

NOTE: You will loose all your data following these steps.

1) Flash twrp custom recovery

2) Flash any custom rom for nexus 4

3) Opened terminal where my adb and fastboot were setup.

4) Started my nexus 4 in fastboot mode

used these commands

fastboot erase userdata
fastboot -w

5) Voila, got back my 12 gb storage. Rebooted the phone and kicking it.
[Nexus 4 General] Hamooz.101:
Hey, I recently updated my phone to marshmallow 6.0 and am loving it but there's a problem I saw in the about settings it says 64gb total storage. Available storage 48.34gb but when I go to my storage manager it says 53.37gb total storage and Available storage is 48.34gb so am just curious if the other 10.63 did just fly away from the total storage as I updated or it's just not showing them. if there is a fix it would be appreciated btw this problem is happening on my Huawei p8.
[Nexus 4 General] stephlal:
4.3.1 to 5.1.1

I had the 8 GB issue on 2 separate devices going from 4.3.1 to 5.1.1

I tried several things from this thread ..the following worked on both devices...I even re-flashed on the 2nd device a 2nd time to get the 8 GB bug to retest it, and it worked.

fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot erase userdata
fastboot flash bootloader bootloader-mako-makoz10o.img
fastboot reboot-bootloader
fastboot -w update image-occam-jdq39.zip

1 - Once the above is done running, the phone will reboot - power it off by holding down the power button (no need to let it boot up)

2 - Power on to Bootloader (hold power + vol down)

3 - From the Bootloader, select Recovery

4 - Phone boots into stock Recovery - on both my devices, this brought me to a RED Triangle Android.

5 - On the RED Triangle Android dude, hold "power + vol up", phone will start making noises and a red notification light appears - wait 5 seconds from the time you see the red light, then release power and vol buttons.

6 - Wait 30s

7 - Power on / install your favorite customer recovery / ROMs

In my case I installed TWRP 3.0.2-0 + August Chroma on both devices and have full 16 GB running 6.0.1 flawlessly.
[Nexus 4 General] xhandroid:
why it could be

when i try to clear cache.. it suddenly restart??*

clear cache is failed
[Nexus 4 General] xhandroid:
and the end. i ve successfull back to 14GB after adb shell
[Nexus 4 General] lfilho4:
i do not understand

I don't undertood

I need to make the nandroid backup with my nexus 4 with just 8gb and then restore the backup from nexu bugged?

help me please, I already did that and do not work! I wanna my 16 GB again :'(
[Nexus 4 General] Jimmy york:
can this be done in TWRP or did you use SDK tools? i have 3 gigs missing after flashing a trimmed+deodexed stock rom.
[Nexus 4 General] RussianBear:
Sorry, man. Have zero recollection about this now...
[Nexus 4 General] darshan shrestha:
thanks!!!

thanks man. thanks. thank u very very very much!!!:o:o:o . it works by 1st step.
[Nexus 4 General] Cjoman:
Mines 16 GB but showing 12 GB on file explorer?
[Nexus 4 General] Mord_Savant:
This worked for me on my older Nexus 4! Android 5.1.1. Can't believe I didn't notice sooner I actually had 8gb of extra storage!
[Nexus 4 General] Ghost19841984:
Has anyone used this method in 2018, Nougat, Note 5, Custom rec FRP lock

So i had a Note 5 SM-N920T 32GB custom recovery FRP lock. Due to turning off OEM unlock while rebooting. Now i had someone fix it with what looks like stock firmware but internal memory shows 8GB and System memory is 7.02GB? i was wondering if anyone had try this or is this outdated method.
[Nexus 4 General] kyleds:
Is this right for the 16gb or do I need to fix it?
[Nexus 4 General] El Daddy:
That is correct for the 16GB version.

Sent from my Nexus 4
[Nexus 4 General] jimmygoska:
Hey, I think my mako is suffering from this. I'm running CM10.1 at the moment. Will doing this revert me back to stock?

Cheers
[Nexus 4 General] El Daddy:
You issue is most likely due to nandroid backups not showing up. If you had the problem described in this thread your total storage would show 5.67GB.

Check your /data/media folder for backups and delete the ones not needed.
[Nexus 4 General] jimmygoska:
Thanks. I thought I had done this yesterday (I had to move my clockworkmod directory so I could extract something with Titanium Backup) but I obviously copied and forgot to delete the blobs folder.

Edit: Slightly off-topic, but could you tell me why it's possible to get to the internal memory via:

/data/media/0/

/sdcard/

/storage/emulated/0/

?
[Nexus 4 General] El Daddy:
/data/media/ is the actual location

/sdcard/ is symlinked for legacy apps

/storage/emulated/ was added with multi-user support.
[Nexus 4 General] pHyR3:
I've followed your steps to the letter but i'm still getting stuck at the X Nexus Logo on the boot up?
[Nexus 4 General] El Daddy:
Robot into recovery. Clear cache and factory reset.
[Nexus 4 General] pHyR3:
Didn't work, i flashed factory then wiped and booted up, 5.67 gb, so then i followed your original steps and got stuck at the nexus logo. So i fastbooted and flash recovery then wiped data. Still stuck at nexus logo?
[Nexus 4 General] El Daddy:
Hmm that's strange.

In the bootloader type these commands.

fastboot erase cache

fastboot erase userdata

fastboot reboot
[Nexus 4 General] pHyR3:
The X logo seems to arise only when I attempt to wipe data in CWM recovery and it is unable to mount /data and /sdcard i think. If i do a clean flash of factory and without any reboot flash cwm and wipe data THEN reboot. It works fine except it has 5.67gb. If i try your method in the OP then it gets stuck at X logo? That means that if i boot into cwm and wipe it wont mount certain portions of my phone and it will get stuck at nexus logo. The onlly way to avoid nexus logo i have found is to do the original strategy which leads to 5.67gb. Hmm....strange.
[Nexus 4 General] El Daddy:
Are you always flashing cwm after the fastboot commands?

The update image includes stock recovery.

Try flashing the .zip and if it bootloops, enter stock recovery, wipe cache and factory reset from there.

Reboot to android before flashing anything else and see if you get your storage back.
[Nexus 4 General] pHyR3:
Yeah, I'm always flashing cwm after fastboot (i reboot bootloader first).

I can't seem to find the stock recovery? I'll try again, so I'll get into normal stock rom but with 5.67gb. Then turn the phone off and press volume up + power and see what happens, if i get into stock recovery then i'll wipe cache/reset
[Nexus 4 General] El Daddy:
Boot into the bootloader and toggle to recovery.

Volume up and power will open the recovery menu when you see the android guy laying down.
[Nexus 4 General] pHyR3:
Couldn't find the stock recovery? If I press up + power it just boots up normally (to 5.67gb) and if i go into fast boot and go to recovery from there it goes to cwm recovery because I flashed that in order to get out of the nexus logo originally. Seems to be a cycle: I'm either stuck on nexus logo so i flash stock and cwm and reset then it works but with 5.67gb, then i screw around with that to get 13gb and i get stuck on nexus logo eventually...

I just need to be able to get from 6gb to 13 without getting stuck in the nexus logo somehow.... don't think your original guide does that. But i'll give that a shot now again. probs get stuck in X logo though
[Nexus 4 General] El Daddy:
Odd. My only other suggestion is to flash stock completely. Including recovery. Check efrants sticky if you need assistance with that.

I'll be out for the next 6 hours or so. Can you report back if you figure it out. I'm curious.
[Nexus 4 General] pHyR3:
Haha, that definitely won't work. That's the guide i've been using to get out of X logo. That + flash cwm and fact. reset.

I'll flash 4.2 images instead of 4.2.1, my phone did come with 4.2? I dunno, maybe it'll magically work :)
[Nexus 4 General] efrant:
The stock recovery is included in the zip you are flashing from the first post. Once you do the "fastboot update - w" command, don't flash cwm. Reboot bootloader and select recovery. When you see the red triangle, hold power and press volume up. Do a factory rest and the wipe cache.

A factory reset in cwm is not a real factory reset. Use the stock recovery.

Not sure why this is happening for some people.
[Nexus 4 General] pHyR3:
OH OH OH OH! i think i get it, alright let me just get out of this nexus logo, should take 2 min. That requires cwm though but after that i can boot up into a 5.67gb stock rom. Then i'll follow the OP instructions and then boot into stock recovery and reset. I have a feeling this MIGHT work! :)

Thanks!
[Nexus 4 General] El Daddy:
That's what I was trying to explain a few posts ago. Efrant is a bit more articulate than me it seems. :)
[Nexus 4 General] pHyR3:
Yeah sorry, i've never booted into stock recovery on a n4 (first nexus device and only got it yesterday) so i got a bit lost there without even realising it.

Still having trouble getting into stock recovery. So i went into bootloader and selected recovery mode. Got the red triangle and pressed vol up + power for maybe 5 sec. nothing? not really sure what to do here.... my noobishness with the n4 is becoming apparent! :D

Edit: scratch that, got in. had to press power THEN the vol up

---------- Post added at 11:29 AM ---------- Previous post was at 11:14 AM ----------

YES! after over 6 hours I'm back to stock with 12.92 GB of storage. HOOORAY

Alright, I'll write up a quick guide for other nexus noobs like me who get heaps confused.

1) Follow the guide in post #241 http://xdaforums.com/showthread.php?p=36047429#post36047429 in order to get out of any X Nexus logo [only do this if you can get into fastboot, if you can your phone IS fixable.]

2) Now follow the guide in the OP of this thread but don't allow phone to try reboot. Just turn it off and boot into fastboot.

3) Now select the recovery and load it, you should get a dying android with a red triangle

4) Now press the Power button THEN the volume

5) Factory Reset

6) Wipe cache

7) YOU'RE DONE!
[Nexus 4 General] joshndroid:
the factory images that are posted on that mirror site are .tgz files and you speak of a .zip... very noob but i want to fix this dam issue. what should I do to get the file from .tgz to .zip? or is there a .zip located within this .tgz?

cheers
[Nexus 4 General] El Daddy:
Extract those files down to see the .zip file.
[Nexus 4 General] joshndroid:
Sweet as easy done
[Nexus 4 General] joshndroid:
Worked a treat got my storage back haha..
[Nexus 4 General] JayWheelz:
Thanks your guide worked perfectly. I'm back to normal and will proceed from here.
[Nexus 4 General] Pwn_PaW:
Thank you. Worked perfectly
[Nexus 4 General] dellenrules:
I mentioned a fix for this in an earlier thread back in November.

Just boot into stock recovery, clear cache, then perform a factory reset from there.

You don't need to do all those steps mentioned in your post.

This also works on the nexus 7 and 10 as well.
[Nexus 4 General] erikieperikie:
This fix sounds like just what I need (5.67 GB available for me on my 16GB N4).

This will erase my entire device, am I right? Will a nandroid restore of my current 8GB phone after fixing using the above mentioned method restore it to the current state with 16GB? Or will it set everything to the bugged 8GB internal memory again?

Why stock recovery?
[Nexus 4 General] El Daddy:
Yes, it will wipe your phone. I'm not sure about the nandroid. You could give it a shot.

The reason why this needs to be done with stock recovery is due to a couple of reasons.

1) custom recovery factory resets are not as complete as stock recovery.

2) there seems to be an issue with clearing the cache from the bootloader. Nobody seems to know the reason why, just that it occasionally doesn't work.
[Nexus 4 General] erikieperikie:
I've done a nandroid backup, now doing an adb backup. Will try to fix, restore nandroid, check 16GB status, report here. I assume that a nandroid restore will not work.

I will use your fix again, but now via adb restore, check 16GB status and again report back here.

I've already decided that I'm moving from stock 4.2.1 to Paranoid Android, so I need to full wipe nonetheless. Great opportunity for me to test these two backup/restore methods for this fix! I hope they both work... :fingers-crossed:

I have a Titanium Backup standing by as well............ Talk about backing up a lot!
[Nexus 4 General] erikieperikie:
Test 1:

1. made nandroid backup using CWM Touch Recovery on my 8GB bugged Nexus 4, containing all my apps, settings, etc.

2. pulled nandroid backup files from phone to PC, because step 4 wipes the /data partition containing the nandroid backup

3. cleared cache in stock recovery

4. factory reset in stock recovery

5. pushed nandroid files back onto phone (/data/media/clockworkmod/backup/YYYY-MM-DD.hh.mm.ss/)

6. restored nandroid through CWM Touch Recovery

Result:

Almost fully restored phone (SD card data was mostly lost, but like I said in my previous post, I am heavily backed up in case I need any of those files).

8GB status: gone! My total space is now 12.92GB! :laugh: This method works (YMMV) using a nandroid backup of your 8GB bugged Nexus 4. It doesn't restore the bug. Make sure to back up you SD card contents if you want to restore those files as well.

Since my phone isn't bugged with 8GB any more, I can't test this method again using adb restore in stead of nandroid restore (I kinda hoped the nandroid backup wouldn't work, so I could do some more testing).
[Nexus 4 General] El Daddy:
Thanks for testing! It seems like what dellenrules posted a few posts ago about clearing cache and factory resetting from stock recovery is a much quicker solution than the method in the OP.

Its also great to know that a nandroid can be applied after doing so.

I'll update the OP later today to reflect these findings. Thanks guys!
[Nexus 4 General] El Daddy:
OP updated with a new method and other info.
[Nexus 4 General] MoooN:
worked... got my 16 gig back

thanks a lot

hardest task was to get into stock recovery :D never did this before
[Nexus 4 General] erikieperikie:
Once you know how, all this flashing, recovery usage, backing up and more becomes really easy. It's a matter of using the search function here or on google (most of the times leading me back to XDA anyways :p) and trying out some stuff, without taking too much of a risk. I'm glad it worked for you too!
[Nexus 4 General] Rakeesh_j:
I had this problem happen on both of my 16GB phones. I fixed it by using the wipe/format option in TWRP. If you observe the console of this process, it actually completely removes the ext4 partition and creates a new one, filling up the entire storage block in the process.

I can't see any reason why that wouldn't work under any circumstances. I'm betting that in the process of flashing the stock rom, it also sticks the 8GB partition header in the /sdcard block resulting in a smaller partition size, so by trashing that partition and creating a new one, you get the full space of the phone.
[Nexus 4 General] KidCarter93:
El Daddy and dellenrules, do you think these methods will work on a similar situation on my Nexus 7 aswell?

I've got the 32GB N7 but after the upgrade to 4.2.2, my total space is showing only 6.02GB with 1.89GB available.

I was going to flash back to 4.2.1 and try the upgrade again but if this will work, it seems like it would be much easier.
[Nexus 4 General] El Daddy:
Yes it should. I've read the N7 has the same issue and this method fixes it as well.
[Nexus 4 General] variety:
Thank you! Finally got my full 16GB back. I did not realise I only had 8GB until a week or so of installing every app known to man, so my nandroid backup ended up being almost 3GB, which made the whole process a bit cumbersome. Additionally, the backup did not show in /sdcard (only in /data/media/clockworkmod/backup/), so I had to use a combination of root explorer (to move the .tar files one by one as I did not have enough space for the whole folder on my sdcard), SDrescan (so the idiotic android file-system could show them to windows) and then transfer the files one by one until they were complete on my PC. After that I was struggling a bit to boot the stock recovery, but finally saw that you could use the nexus 4 toolkit to temporarily load the stock recovery (though, it restarted after you wipe the cache, so you have to load it twice in the toolkit). Also, pushing 3GB using adb took too long, so I transferred the files though the normal way to the N4 and then moved them to the /data/media/clockworkmod/backup/ with root explorer again before doing the backup. Everything seems to be working as it should (knock on wood).
[Nexus 4 General] ethoss:
R: [HOW-TO] Fix internal storage if 16GB now shows 8GB

In your opinions... This situation is correct?

I haven't any nandroid backup.

The sum of these stuff is 4.6GB. Free space might be 8,36 GB. In the screenshot si only 3.38GB...

There is other space not shown on that?

Inviato dal mio Nexus 4 con Tapatalk 2
[Nexus 4 General] chenshaoju:
Thanks,but not this complex.

just backup,,boot to fastboot ,unlock fastboot(if your fastboot is locked),and:

fastboot format userdata

and recovery your data.
[Nexus 4 General] dldunckel:
Thanks! My phone is back to normal!

Thanks for the tips!

All is well with my phone again :)
[Nexus 4 General] shockem:
Thanks for creating this guide. :)
[Nexus 4 General] siravarice:
thanks for the guide, working a dream! :)