I think you can do a find for the inode (-inum n). At last I hope you can. However, I vaguely remember that there was a thread where someone gave a really nice MDS command for finding the path to an inode in no time. Best regards, ================= Frank Schilder AIT Risø Campus Bygning 109, rum S14 ________________________________________ From: Marc Roos <M.Roos@f1-outsourcing.eu> Sent: 17 December 2019 14:19:54 To: Frank Schilder; taeuber Cc: ceph-users Subject: RE: [ceph-users] Re: list CephFS snapshots Thanks, Good tip! If I do not know where I created these, is there a way to get their location in the filesystem? Or maybe a command that deletes by snapid? { "snapid": 54, "ino": 1099519875627, "stamp": "2017-09-13 21:21:35.769863", "name": "snap-20170913" }, { "snapid": 153485, "ino": 1099519910289, "stamp": "2019-10-06 03:18:03.933510", "name": "snap-6" }, { "snapid": 153489, "ino": 1099519910289, "stamp": "2019-10-07 03:21:03.218324", "name": "snap-7" }, -----Original Message----- Cc: ceph-users@ceph.io Subject: [ceph-users] Re: list CephFS snapshots Have you tried "ceph daemon mds.NAME dump snaps" (available since mimic)? ================= Frank Schilder AIT Risø Campus Bygning 109, rum S14 ________________________________________ From: Lars Täuber <taeuber@bbaw.de> Sent: 17 December 2019 12:32:34 To: Stephan Mueller Cc: ceph-users@ceph.io Subject: [ceph-users] Re: list CephFS snapshots Hi Michael, thanks for your gist. This is at least a way to do it. But there are many directories in our cluster. The "find $1 -type d" lasts for about 90 minutes to find all 2.6 million directories. Is there another (faster) way e.g. via mds? Cheers, Lars Mon, 16 Dec 2019 17:03:41 +0000 Stephan Mueller <smueller@suse.com> ==> "taeuber@bbaw.de" <taeuber@bbaw.de>, "ceph-users@ceph.io" <ceph-users@ceph.io> :
Hi Lars,
Is there a mean to list all snapshots existing in a (subdir of) Cephfs? I can't use the find dommand to look for the ".snap" dirs.
You can, but you can't search for the '.snap' directories, you have to
append them to the directory like `find $cephFsDir/.snap` but I it's better to use `ls` instead, to list all snapshots.
I'd like to remove certain (or all) snapshots within a CephFS. But how do I find them?
I just created a gist for you that can do that: https://gist.github.com/Devp00l/2473f5953d578f440fc71b3d602a9c23
As you can see in the script, snapshots starting with an underscore are filtered out as these directories belong to snapshots that were created in upper directories and these underscore snapshots can't be used for deletion.
The deletion of a snapshot can be done by calling `rmdir`.
But if you really want to manage CephFS snapshots easily take a look at the dashboard, as we have integrated the snapshot and quota management by now :)
You can delete multiple snapshots of a directory or just create new snapshots on a directory basis easily through the UI.
Stephan
ceph-users mailing list -- ceph-users@ceph.io To unsubscribe send an email to ceph-users-leave@ceph.io