At the moment I
- Create an image
- Then Squasfs the image to a new .sqshfs file
- Delete the original image after (2) completed.
Problem is that I backup freespace-nulled disk images and therefore the img is as big as the partition on the archive drive. The squashfs compression of the drive is way smaller.
I am wondering if I can create an image and compress at the same time (same as targz can do) in order not to first have to create the large image that takes up huge space during the process.
Assuming I want to back up /dev/sda5
Then using the pseudo file switch in mksquashfs I tried the following
imagetobackup="/dev/sda5" pathtoincludingimagefile=sda5.img newimagefilenameinsidesquashfs=sda5-new.img mksquashfs $pathtoincludingimagefile -p '$newimagefilenameinsidesquashfs dd if=$imagetobackup bs=10M'
But I cant get it to work from what I sort of understand from the squashfs manual. I am making a syntax error as I dont know where to include the target squashed filename etc.
Anyone knows how ?