[E 2015 Original Android Development] yelupic:
Just one (not so easy) way to back up:

pds = persist = /dev/block/mmcblk0p31

boot into bootloader (fastboot mode), bootloader already unlocked, no rooted device required

connect your device to your computer with the USB data cable

open a command line/shell/terminal

fastboot boot <your-recovery.img>
adb shell

# only if you don't have root in the shell ("root@device #")
#su

# create a backup directory
mkdir /sdcard/stock-rom-dump

# save all partitions to the sdcard
dd if=/dev/block/mmcblk0p1 of=/sdcard/stock-rom-dump/modem.0p1.dd.img
dd if=/dev/block/mmcblk0p2 of=/sdcard/stock-rom-dump/sbl1.0p2.dd.img
dd if=/dev/block/mmcblk0p3 of=/sdcard/stock-rom-dump/DDR.0p3.dd.img
dd if=/dev/block/mmcblk0p4 of=/sdcard/stock-rom-dump/aboot.0p4.dd.img
dd if=/dev/block/mmcblk0p5 of=/sdcard/stock-rom-dump/rpm.0p5.dd.img
dd if=/dev/block/mmcblk0p6 of=/sdcard/stock-rom-dump/tz.0p6.dd.img
dd if=/dev/block/mmcblk0p7 of=/sdcard/stock-rom-dump/hyp.0p7.dd.img
dd if=/dev/block/mmcblk0p8 of=/sdcard/stock-rom-dump/utags.0p8.dd.img
dd if=/dev/block/mmcblk0p9 of=/sdcard/stock-rom-dump/logs.0p9.dd.img
dd if=/dev/block/mmcblk0p10 of=/sdcard/stock-rom-dump/sec.0p10.dd.img
dd if=/dev/block/mmcblk0p11 of=/sdcard/stock-rom-dump/factorytune1.0p11.dd.img
dd if=/dev/block/mmcblk0p12 of=/sdcard/stock-rom-dump/padA.0p12.dd.img
dd if=/dev/block/mmcblk0p13 of=/sdcard/stock-rom-dump/metadata.0p13.dd.img
dd if=/dev/block/mmcblk0p14 of=/sdcard/stock-rom-dump/abootBackup.0p14.dd.img
dd if=/dev/block/mmcblk0p15 of=/sdcard/stock-rom-dump/rpmBackup.0p15.dd.img
dd if=/dev/block/mmcblk0p16 of=/sdcard/stock-rom-dump/tzBackup.0p16.dd.img
dd if=/dev/block/mmcblk0p17 of=/sdcard/stock-rom-dump/utagsBackup.0p17.dd.img
dd if=/dev/block/mmcblk0p18 of=/sdcard/stock-rom-dump/hypBackup.0p18.dd.img
dd if=/dev/block/mmcblk0p19 of=/sdcard/stock-rom-dump/padB.0p19.dd.img
dd if=/dev/block/mmcblk0p20 of=/sdcard/stock-rom-dump/frp.0p20.dd.img
dd if=/dev/block/mmcblk0p21 of=/sdcard/stock-rom-dump/modemst1.0p21.dd.img
dd if=/dev/block/mmcblk0p22 of=/sdcard/stock-rom-dump/modemst2.0p22.dd.img
dd if=/dev/block/mmcblk0p23 of=/sdcard/stock-rom-dump/hob.0p23.dd.img
dd if=/dev/block/mmcblk0p24 of=/sdcard/stock-rom-dump/dhob.0p24.dd.img
dd if=/dev/block/mmcblk0p25 of=/sdcard/stock-rom-dump/fsg.0p25.dd.img
dd if=/dev/block/mmcblk0p26 of=/sdcard/stock-rom-dump/fsc.0p26.dd.img
dd if=/dev/block/mmcblk0p27 of=/sdcard/stock-rom-dump/ssd.0p27.dd.img
dd if=/dev/block/mmcblk0p28 of=/sdcard/stock-rom-dump/cid.0p28.dd.img
dd if=/dev/block/mmcblk0p29 of=/sdcard/stock-rom-dump/logo.0p29.dd.img
dd if=/dev/block/mmcblk0p30 of=/sdcard/stock-rom-dump/clogo.0p30.dd.img
dd if=/dev/block/mmcblk0p31 of=/sdcard/stock-rom-dump/persist.0p31.dd.img
dd if=/dev/block/mmcblk0p32 of=/sdcard/stock-rom-dump/misc.0p32.dd.img
dd if=/dev/block/mmcblk0p33 of=/sdcard/stock-rom-dump/boot.0p33.dd.img
dd if=/dev/block/mmcblk0p34 of=/sdcard/stock-rom-dump/recovery.0p34.dd.img
dd if=/dev/block/mmcblk0p35 of=/sdcard/stock-rom-dump/factorytune2.0p35.dd.img
dd if=/dev/block/mmcblk0p36 of=/sdcard/stock-rom-dump/kpan.0p36.dd.img
dd if=/dev/block/mmcblk0p37 of=/sdcard/stock-rom-dump/padC.0p37.dd.img
dd if=/dev/block/mmcblk0p38 of=/sdcard/stock-rom-dump/sp.0p38.dd.img
dd if=/dev/block/mmcblk0p39 of=/sdcard/stock-rom-dump/keystore.0p39.dd.img
dd if=/dev/block/mmcblk0p40 of=/sdcard/stock-rom-dump/oem.0p40.dd.img
dd if=/dev/block/mmcblk0p41 of=/sdcard/stock-rom-dump/carrier.0p41.dd.img
dd if=/dev/block/mmcblk0p42 of=/sdcard/stock-rom-dump/system.0p42.dd.img

### userdata contains the internal sdcard under /data/media/... where this script writes to its output files
#dd if=/dev/block/mmcblk0p43 of=/sdcard/stock-rom-dump/cache.0p43.dd.img
#dd if=/dev/block/mmcblk0p44 of=/sdcard/stock-rom-dump/userdata.0p44.dd.img

Be patient (especially for "system").

Your internal storage (sdcard) must give you at least 2.5 GiB free space for this.