[Moto G5 Plus Guides, News, & Discussion] gumpysitruc@gmail.com:
Here is an example of a bash script used for a backup of another device. Start points/partitions will need to be modified for this device.

echo This script REQUIRES an adb root shell and saves the backup to a folder named "'z958_blocks'" in your home directory.
echo To run this script under windows rename it to Backup_all.bat. Put a # in front of the lines beginning with "sed"
echo and remove the # from the line beginning with pause. Also change the adb pull line. Details below.

echo
echo Press enter key to begin or Ctrl-C to abort.
#sed -n q </dev/tty
#for windows comment out the sed line above and uncomment the pause line below.
pause >nul
echo Working...
adb shell mkdir /storage/sdcard1/mybckup

adb shell "dd if=/dev/block/mmcblk0p1 of=/storage/sdcard1/mybckup/sbl1"
adb shell "dd if=/dev/block/mmcblk0p2 of=/storage/sdcard1/mybckup/ddr"
adb shell "dd if=/dev/block/mmcblk0p3 of=/storage/sdcard1/mybckup/rpm"
adb shell "dd if=/dev/block/mmcblk0p4 of=/storage/sdcard1/mybckup/tz"
adb shell "dd if=/dev/block/mmcblk0p5 of=/storage/sdcard1/mybckup/hyp"
adb shell "dd if=/dev/block/mmcblk0p6 of=/storage/sdcard1/mybckup/fsg"
adb shell "dd if=/dev/block/mmcblk0p7 of=/storage/sdcard1/mybckup/pad"
adb shell "dd if=/dev/block/mmcblk0p8 of=/storage/sdcard1/mybckup/ssd"
adb shell "dd if=/dev/block/mmcblk0p9 of=/storage/sdcard1/mybckup/sec"
adb shell "dd if=/dev/block/mmcblk0p10 of=/storage/sdcard1/mybckup/ztelk"
adb shell "dd if=/dev/block/mmcblk0p11 of=/storage/sdcard1/mybckup/splash"
adb shell "dd if=/dev/block/mmcblk0p12 of=/storage/sdcard1/mybckup/echarge"
adb shell "dd if=/dev/block/mmcblk0p13 of=/storage/sdcard1/mybckup/ztecfg"
adb shell "dd if=/dev/block/mmcblk0p14 of=/storage/sdcard1/mybckup/persist"
adb shell "dd if=/dev/block/mmcblk0p15 of=/storage/sdcard1/mybckup/fsc"
adb shell "dd if=/dev/block/mmcblk0p16 of=/storage/sdcard1/mybckup/modemst1"
adb shell "dd if=/dev/block/mmcblk0p17 of=/storage/sdcard1/mybckup/modemst2"
adb shell "dd if=/dev/block/mmcblk0p18 of=/storage/sdcard1/mybckup/aboot"
adb shell "dd if=/dev/block/mmcblk0p19 of=/storage/sdcard1/mybckup/modem"
adb shell "dd if=/dev/block/mmcblk0p20 of=/storage/sdcard1/mybckup/boot"
adb shell "dd if=/dev/block/mmcblk0p21 of=/storage/sdcard1/mybckup/recovery"
adb shell "dd if=/dev/block/mmcblk0p22 of=/storage/sdcard1/mybckup/misc"
adb shell "dd if=/dev/block/mmcblk0p23 of=/storage/sdcard1/mybckup/keystore"
adb shell "dd if=/dev/block/mmcblk0p24 of=/storage/sdcard1/mybckup/config"
adb shell "dd if=/dev/block/mmcblk0p25 of=/storage/sdcard1/mybckup/oem"
adb shell "dd if=/dev/block/mmcblk0p26 of=/storage/sdcard1/mybckup/cache"
adb shell "dd if=/dev/block/mmcblk0p27 of=/storage/sdcard1/mybckup/system"
#optionally backup user data.
#adb shell "dd if=/dev/block/mmcblk0p28 of=/storage/sdcard1/mybckup/userdata"

echo BACKUP copied partitions to hard drive... A long wait.

#Linux abd pull line. Comment out for windows and uncomment adb pull below.
#adb pull /storage/sdcard1/mybckup /workarea/android/zm2/z958_blocks/
#Windows adb pull below. Comment the line above and uncomment (remove the #) the line below.
adb pull /storage/sdcard1/mybckup %CD%/workarea/android/zm2/z958_blocks/

echo BACKUP Done!
echo Press enter key to exit
#sed -n q </dev/tty
#for windows comment out the sed line above and uncomment the pause line below.
pause >nul