lineageOS: cannot use internal SD after factory reset: "Failed to find root" (peregrine)
Thank you very much, @acejavelin!
The solution was to format /data with ext4 instead of f2fs:

connect with adb while in TRWP, get the device name for /data, umount it, format with ext4, mount it again


df -h
umount /data
make_ext4fs /dev/block/mmcblk0p36
mount /data/


Then reboot