In some Android phone, its storage space will reduce after manually flashing a new firmware. This is a common issue on smartphones that are comes with different storage capacity, but it is more common on Nexus devices. For example, the 32GB variant Nexus 5X shows only 16GB or less after installing a new firmware manually, which is incorrect. You can easily fix this issue by following the guide below.
In this tutorial, we show you how to restore missing storage space on Nexus phone with TWRP recovery. After installing a new firmware update manually, if your Nexus device shows wrong storage space, i.e. if your 32GB Nexus 5X variant shows only 16GB storage space, then it means you have flashed a wrong firmware package that is destined for 16GB variant.
Stock firmware packages come with a ‘userdata.img’ file, which is flashed to your device along with other firmware files. Therefore, if you flash a firmware package meant for 16GB variant device on 32 GB variant, the device will show only 16 GB space.
You can fix incorrect storage issue in two ways. The first one is by restoring correct userdata image or by reinstalling full firmware file destined for your device via ADB and the second one is by resizing the file system with TWRP recovery.
The first method is simple and you can simply do it via ADB, but keep in mind that you should download correct userdata.img or firmware package meant for your variant. The second method requires TWRP recovery installed on your phone.
Note: All these methods will wipe your data, so backup all data you have on the phone before proceeding.
How to Restore Missing Storage Space on Nexus Devices using TWRP Recovery
1. Install latest version of TWRP recovery, then boot your phone into TWRP recovery mode
2. In TWRP recovery, select Wipe > Advanced Wipe
3. Check data partition option
4. Select repair/change file system option
5. Now, select resize file system option
It will take some time to complete the process. Once it is finished, reboot your phone by going to TWRP recovery main menu > Reboot > System. (source)