Enable snapshot creation on a directory

You must enable snapshot creation on a directory before creating snapshots on that directory. If the snapshot creation is enabled, the directory becomes snapshottable.

  • You can perform this task only if you have the superuser privilege.
  • You cannot enable snapshot creation on any directory if its parent or child directory is already enabled for snapshot creation.
Run the hdfs dfsadmin command with the -allowSnapshot option and specify the directory on which you want to enable snapshot creation.
The following example shows how you can enable snapshot creation for the directory /data/dir1:
hdfs dfsadmin -allowSnapshot /data/dir1
If snapshot creation is successfully enabled on the specified directory, a confirmation message appears.
Allowing snapshot on /data/dir1 succeeded