List all snapshots from a pool

Here is a command on How-To list all snapshot from a volume:

1
rbd ls -l [POOL_NAME] | grep '@'

This way you’ll see each snapshot contained in [POOL_NAME] (do not forget to replace according to your needs).

 

Here is a little bash script I’m using to list all snapshots from all pool:

1
2
3
4
5
6
#!/bin/sh
for pool in `rados lspools`;
do echo "POOL :" $pool;
rbd ls -l $pool | grep '@';
echo "------------------------------";
done

 

You can easily adapt it to one pool only (do not forget to replace [POOL_NAME] in this case):

1
2
3
4
5
#!/bin/sh
for snapshot in `rbd ls -l [POOL_NAME] | grep '@'`;
do rbd ls -l $pool | grep '@';
echo "------------------------------";
done