The present invention relates to methods and systems of snapshot management of
a file system in a data storage system. To represent the snapshots, the invention
maintains pointers to the root block pointer of each snapshot. When the active
file system is modified, this invention avoids overwriting any blocks used by previous
snapshots by allocating new blocks for the modified blocks. When the invention
needs to put an established block in a new location, it must update a parent block
to point to the new location. The update to the parent block may then require allocating
a new block for the new parent block and so forth. Parts of the file system not
modified since a snapshot remain in place. The amount of space required to represent
snapshots scales with the fraction of the file system that users modify. To maintain
snapshot integrity, this invention keeps track of the first and last snapshots
that use each block in space map blocks spread throughout the file system data
space. When users delete snapshots, this invention may use a background process
to find blocks no longer used by any snapshot and makes them available for future use.