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 consider the following when working with HDFS snapshots:
- You must enable snapshot creation on a particular directory before creating snapshots on that directory. Such a directory is termed as a snapshottable directory. However, you cannot create snapshots on a directory if its corresponding child or parent directory is already enabled for snapshot creation.
- 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 snapshottable directory, 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 snapshottable directory; 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.
- You cannot rename a snapshot outside the snapshottable directory.