Considerations for working with HDFS snapshots
You can create snapshots only for directories that allow the creation of snapshots. If a directory already contains snapshots, you cannot delete or rename the directory unless you remove all the snapshots.
- You must enable snapshot creation on a particular directory before creating snapshots on that directory. However, you cannot create snapshots on a directory if its corresponding child or parent directory is already enabled for snapshot creation.
- There is no limit on the number of directories on which you can enable snapshot creation. However, you can create a maximum of 65,536 snapshots for a directory.
- You cannot delete or rename a directory that contains snapshots. You must first remove all the snapshots before attempting the delete or rename operation.
- For a directory that has snapshot creation enabled, its path component
.snapshotcan be used to access the snapshots.
For example, consider the directory
/foothat is enabled for snapshot creation. For the directory
/foowith a snapshot
snap1, the path
/foo/.snapshot/snap1refers to the snapshot of
- You can enable or disable snapshot creation on a particular directory only if you have the superuser privilege.
- On a directory that has snapshot creation enabled; you can create, delete, or rename snapshots. These operations require either the superuser privilege or the owner access to the directory. In addition, you can list directories that have snapshot creation enabled or view differences between contents of snapshots.