[Nexus 5 Original Android Development] TheSwede86:
Sorry for quite a large post.

See "Final update" at the bottom for resolution (this is solved).

Originally tried to use another Nexus 5 reformatting tool so I wouldn't say my partitions were "stock" but before I did all this below I:

* Flashed HH.R version of TWRP

* hh_repart -r

* Flashed HH.S version of TWRP

* Flashed HH.R version of TWRP

* hh_repart -m

Tried to install:

lineage-18.1-20221020-UNOFFICIAL-hammerhead-signed.zip

together ("Add more Zips") with:

open_gapps-arm-11.0-nano-20220215.zip

Lineage installs fine but for GApps I receive:

*** ERROR ***
Insufficient storage space available in System partition.
Updater process ended with ERROR: 70
Error installing zip file '/sdcard/open_gapps-arm-11.0-nano-20220215.zip'

# Begin Open GApps Install Log
------------------------------------------------------------------
ROM Android version | 11
ROM Build ID | lineage_hammerhead-userdebug 11 RQ3A.211001.001 eng.dgruzd.20221020.194602
ROM Version increment | eng.dgruzd.20221020.194602
ROM SDK version | 30
ROM/Recovery modversion | 18.1-20221020-UNOFFICIAL-hammerhead
Device Recovery | TWRP 3.7.0_9-HH.R.17-b4140668
Device Name | hammerhead
Device Model | Nexus 5
Device Type | phone
Device CPU | armeabi-v7a,armeabi
Device A/B-partitions | false
Installer Platform | arm
ROM Platform | arm
Display Density Used | 480
Install Type | Dirty[Data NOT Wiped]
Google Camera already installed | false
VRMode Compatible | false
Google Camera Compatible | true
New Camera API Compatible | true[whitelist]
Google Pixel Features | false
Current GApps Version | No GApps Installed
Installing GApps Zipfile | /sdcard/open_gapps-arm-11.0-nano-20220215.zip
Installing GApps Version | 20220215
Installing GApps Type | nano
Config Type |
Using gapps-config | Not Used
Remove Stock/AOSP Browser | false[NO_Chrome]
Remove Stock/AOSP Camera | false[NO_CameraGoogle]
Remove Stock/AOSP Dialer | false[NO_DialerGoogle]
Remove Stock/AOSP Email | false[NO_Gmail]
Remove Stock/AOSP Gallery | false[NO_Photos]
Remove Stock/AOSP Launcher | false[NO_GoogleNow/PixelLauncher]
Remove Stock/AOSP MMS App | false[NO_Messenger]
Remove Stock/AOSP Pico TTS | false[default]
Ignore Google Contacts | false
Ignore Google Dialer | true[NoRemove]
Ignore Google Keyboard | false
Ignore Google Package Installer | false
Ignore Google NFC Tag | false
Ignore Google WebView | false
Total System Size (KB) | 1476384
Used System Space (KB) | 1044636
Current Free Space (KB) | 431748
Additional Space Required (KB) | 69600 << See Calculations Below
------------------------------------------------------------------
# End Open GApps Install Log

INSTALLATION FAILURE: Your device does not have sufficient space available in
the system partition to install this GApps package as currently configured.
You will need to switch to a smaller GApps package or use gapps-config to
reduce the installed size.

NOTE: The Stock/AOSP Dialer is not available on your
ROM (anymore), the Google equivalent will not be removed.
# Begin GApps Size Calculations
------------------------------------------------------------------
TYPE | DESCRIPTION | SIZE | TOTAL
| Current Free Space | 431748 | 431748
Remove | Existing GApps | + 0 | 431748
Remove | Obsolete Files | + 24 | 431772
Remove | androidauto | + 0 | 431772
Remove | cmsetupwizard | + 0 | 431772
Remove | extservicesstock | + 0 | 431772
Remove | extsharedstock | + 20 | 431792
Remove | packageinstallerstock | + 3036 | 434828
Remove | provision | + 0 | 434828
Install | Core | - 206356 | 228472
Install | batteryusage | - 5972 | 222500
Install | calsync | - 2396 | 220104
Install | dialerframework | - 12 | 220092
Install | gearheadstub | - 3168 | 216924
Install | googletts | - 46588 | 170336
Install | markup | - 4308 | 166028
Install | packageinstallergoogle | - 3144 | 162884
Install | search | - 162604 | 280
Install | soundpicker | - 6184 | -5904
Install | speech | - 39128 | -45032
Install | wellbeing | - 15352 | -60384
| Buffer Space | - 9216 | -69600
------------------------------------------------------------------
Additional Space Required | 69600
------------------------------------------------------------------

