Thank you. And I will see if that special libtar which TWRP uses can help me.And I understand that you already know this, but for others, TeMeFI's
mountscommand is a simple toybox
If you are trying to backup your data partition (off your phone) using a script, could you not use pull commands to get each individual files (unencrypted) and a
ls -l -Rto get the permissions, ownership and group info.
I would also investigate if you tar the files into a single tar file (part of toybox), that tar file would be un-encrypted, when pulled off the device. I think the tar file would also have the permissions etc stored in the file. Kinda like a live TWRP process. Looking at the GuitHub of TWRP may give you an in-road; even may help with determining the partitions you are interested in.
Another thought: Android offers some sort of cloud-based backup. I always quickly disable this when installing a ROM, so I don't know what it actually backs up. If it does the equivalent of a nandroid /data backup, then perhaps I can find the software which performs that backup and modify it for my non-cloud purposes.
Of course, I want to back up /boot, /system, and probably /vendor, as well, and I doubt that this Android cloud backup does that.