I guess the problem is related to cache partition. you can try to fix it with
fastboot format:ext4 cache
or from twrp recovery with
adb shell twrp wipe cache
also formatting the cache partition will help
adb shell mke2fs -t ext4 /dev/block/mmcblk0p27
You can manually backup your data (sdcard) partition. if data is encrypted, mount it with
twrp decrypt <password>
where you have to use your screen lock pin/password. if you use a screen lock pattern you must translate it to password (see https://blog.alxu.ca/unlocking-large-pattern-encryption-in-twrp.html)
GNU tar for android and external MicroSD Card or USB-OTG flash drive is required for this. The tar binary is included in open_gapps.zip, download and unpack it, copy the binary to MicroSD Card and rename it to "tar"
mkdir /data
mount -t ext4 -o ro,noexec,noload,noatime /dev/block/mmcblk0p28 /data
cp /external_sd/tar /tmp
chmod a+x /tmp/tar
/tmp/tar --selinux --xattrs --numeric-owner -vcpP /data | gzip | split -a 1 -b 1024m - /external_sd/data.ext4.tar.gz.
if partition is not mountable, you can copy the partition with dd
dd if=/dev/block/mmcblk0p28 of=/external_sd/data.img bs=1024 count=28551146
dd if=/dev/block/dm-0 of=/external_sd/data_decrypted.img bs=1024 count=28551146
edit: (thx @ Nicolas Raoul) if your phone neither has external MicroSD Card nor USB-OTG support, you can stream the partition over adb.
adb pull /dev/block/mmcblk0p28 C:\adb\data.img
adb pull /dev/block/dm-0 C:\adb\data_decrypted.img
Open the file with OSFMount or mount it from sudo (see above command). The sdcard folder is located /data/media/0
. If you want to restore the apps later on encrypted data partition, it is recommended to create a tar archive (in addition to the above flags) with --exclude data/media
this will reduce the backup size. the restoring command line is
cat /external_sd/data.ext4.tar.gz.* | gzip -d | /tmp/tar --selinux --xattrs -vxpPC /