Online Nandroid Backup and later restore of an encrypted Android L 5.1 device I am using an Android One phone with rooted Android 5.1 and the Online Nandroid Backup application to do live (o)nandroid backups. I am also using the built-in encryption, which encrypts the /data partition, but as the backup is performed on a live running system, the resulting data.img is unencrypted as I've verified with Nandroid Manager being able to extract data without asking for a password. Apparently it is not doing a block-level copy of the /data.

As the backed-up system in the system.img expects encrypted /data and the restored /data is now unencrypted, my question is if the resulting backup can be restored and booted without any problems, using fastboot for example? Will Android hang while booting if the /data partition is decrypted and the system is not factory reset? What is the correct way to perform a live backup of an encrypted Android 5.1 system?
I looked at the onandroid script and it seems that it does a block-level copy of the data with dd only for partitions that are not mounted during the normal system operation (such as recovery partition) and copies the files on the filesystem level from the mounted ones - meaning it copies the decrypted content of the data partition and others and creates a backup images out of it. Further testing would be needed to determine what happens after a recovery is made from a system image (expecting encrypted data) and non-encrypted data image.

It seems that onandroid is "best effort" software (I didn't see any mount -o remount,ro / before copying the contents of the partition - it would probably also affect the running system possibly crashing it) and is therefore best not to use it with encrypted devices. The proper way to handle them still remains encryption-supporting recovery such as TWRP (or dumping the partitions via adb pull while in ADB-supporting recovery). I would be happy to be proven wrong by someone who knows the onandroid script in greater depth.