Difference: UserGuideWeb ( vs. 1)

Revision 12014-06-04 - YaoQiuling

Line: 1 to 1
-- YaoQiuling - 2014-06-04

CASTOR is a hierarchical storage management (HSM) system developed at CERN for files which may be migrated between front-end disk and back-end tape storage hierarchies. Tape library management software of computing center is modified on the basis of CASTOR Castor clients are installed on both Login nodes and Computing nodes.

A.Application access

Before access to the tape library, the user must have an afs account, then send an access application form to their experiment administrator. The administrator will contact the computing center. After approval, the user will receive an e-mail.

Bes Administrator˶Ƶ wensp@ihep.ac.cn Phone88236067

Ybj Administratorⳬ wucy@ihep.ac.cn Phone88233008

B.CASTOR commands

The following describes CASTOR commands, for details please refer to CASTOR USER MANUAL.

B1. Check CASTOR directory

Before write or read a CASTOR file, please check the CASTOR directory firstly.

Normal user:

#nsls /castor/ihep.ac.cn/user/t/test

BES group:
#nsls /castor/ihep.ac.cn/bes/offline

BES online group:
#nsls /castor/ihep.ac.cn/bes/run

DYB group:

#nsls /castor/ihep.ac.cn/dyb

YBJ group:
#nsls /castor/ihep.ac.cn/ybj

B2. CASTOR file operations

Copy file with rfcpx

Copy a local file to CASTOR, or copy from CASTOR to local file via rfcpx. ‘rfcpx’supports one file copy or multi files copy. For details, execute ‘rfcpx –h’.


rfcpx /castor/ihep.ac.cn/data/ntpl/h/tar/h012*.tar /tmp

Copy the leading‘h012’files from CASTOR to local directory /tmp

rfcpx /etc/hosts /castor/ihep.ac.cn/user/t/test/notape

Copy local file /etc/hosts to CASTOR

List a CASTOR directory with nsls

nsls -l /castor/ihep.ac.cn/user/t/test

mrw-r--r-- 1 test c3 39605868 Mar 06 14:48 mycastorfile1

-rw-r--r-- 1 test c3 46206846 Mar 06 14:52 mycastorfile2

The leading 'm' in the mode bits of mycastorfile1 indicates that the file has been migrated to tape. File mycastorfile2 has not yet been migrated to tape.

Viewing the status of files on staging disks with stageqryx

While a file resides on a disk pool or is being recalled to disk its status may be seen by the stageqry command using the -M option.Found in [stager:userPool]

File name State Nbacc. Size Pool

mycastorfile2 STAGED 1 0.0/0 userPool

Renaming files and directories with rfrename

This command implements the rename part of the normal UNIX mv command, i.e. physical data movement cannot be performed (e.g. rename a UNIX file to CASTOR will not work). If files are renamed their fileclass remains unchanged.

The syntax is: rfrename old_path new_path. e.g.

rfrename /castor/ihep.ac.cn/user/t/test/mycastorfile1 /castor/ ihep.ac.cn/user/t/test/myfile1

There is no restriction to when a CASTOR file can be renamed, e.g. the file does not need to have been migrated to tape.

Creating new directories with nsmkdir

nsmkdir /castor/ihep.ac.cn/user/t/test/test-directory

Creating new user directories is the sole responsibility of the user. Creating experiment directories is sometimes done by the data manager of the experiment concerned

Removing files or directories with rfrm

For convenience, the rfrm command also supports recursive remove of directories (-r option).

rfrm /castor/ihep.ac.cn/user/t/test/myfile1

Please be careful to use this command!

Changing file permissions with rfcpmod

rfchmod 750 /castor/ihep.ac.cn/user/t/test/mycastorfile

Changing ownership of experiment directories with nschown

Group administrators, i.e. those users registered in the Castor User Privilege Validation (Cupv) scheme for this purpose, may change the ownership of any directory in their group by using the command:

nschown userid:gg path

A list of group administrations for a given group may be seen by : 'Cupvlist --priv GRP_ADMIN --group gg' where gg is the two character Computer group for your experiment. Otherwise the use of nschown is a root privilege.

C Good Practices

C1 Store only large files (>80MB) in CASTOR directories

CASTOR was designed for large files.Too many small files will lead to the waste of tape capacity.If you have small files to write,use ‘tar’ command is recouraged.


tar -cvf txt.tar *.txt Pack all txt file to a file named txt.tar

tar -cvf home.tar /myhome Pack /myhome directory to a file named home.tar

tar -czvf data.tar.gz /data01 Compress and Pack /data01 directory to a file named data.tar.gz

C2 Do not use CASTOR as a file backup system

Do your file backups using a backup system. CASTOR, a Hierarchical Storage Manager, does not have the ability to do incremental backups. Repeated use of CASTOR to backup user files will thus result in many obsolete files.

C3 Use the absolute path of CASTOR commands

For some CASTOR commands is the same as cluster commands,please use the abosule path /usr/local/bin.

/usr/local/bin/rfcpx /mydata /castor/ihep.ac.cn/user/t/test

C4 CASTOR supports

Ҧ yaoql@ihep.ac.cn 88236007
֣ ΰ zhengw@ihep.ac.cn 88236087
ҫ chyd@ihep.ac.cn 88236008

C5 CASTOR document

CASTOR User Manualhttp://twiki.ihep.ac.cn/twiki/view/Castor/UserManual

This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback