FindSizeOnDcache

From T2B Wiki
Jump to navigation Jump to search

How to find the size of a directory on dcache

As a simple du does not work on our system (files larger than 2GB are reported as having a size=1), we need to query the database directly. On our system we have 2 options for this.

direct query on the database

First, go to the dcache admin interface and find the pnfsid of the directory you want to test

cd PnfsManager
pnfsidof <directory>

This gives you <pnfsid>


cd /pnfs/fs/usr
 . /usr/etc/pnfsSetup
export PATH=$PATH:/opt/pnfs/tools

pnfsDump -r <pnfsid>   -o simple /tmp/files-diff.txt
awk '/File/ {print $5}' /tmp/files-diff.txt | tr -d '(' | tr -d ')' > /tmp/file.sizes.txt
awk '{sum +=$0} END {print sum}' /tmp/file.sizes.txt


This procedure gives the total size in bytes.

Automated script

on maite:

cd /root/damadori/final

adapt the file quota.cfg in order to have the correct directory and run:

./script.sh

The results are displayed on http://maite.iihe.ac.be:2288/quota
Note that both procedures can take up quite some time to finish


Template:TracNotice