Removing files from dCache

From GridPP Wiki
Jump to: navigation, search

This page tells you how to delete unwanted files and directories from your dCache.

Removing individual files/directories

Rather than using srm-advisory-delete to remove files, if you have root access it is much faster and more convienient to us the standard Linux command line tools. i.e.

$ rm -f /pnfs/epcc.ed.ac.uk/data/dteam/path/to/unwanted/files/*
$ rmdir /pnfs/epcc.ed.ac.uk/data/dteam/path/to/unwanted/files/

Do not worry, everything will be consistent in PNFS and the files will be removed from the disk pools that they reside on.

Removing all files in a pool

$ cd /path/to/dcache/pool/data/
$ for id in `ls -1 0*`;do rm -f `/path/to/pathfinder2 $id`;done

where pathfinder2 is a modified version of the pathfinder script that comes with PNFS. This will determine the file path for each of the PNFS IDs that are listed in the data directory. The original publication of the script can be found in the dCache user-forum archive.

It must be noted that after I ran through the above steps to vacate some of the dteam pools in the Edinburgh production dCache there were files leftover in the pools which did not correspond to a file within PNFS:

$ /home/gcowan/pathfinder2 000100000000000000071780
 File not found : 000100000000000000071780

Running a `rep ls` in the corresponding pool domain gives the output:

000100000000000000071780 <---------E-(0)[0]> 1055162368 si={<unknown>}

Where the E corresponds to error (I think since a lot of these files have 0 file size). Typically the file should be marked as P or C, corresponding to a precious or cached file.