The invention provides an improved method and apparatus for creating a
snapshot of a file system. A "copy-on-write" mechanism is used. The
snapshot uses the same blocks as the active file system until the active
file system is modified. Whenever a modification occurs, the modified
data is copied to a new block and the old data is saved. In this way, the
snapshot only uses space where it differs from the active file system,
and the amount of work required to create the snapshot is small. A record
of which blocks are being used by the snapshot is included in the
snapshot itself, allowing effectively instantaneous snapshot creation and
deletion. A snapshot can also be deleted instantaneously simply by
discarding its root inode.