[Google Pixel 4a 5G ROMs, Kernels, Recoveries, & Ot] Deleted member 6200352:
I can't script worth a sh|t, hence my desire to share with other Pixel 4a5g owners, haha. Provided there is already a folder named '/partbackups' on the microsd card, the script should make a dd image backup of ALL 73 partitions on the phone, including userdata (pics, etc.) in compressed .gz format to save space (and time, since the script pipes the output to gzip).

I want to make it so it creates a folder with unique $Date$Time appended if not already existing (mkdir -p) for each backup run. So if run again it makes a new folder under /partbackups,One of these days I'll finish it, unless someone else wants to. This is just a rough draft. Requires dd utility in recovery, tested with TWRP. Need fastboot to boot TWRP

Put the script where you will remember it. I put it on the root of the phone's user storage which is /sdcard (or /emulated/0) or something. Doesnt matter where you put it (Downloads,Documents, etc.)

From Bootloader screen and phone connected to USB: fastboot boot twrp.img (unplug usb cable from phone after OK from terminal/cmd window).

TWRP should load. Goto Mount screen. Insert USB2GO usb adapter/microsd reader with properly formatted filesystem (I used ext4, but I think exfat works too?). You should see your storage there and go ahead and mount it. Then back out to main menu, goto advanced, then terminal. FYI, when mounted, the path to the mount point/microsd reader (USB2GO) is '/auto0-1/' .

Make sure to mark the script as executable: chmod +x partbackupgz.sh

run the script: ./partbackupgz.sh

There will only be output after each partition compresses over to storage. userdata (sda19) takes the longest. Let it run. It's not frozen. Does seem to use battery.

When it's done it will dump and compress each partition over on the fly with gzip.

When it's done, unmount the storage, remove and reboot. Again. I don't code/script. This is a work in progress. I'm not responsible if you open up a portal.

Please improve this script. I'll write a recovery script when I need one..Lol. Or maybe you will.

#!/system/bin/sh
dd if=/dev/block/sda1 bs=1M | gzip -c > /auto0-1/partbackups/ssd.img.gz

dd if=/dev/block/sda2 bs=1M | gzip -c > /auto0-1/partbackups/persist.img.gz

dd if=/dev/block/sda3 bs=1M | gzip -c > /auto0-1/partbackups/misc.img.gz

dd if=/dev/block/sda4 bs=1M | gzip -c > /auto0-1/partbackups/keystore.img.gz

dd if=/dev/block/sda5 bs=1M | gzip -c > /auto0-1/partbackups/frp.img.gz

dd if=/dev/block/sda6 bs=1M | gzip -c > /auto0-1/partbackups/boot_a.img.gz

dd if=/dev/block/sda7 bs=1M | gzip -c > /auto0-1/partbackups/boot_b.img.gz

dd if=/dev/block/sda8 bs=1M | gzip -c > /auto0-1/partbackups/vendor_boot_a.img.gz

dd if=/dev/block/sda9 bs=1M | gzip -c > /auto0-1/partbackups/vendor_boot_b.img.gz

dd if=/dev/block/sda10 bs=1M | gzip -c > /auto0-1/partbackups/dtbo_a.img.gz

dd if=/dev/block/sda11 bs=1M | gzip -c > /auto0-1/partbackups/dtbo_b.img.gz

dd if=/dev/block/sda12 bs=1M | gzip -c > /auto0-1/partbackups/modem_a.img.gz

dd if=/dev/block/sda13 bs=1M | gzip -c > /auto0-1/partbackups/modem_b.img.gz

dd if=/dev/block/sda14 bs=1M | gzip -c > /auto0-1/partbackups/klog.img.gz

dd if=/dev/block/sda15 bs=1M | gzip -c > /auto0-1/partbackups/metadata.img.gz

dd if=/dev/block/sda16 bs=1M | gzip -c > /auto0-1/partbackups/vbmeta_system_a.img.gz

dd if=/dev/block/sda17 bs=1M | gzip -c > /auto0-1/partbackups/vbmeta_system_b.img.gz

dd if=/dev/block/sda18 bs=1M | gzip -c > /auto0-1/partbackups/super.img.gz

dd if=/dev/block/sda19 bs=1M | gzip -c > /auto0-1/partbackups/userdata.img.gz

dd if=/dev/block/sdb1 bs=1M | gzip -c > /auto0-1/partbackups/xbl_a.img.gz

dd if=/dev/block/sdb2 bs=1M | gzip -c > /auto0-1/partbackups/xbl_config_a.img.gz

dd if=/dev/block/sdc1 bs=1M | gzip -c > /auto0-1/partbackups/xbl_b.img.gz

dd if=/dev/block/sdc2 bs=1M | gzip -c > /auto0-1/partbackups/xbl_config_b.img.gz

dd if=/dev/block/sdd1 bs=1M | gzip -c > /auto0-1/partbackups/ALIGN_TO_128K_1.img.gz

dd if=/dev/block/sdd2 bs=1M | gzip -c > /auto0-1/partbackups/cdt.img.gz

dd if=/dev/block/sdd3 bs=1M | gzip -c > /auto0-1/partbackups/ddr.img.gz

dd if=/dev/block/sde1 bs=1M | gzip -c > /auto0-1/partbackups/aop_a.img.gz

dd if=/dev/block/sde2 bs=1M | gzip -c > /auto0-1/partbackups/tz_a.img.gz

dd if=/dev/block/sde3 bs=1M | gzip -c > /auto0-1/partbackups/hyp_a.img.gz

