I've backed up a partition using sudo dd bs=8M if=/dev/sda2 | gzip > /someFolderOnSDB/sda2.img.gz.
The image is stored on a separate disk sdb. When restoring it using gunzip -k /mnt/bkp/sda2.img.gz | sudo dd of=/dev/sda2, I noticed that the image is being unzipped into the folder someFolderOnSDB where the gz file is, and I think is simultaneously being written with dd to sda2.
I don't want that. I want the unzipping to happen in memory, rather than on sdb and the portions being unzipped get directly written to sda with dd.
The unzipped image is 300GB in size. I considered using tee or/and the redirect operator >, but am unsure how.