# End GApps Size Calculations

# Begin User's gapps-config

# End User's gapps-config

Running "hh_repart -d" returns:

Model: MMC SEM32G (sd/mmc)
Disk /dev/block/mmcblk0: 31268536320B
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 524288B 67633151B 67108864B fat16 modem
2 67633152B 68681727B 1048576B sbl1
3 68681728B 69206015B 524288B rpm
4 69206016B 69730303B 524288B tz
5 69730304B 70254591B 524288B sdi
6 70254592B 70778879B 524288B aboot
7 70778880B 72876031B 2097152B pad
8 72876032B 73924607B 1048576B sbl1b
9 73924608B 74448895B 524288B tzb
10 74448896B 74973183B 524288B rpmb
11 74973184B 75497471B 524288B abootb
12 75497472B 78643199B 3145728B modemst1
13 78643200B 81788927B 3145728B modemst2
14 81788928B 82313215B 524288B metadata
15 82313216B 99090431B 16777216B misc
16 99090432B 115867647B 16777216B ext4 persist
17 115867648B 119013375B 3145728B imgdata
18 119013376B 142082047B 23068672B laf
19 142082048B 165150719B 23068672B boot
20 165150720B 188219391B 23068672B recovery
21 188219392B 191365119B 3145728B fsg
22 191365120B 191889407B 524288B fsc
23 191889408B 192413695B 524288B ssd
24 192413696B 192937983B 524288B DDR
25 192937984B 1728938495B 1536000512B ext2 system
26 1728938496B 1760395775B 31457280B ext4 crypto
27 1760395776B 2032140287B 271744512B ext4 cache
28 2097152512B 2306867711B 209715200B ext4 cache
29 2306867712B 31268513791B 28961646080B ext4 userdata
30 31268513792B 31268519423B 5632B grow

Any ideas?

Appreciate any help :)

Best Regards - TheSwede86

Edit:

Reflashed to stock using these guides:

To reflash to stock:

Restore Nexus 5 to Stock and Flash Factory Images (Win/ Mac/ Linux) - DroidViews

One of the fascinating things about Android is that it lets you unleash your adventurous self. If you are just a basic or average user, you could explore millions of apps in the Play Store to make the most of your device. However, if you are even a little passionate about the phone or tablet

www.droidviews.com

To fix internal storage after reflash to stock:

Your 32GB Nexus 5 Shows 16GB Storage? Here is How to Fix It! - DroidViews

It is really a great thing to own an Android device that facilitates installing stock firmware manually. If you are an adventurous user who loves rooting and trying different custom mods and ROMs, you might be caught in a situation when you have no other choice that flashing the stock firmware...

www.droidviews.com

then enabled "Developer Mode" > "USB Debugging" & disabled "Verify apps over USB" and always allowed my computer

Booted into fastboot > Unlocked bootloader > Flashed the "HH.R" version of TWRP but now it is just in a loop trying to enter TWRP but failing:

Any ideas?

Update (again):

OK so flashed the official latest TWRP and was able to get into TWRP and then:

Wipe > Format Data > yes > Reboot

Wipe > Advanced Wipe:

Dalvik / ART Cache

System

Data

Internal Storage

Cache

> Reboot into fastboot

In Fastboot flashed HH.R version of TWRP

Ran "hh_repart -m" which was successful

Dumped the partition map which is this:

Model: MMC SEM32G (sd/mmc)
Disk /dev/block/mmcblk0: 31268536320B
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 524288B 67633151B 67108864B fat16 modem
2 67633152B 68681727B 1048576B sbl1
3 68681728B 69206015B 524288B rpm
4 69206016B 69730303B 524288B tz
5 69730304B 70254591B 524288B sdi
6 70254592B 70778879B 524288B aboot
7 70778880B 72876031B 2097152B pad
8 72876032B 73924607B 1048576B sbl1b
9 73924608B 74448895B 524288B tzb
10 74448896B 74973183B 524288B rpmb
11 74973184B 75497471B 524288B abootb
12 75497472B 78643199B 3145728B modemst1
13 78643200B 81788927B 3145728B modemst2
14 81788928B 82313215B 524288B metadata
15 82313216B 99090431B 16777216B misc
16 99090432B 115867647B 16777216B ext4 persist
17 115867648B 119013375B 3145728B imgdata
18 119013376B 142082047B 23068672B laf
19 142082048B 165150719B 23068672B boot
20 165150720B 188219391B 23068672B recovery
21 188219392B 191365119B 3145728B fsg
22 191365120B 191889407B 524288B fsc
23 191889408B 192413695B 524288B ssd
24 192413696B 192937983B 524288B DDR
25 192937984B 1728938495B 1536000512B ext4 system
26 1728938496B 1760395775B 31457280B ext4 crypto
27 1760395776B 2032140287B 271744512B ext4 cache
28 2097152512B 2306867711B 209715200B ext4 cache
29 2306867712B 31268513791B 28961646080B ext4 userdata
30 31268513792B 31268519423B 5632B grow

