Eg:
Dd if=/dev/zero of=image.img bs=1k count=1 seek=999999
Will give you a 1gb file of zeros that takes up 1kb of disk space until you start to write to it, at which point it will transparently “expand on write”.
truncate -s 1g image.img
Eg:
Dd if=/dev/zero of=image.img bs=1k count=1 seek=999999
Will give you a 1gb file of zeros that takes up 1kb of disk space until you start to write to it, at which point it will transparently “expand on write”.