Creating a snapshot for a Ceph File System

You can create an immutable, point-in-time view of a Ceph File System (CephFS) by creating a snapshot.

About this task

Note: For a new Ceph File System, snapshots are enabled by default.

Procedure

  1. Log into the Cephadm shell.
    [root@mds ~]# cephadm shell
  2. For existing Ceph File Systems, enable the snapshot feature.
    ceph fs set FILE_SYSTEM_NAME allow_new_snaps true
    For example:
    [ceph: root@mds ~]# ceph fs set cephfs01 allow_new_snaps true
  3. Create a snapshot subdirectory under the .snap directory.
    mkdir NEW_DIRECTORY_PATH
    The following example creates the new-snaps subdirectory, informing the Ceph Metadata Server (MDS) to start making snapshots.
    [ceph: root@mds ~]# mkdir /.snap/new-snaps

Deleting snapshots

Procedure

Important: Attempting to delete root-level snapshots, which might contain underlying snapshots, will fail.

Delete snapshots.
rmdir NEW_DIRECTORY_PATH
For example:
[ceph: root@mds ~]# rmdir /.snap/new-snaps