dd if=/dev/block/sde4 bs=1M | gzip -c > /auto0-1/partbackups/abl_a.img.gz

dd if=/dev/block/sde5 bs=1M | gzip -c > /auto0-1/partbackups/keymaster_a.img.gz

dd if=/dev/block/sde6 bs=1M | gzip -c > /auto0-1/partbackups/cmnlib_a.img.gz

dd if=/dev/block/sde7 bs=1M | gzip -c > /auto0-1/partbackups/cmnlib64_a.img.gz

dd if=/dev/block/sde8 bs=1M | gzip -c > /auto0-1/partbackups/devcfg_a.img.gz

dd if=/dev/block/sde9 bs=1M | gzip -c > /auto0-1/partbackups/qupfw_a.img.gz

dd if=/dev/block/sde10 bs=1M | gzip -c > /auto0-1/partbackups/vbmeta_a.img.gz

dd if=/dev/block/sde11 bs=1M | gzip -c > /auto0-1/partbackups/reserve_1.img.gz

dd if=/dev/block/sde12 bs=1M | gzip -c > /auto0-1/partbackups/uefisecapp_a.img.gz

dd if=/dev/block/sde13 bs=1M | gzip -c > /auto0-1/partbackups/imagefv_a.img.gz

dd if=/dev/block/sde14 bs=1M | gzip -c > /auto0-1/partbackups/apdp_a.img.gz

dd if=/dev/block/sde15 bs=1M | gzip -c > /auto0-1/partbackups/multiimgoem_a.img.gz

dd if=/dev/block/sde16 bs=1M | gzip -c > /auto0-1/partbackups/featenabler_a.img.gz

dd if=/dev/block/sde17 bs=1M | gzip -c > /auto0-1/partbackups/aop_b.img.gz

dd if=/dev/block/sde18 bs=1M | gzip -c > /auto0-1/partbackups/tz_b.img.gz

dd if=/dev/block/sde19 bs=1M | gzip -c > /auto0-1/partbackups/hyp_b.img.gz

dd if=/dev/block/sde20 bs=1M | gzip -c > /auto0-1/partbackups/abl_b.img.gz

dd if=/dev/block/sde21 bs=1M | gzip -c > /auto0-1/partbackups/keymaster_b.img.gz

dd if=/dev/block/sde22 bs=1M | gzip -c > /auto0-1/partbackups/cmnlib_b.img.gz

dd if=/dev/block/sde23 bs=1M | gzip -c > /auto0-1/partbackups/cmnlib64_b.img.gz

dd if=/dev/block/sde24 bs=1M | gzip -c > /auto0-1/partbackups/devcfg_b.img.gz

dd if=/dev/block/sde25 bs=1M | gzip -c > /auto0-1/partbackups/qupfw_b.img.gz

dd if=/dev/block/sde26 bs=1M | gzip -c > /auto0-1/partbackups/vbmeta_b.img.gz

dd if=/dev/block/sde27 bs=1M | gzip -c > /auto0-1/partbackups/reserve_2.img.gz

dd if=/dev/block/sde28 bs=1M | gzip -c > /auto0-1/partbackups/uefisecapp_b.img.gz

dd if=/dev/block/sde29 bs=1M | gzip -c > /auto0-1/partbackups/imagefv_b.img.gz

dd if=/dev/block/sde30 bs=1M | gzip -c > /auto0-1/partbackups/apdp_b.img.gz

dd if=/dev/block/sde31 bs=1M | gzip -c > /auto0-1/partbackups/multiimgoem_b.img.gz

dd if=/dev/block/sde32 bs=1M | gzip -c > /auto0-1/partbackups/featenabler_b.img.gz

dd if=/dev/block/sde33 bs=1M | gzip -c > /auto0-1/partbackups/devinfo.img.gz

dd if=/dev/block/sde34 bs=1M | gzip -c > /auto0-1/partbackups/spunvm.img.gz

dd if=/dev/block/sde35 bs=1M | gzip -c > /auto0-1/partbackups/splash.img.gz

dd if=/dev/block/sde36 bs=1M | gzip -c > /auto0-1/partbackups/limits.img.gz

dd if=/dev/block/sde37 bs=1M | gzip -c > /auto0-1/partbackups/limits-cdsp.img.gz

dd if=/dev/block/sde38 bs=1M | gzip -c > /auto0-1/partbackups/toolsfv.img.gz

dd if=/dev/block/sde39 bs=1M | gzip -c > /auto0-1/partbackups/logfs.img.gz

dd if=/dev/block/sde40 bs=1M | gzip -c > /auto0-1/partbackups/storsec.img.gz

dd if=/dev/block/sde41 bs=1M | gzip -c > /auto0-1/partbackups/uefivarstore.img.gz

dd if=/dev/block/sde42 bs=1M | gzip -c > /auto0-1/partbackups/secdata.img.gz

dd if=/dev/block/sdf1 bs=1M | gzip -c > /auto0-1/partbackups/ALIGN_TO_128K_2.img.gz

dd if=/dev/block/sdf2 bs=1M | gzip -c > /auto0-1/partbackups/modemst1.img.gz

dd if=/dev/block/sdf3 bs=1M | gzip -c > /auto0-1/partbackups/modemst2.img.gz

dd if=/dev/block/sdf4 bs=1M | gzip -c > /auto0-1/partbackups/fsg.img.gz

dd if=/dev/block/sdf5 bs=1M | gzip -c > /auto0-1/partbackups/fsc.img.gz