quickest way to delete all files (and directories) in a file system
Hello everyone, this should be a simple question, but we can't quite figure out how to best proceed. We have some file systems that we want to, basically, empty out. As in remove all files and directories currently on them. Both contain a pretty large number of files/directories (something like 50,000,000, with sometimes silly characters in the file names). 'rm -rf' clearly isn't the way to go forward. We've come up with either 'mmapplypolicy' (i.e. a policy to remove all files) or removing and re-creating the file systems as options (open to other suggestions!). We want the file systems still; ideally without having to redo the authentication and key swaps etc for the 'remote' clusters using them. This is a Lenovo DSS, but I don't think it makes much of a difference. So - what's the best way to proceed? If it is mmapplypolicy - does anyone have a (tested/known working) example of a policy to simply remove all files? Thanks, Tina -- Tina Friedrich, Advanced Research Computing Snr HPC Systems Administrator Research Computing and Support Services IT Services, University of Oxford http://www.arc.ox.ac.uk http://www.it.ox.ac.uk
Hi Tina, I think its much faster to recreate the file system after that .. it is enough to do mmauth grant {RemoteClusterName | all} -f {Device in my case ..its always ... grant all -f all π and every remote mount will work as before.. the remote cluster key information is in the cluster CCR .. not in the filesystem.. Pay attention.. when you 'll create the file system, it will be created with the current code's version... in Case remote cluster is backlevel.. don't forget to specify --version have fun π ________________________________ Von: gpfsug-discuss <gpfsug-discuss-bounces@gpfsug.org> im Auftrag von Tina Friedrich <tina.friedrich@it.ox.ac.uk> Gesendet: Donnerstag, 30. Juni 2022 13:31 An: 'gpfsug main discussion list' <gpfsug-discuss@spectrumscale.org> Betreff: [EXTERNAL] [gpfsug-discuss] quickest way to delete all files (and directories) in a file system Hello everyone, this should be a simple question, but we can't quite figure out how to best proceed. We have some file systems that we want to, basically, empty out. As in remove all files and directories currently on them. Both contain a pretty large number of files/directories (something like 50,000,000, with sometimes silly characters in the file names). 'rm -rf' clearly isn't the way to go forward. We've come up with either 'mmapplypolicy' (i.e. a policy to remove all files) or removing and re-creating the file systems as options (open to other suggestions!). We want the file systems still; ideally without having to redo the authentication and key swaps etc for the 'remote' clusters using them. This is a Lenovo DSS, but I don't think it makes much of a difference. So - what's the best way to proceed? If it is mmapplypolicy - does anyone have a (tested/known working) example of a policy to simply remove all files? Thanks, Tina -- Tina Friedrich, Advanced Research Computing Snr HPC Systems Administrator Research Computing and Support Services IT Services, University of Oxford http://www.arc.ox.ac.uk http://www.it.ox.ac.uk _______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at gpfsug.org http://gpfsug.org/mailman/listinfo/gpfsug-discuss_gpfsug.org H
For speed Olafβs recommendation is the best option. If you really do not want to remove the file systems and recreate them, and the version of Scale is fairly current, you could use the mmfind command to simplify creating a policy to remove the files. Still removing 50M files will take some time. Fred Fred Stock, Spectrum Scale Development Advocacy stockf@us.ibm.com<mailto:stockf@us.ibm.com> | 720-430-8821 From: gpfsug-discuss <gpfsug-discuss-bounces@gpfsug.org> on behalf of Olaf Weiser <olaf.weiser@de.ibm.com> Date: Thursday, June 30, 2022 at 8:09 AM To: 'gpfsug main discussion list' <gpfsug-discuss@spectrumscale.org> Subject: [EXTERNAL] Re: [gpfsug-discuss] quickest way to delete all files (and directories) in a file system Hi Tina, I think its much faster to recreate the file system after that .. it is enough to do mmauth grant {RemoteClusterName | all} -f {Device in my case ..its always ... grant all -f all π β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β ZjQcmQRYFpfptBannerStart This Message Is From an External Sender This message came from outside your organization. ZjQcmQRYFpfptBannerEnd Hi Tina, I think its much faster to recreate the file system after that .. it is enough to do mmauth grant {RemoteClusterName | all} -f {Device in my case ..its always ... grant all -f all π and every remote mount will work as before.. the remote cluster key information is in the cluster CCR .. not in the filesystem.. Pay attention.. when you 'll create the file system, it will be created with the current code's version... in Case remote cluster is backlevel.. don't forget to specify --version have fun π ________________________________ Von: gpfsug-discuss <gpfsug-discuss-bounces@gpfsug.org> im Auftrag von Tina Friedrich <tina.friedrich@it.ox.ac.uk> Gesendet: Donnerstag, 30. Juni 2022 13:31 An: 'gpfsug main discussion list' <gpfsug-discuss@spectrumscale.org> Betreff: [EXTERNAL] [gpfsug-discuss] quickest way to delete all files (and directories) in a file system Hello everyone, this should be a simple question, but we can't quite figure out how to best proceed. We have some file systems that we want to, basically, empty out. As in remove all files and directories currently on them. Both contain a pretty large number of files/directories (something like 50,000,000, with sometimes silly characters in the file names). 'rm -rf' clearly isn't the way to go forward. We've come up with either 'mmapplypolicy' (i.e. a policy to remove all files) or removing and re-creating the file systems as options (open to other suggestions!). We want the file systems still; ideally without having to redo the authentication and key swaps etc for the 'remote' clusters using them. This is a Lenovo DSS, but I don't think it makes much of a difference. So - what's the best way to proceed? If it is mmapplypolicy - does anyone have a (tested/known working) example of a policy to simply remove all files? Thanks, Tina -- Tina Friedrich, Advanced Research Computing Snr HPC Systems Administrator Research Computing and Support Services IT Services, University of Oxford http://www.arc.ox.ac.uk<http://www.arc.ox.ac.uk> http://www.it.ox.ac.uk<http://www.it.ox.ac.uk> _______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at gpfsug.org http://gpfsug.org/mailman/listinfo/gpfsug-discuss_gpfsug.org<http://gpfsug.org/mailman/listinfo/gpfsug-discuss_gpfsug.org> H
Hi, Perhaps use filesets?Β Quicker to remove and recreate? Keep safe, Antony Steel CTO Belisama amailto:ntony.steel@belisama.com.sg Singapore: +65 9789 6663 Australia +61 4 1980 3049 http://www.belisama.com.sg ---- On Thu, 30 Jun 2022 21:31:43 +1000 Tina Friedrich <tina.friedrich@it.ox.ac.uk> wrote --- Hello everyone, this should be a simple question, but we can't quite figure out how to best proceed. We have some file systems that we want to, basically, empty out. As in remove all files and directories currently on them. Both contain a pretty large number of files/directories (something like 50,000,000, with sometimes silly characters in the file names). 'rm -rf' clearly isn't the way to go forward. We've come up with either 'mmapplypolicy' (i.e. a policy to remove all files) or removing and re-creating the file systems as options (open to other suggestions!). We want the file systems still; ideally without having to redo the authentication and key swaps etc for the 'remote' clusters using them. This is a Lenovo DSS, but I don't think it makes much of a difference. So - what's the best way to proceed? If it is mmapplypolicy - does anyone have a (tested/known working) example of a policy to simply remove all files? Thanks, Tina -- Tina Friedrich, Advanced Research Computing Snr HPC Systems Administrator Research Computing and Support Services IT Services, University of Oxford http://www.arc.ox.ac.uk http://www.it.ox.ac.uk _______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at gpfsug.org http://gpfsug.org/mailman/listinfo/gpfsug-discuss_gpfsug.org
Hi Tina Please see attachment for a working version of 'mmrmdir', that I've been using for over 10 years. You may have to tweak it a bit for the name of the node you want to run it from, and the location of the policy (also attached). I have used all the suggested ways so far on this thread to delete files in bulk. I still prefer to use this script when I don't want to disturb anything else on the cluster setup, in particular multi-cluster as you appear to have. It gives absolute and fine control of what to delete. You may also use it in test mode, and gradually delete only subsets of directories if you wish. Traversing the inodes database and creating the list of files to delete is what takes most of the time, whether deleting 1M or 50M files. To that effect, deleting and recreating file systems or filesets still takes a very long time, if those areas are populated with files. Best Jaime On 6/30/22 07:31, Tina Friedrich wrote:
Hello everyone,
this should be a simple question, but we can't quite figure out how to best proceed.
We have some file systems that we want to, basically, empty out. As in remove all files and directories currently on them. Both contain a pretty large number of files/directories (something like 50,000,000, with sometimes silly characters in the file names). 'rm -rf' clearly isn't the way to go forward.
We've come up with either 'mmapplypolicy' (i.e. a policy to remove all files) or removing and re-creating the file systems as options (open to other suggestions!).
We want the file systems still; ideally without having to redo the authentication and key swaps etc for the 'remote' clusters using them.
This is a Lenovo DSS, but I don't think it makes much of a difference.
So - what's the best way to proceed?
If it is mmapplypolicy - does anyone have a (tested/known working) example of a policy to simply remove all files?
Thanks, Tina
--- Jaime Pinto - Storage Analyst SciNet HPC Consortium - www.scinet.utoronto.ca University of Toronto 661 University Ave. (MaRS), Suite 1140 Toronto, ON, M5G1M1 P: 416-978-2755 C: 416-505-1477
If you have MPI infrastructure set up already on some clients, 'drm' from the MPI File Utils can delete them fairly quickly (e.g. with 256 procs) https://github.com/hpc/mpifileutils On 6/30/22 4:31 AM, Tina Friedrich wrote:
Hello everyone,
this should be a simple question, but we can't quite figure out how to best proceed.
We have some file systems that we want to, basically, empty out. As in remove all files and directories currently on them. Both contain a pretty large number of files/directories (something like 50,000,000, with sometimes silly characters in the file names). 'rm -rf' clearly isn't the way to go forward.
We've come up with either 'mmapplypolicy' (i.e. a policy to remove all files) or removing and re-creating the file systems as options (open to other suggestions!).
We want the file systems still; ideally without having to redo the authentication and key swaps etc for the 'remote' clusters using them.
This is a Lenovo DSS, but I don't think it makes much of a difference.
So - what's the best way to proceed?
If it is mmapplypolicy - does anyone have a (tested/known working) example of a policy to simply remove all files?
Thanks, Tina
participants (6)
-
Antony Steel -
Cameron Harr -
Frederick Stock -
Jaime Pinto -
Olaf Weiser -
Tina Friedrich
