Comment

Comment by mrb

  $ dd if=/dev/zero of=/tmp/disk1.img bs=1024 count=10485760
is a terribly inefficient way of creating a test image. It wastes 10GB of disk space. It takes dozen of seconds to run. Etc. Instead you can create a sparse file of 10GB that takes 0 bytes on disk. The creation of such a file is instantaneous:

  $ dd if=/dev/zero of=/tmp/disk1.img bs=1024 seek=10485760 count=0
The key is seek=XXX. The filesystem will not allocate blocks before this offset. An application reading before this offset will just read virtual zero bytes.

Otherwise, this is a nice succinct article showcasing the snapshot/clone feature and send/receive snapshot deltas between 2 systems.

Edit: on Mac OS X, UFS supports sparse file, but not HFS+. On Linux, all major fs support sparse files.

parent mrb 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton