Sparse File Backups
Some backups were needed after deciding to retain Windows 10 on the Thinkpad T580. After resizing the Windows disk partitions to allocate room for Slackware partitions, the main Windows
C: partition was 79 GB. This size exceeded comfort zones for storing image files to backup disks.
To avoid the large file size a sparse image file was used. The steps are much the same as when compacting virtual disk images.
From within Slackware, the Windows
/dev/nvmen0p3 was mounted and the empty partition space was zeroed using the
dd command. Important was using the default block size of 512 bytes.
Next was creating an image file backup, again with
dd. This time the
conv=sparse parameter was used.
The image file was verified as sparse with the
du command as well as
ls -s. After zeroing empty space the Windows
C: partition image file was reduced to about 23 GB of storage space.
Last was copying the sparse files to backup disks. The
cp command has a
--sparse option. Explicitly using
cp —sparse=always is required to copy the image file. Otherwise the file will be copied without any sparse features and the final copied image file would be 79 GB.