tried to install Lineage and GApps but it fails again, below are the open_gapps_log.txt:

# Begin Open GApps Install Log
------------------------------------------------------------------
ROM Android version | 11
ROM Build ID | lineage_hammerhead-userdebug 11 RQ3A.211001.001 eng.dgruzd.20221020.194602
ROM Version increment | eng.dgruzd.20221020.194602
ROM SDK version | 30
ROM/Recovery modversion | 18.1-20221020-UNOFFICIAL-hammerhead
Device Recovery | TWRP 3.7.0_9-HH.R.17-b4140668
Device Name | hammerhead
Device Model | Nexus 5
Device Type | phone
Device CPU | armeabi-v7a,armeabi
Device A/B-partitions | false
Installer Platform | arm
ROM Platform | arm
Display Density Used | 480
Install Type | Clean[Data Wiped]
Google Camera already installed | Clean
VRMode Compatible | false
Google Camera Compatible | true
New Camera API Compatible | true[whitelist]
Google Pixel Features | false
Current GApps Version | No GApps Installed
Installing GApps Zipfile | /sdcard/open_gapps-arm-11.0-nano-20220215.zip
Installing GApps Version | 20220215
Installing GApps Type | nano
Config Type |
Using gapps-config | Not Used
Remove Stock/AOSP Browser | false[NO_Chrome]
Remove Stock/AOSP Camera | false[NO_CameraGoogle]
Remove Stock/AOSP Dialer | false[NO_DialerGoogle]
Remove Stock/AOSP Email | false[NO_Gmail]
Remove Stock/AOSP Gallery | false[NO_Photos]
Remove Stock/AOSP Launcher | false[NO_GoogleNow/PixelLauncher]
Remove Stock/AOSP MMS App | false[NO_Messenger]
Remove Stock/AOSP Pico TTS | false[default]
Ignore Google Contacts | false
Ignore Google Dialer | true[NoRemove]
Ignore Google Keyboard | false
Ignore Google Package Installer | false
Ignore Google NFC Tag | false
Ignore Google WebView | false
Total System Size (KB) | 1476384
Used System Space (KB) | 1044636
Current Free Space (KB) | 431748
Additional Space Required (KB) | 69600 << See Calculations Below
------------------------------------------------------------------
# End Open GApps Install Log

INSTALLATION FAILURE: Your device does not have sufficient space available in
the system partition to install this GApps package as currently configured.
You will need to switch to a smaller GApps package or use gapps-config to
reduce the installed size.

NOTE: The Stock/AOSP Dialer is not available on your
ROM (anymore), the Google equivalent will not be removed.
# Begin GApps Size Calculations
------------------------------------------------------------------
TYPE | DESCRIPTION | SIZE | TOTAL
| Current Free Space | 431748 | 431748
Remove | Existing GApps | + 0 | 431748
Remove | Obsolete Files | + 24 | 431772
Remove | androidauto | + 0 | 431772
Remove | cmsetupwizard | + 0 | 431772
Remove | extservicesstock | + 0 | 431772
Remove | extsharedstock | + 20 | 431792
Remove | packageinstallerstock | + 3036 | 434828
Remove | provision | + 0 | 434828
Install | Core | - 206356 | 228472
Install | batteryusage | - 5972 | 222500
Install | calsync | - 2396 | 220104
Install | dialerframework | - 12 | 220092
Install | gearheadstub | - 3168 | 216924
Install | googletts | - 46588 | 170336
Install | markup | - 4308 | 166028
Install | packageinstallergoogle | - 3144 | 162884
Install | search | - 162604 | 280
Install | soundpicker | - 6184 | -5904
Install | speech | - 39128 | -45032
Install | wellbeing | - 15352 | -60384
| Buffer Space | - 9216 | -69600
------------------------------------------------------------------
Additional Space Required | 69600
------------------------------------------------------------------

# End GApps Size Calculations

# Begin User's gapps-config

# End User's gapps-config

Final update:

Went with "MindTheGapps-11.0.0-arm-20220217_095902.zip" from here:

Codefire - Listing of gapps

and IT WORKED!