Chapter 8. Snapshot Basics


The following procedures demonstrate how to create, list, and remove snapshots using the rbd command on the command line.

8.1. Create Snapshot

To create a snapshot with rbd, specify the snap create option, the pool name and the image name:

rbd --pool {pool-name} snap create --snap {snap-name} {image-name}
rbd snap create {pool-name}/{image-name}@{snap-name}
Copy to Clipboard Toggle word wrap

For example:

rbd --pool rbd snap create --snap snapname foo
rbd snap create rbd/foo@snapname
Copy to Clipboard Toggle word wrap

8.2. List Snapshots

To list snapshots of an image, specify the pool name and the image name:

rbd --pool {pool-name} snap ls {image-name}
rbd snap ls {pool-name}/{image-name}
Copy to Clipboard Toggle word wrap

For example:

rbd --pool rbd snap ls foo
rbd snap ls rbd/foo
Copy to Clipboard Toggle word wrap

8.3. Rollback Snapshot

To rollback to a snapshot with rbd, specify the snap rollback option, the pool name, the image name and the snap name:

rbd --pool {pool-name} snap rollback --snap {snap-name} {image-name}
rbd snap rollback {pool-name}/{image-name}@{snap-name}
Copy to Clipboard Toggle word wrap

For example:

rbd --pool rbd snap rollback --snap snapname foo
rbd snap rollback rbd/foo@snapname
Copy to Clipboard Toggle word wrap
Note

Rolling back an image to a snapshot means overwriting the current version of the image with data from a snapshot. The time it takes to execute a rollback increases with the size of the image. It is faster to clone from a snapshot than to rollback an image to a snapshot, and it is the preferred method of returning to a pre-existing state.

8.4. Delete a Snapshot

To delete a snapshot with rbd, specify the snap rm option, the pool name, the image name and the username:

rbd --pool {pool-name} snap rm --snap {snap-name} {image-name}
rbd snap rm {pool-name}/{image-name}@{snap-name}
Copy to Clipboard Toggle word wrap

For example:

rbd --pool rbd snap rm --snap snapname foo
rbd snap rm rbd/foo@snapname
Copy to Clipboard Toggle word wrap
Note

Ceph OSDs delete data asynchronously, so deleting a snapshot doesn’t free up the disk space immediately.

8.5. Purge Snapshots

To delete all snapshots for an image with rbd, specify the snap purge option and the image name:

rbd --pool {pool-name} snap purge {image-name}
rbd snap purge {pool-name}/{image-name}
Copy to Clipboard Toggle word wrap

For example:

rbd --pool rbd snap purge foo
rbd snap purge rbd/foo
Copy to Clipboard Toggle word wrap
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat