Scanco Administration

From bone.wiki
Jump to navigation Jump to search

Introductory Material

OpenVMS Beginner's FAQ

This is very useful: http://saf.bio.caltech.edu/vms_beginners_faq.html

Helpful VMS commands

  • UNIX to OpenVMS [1]
  • Directory listing
$ dir /size=all /grand_total [...] 
$ dir [...*.aim]
  • Delete
$ delete *.aim;*
$ dl *.aim
  • Delete a directory that is full. CAUTION!
$ SET FILE/PROT=O:RWED [.SUBDIR...]*.*;*
$ DELETE [.SUBDIR...]*.*;*                  ! Repeat until no error messages appear.  Each iteration gets rid of more sub directories.
$ SET FILE/PROT=O:RWED SUBDIR.DIR
$ DELETE SUBDIR.DIR;

or

$ dl disk2:[microct.projects...]*.dir     ! A for all; do until sub-dirs are gone
$ dl subdir.dir
$ @scom:dl.com subdir.dir
  • Copy

As user system you can copy files between accounts (e.g., microct and devel). There is no need to set user/priv=bypass as this is set by default as user system.

If you want to use the backup command for copying multiple subdirectories with the three dots (e.g., disk2:[microct.data.00000034...]) then you HAVE to put an /owner=devel at the end:

$ backup/log disk2:[microct.data.00000034...] -
        disk2:[devel.data.00000034...]/own=devel
  • UNIX filenames on VMS with multiple '.'

The directory names would have been cvs-1.11.21.dir on Linux. However VMS doesn't allow more than 1 . in the name. If you enter

$ set process/parse=extended

in a terminal you'll be able to access these files. You could consider renaming them i.e. cvs-1_11_21.dir.

  • Change hosts
$ mcr latcp show service *   ! and if it shows you SCTHIN:
$ set host scthin ! or
$ set host scthin/lat
  • Send a message
$ reply/all "hello there"

Files, Disks and Backup

Undelete Files

The Disk/File Utility (DFU) will allow you to restore files that have been deleted, however, you will only be able to do so if the disk space hasn't been overwritten. This means that unless all scanning and access to the disk is stopped, you likely only have a couple of hours at most to undelete the files.

To undelete a file you need to login as "system".
$ dfu
DFU> undelete diskX: /file=myfile

For example, suppose we want to restore an RSQ (C0001234.RSQ) that was deleted from the BH data disk (disk2):
DFU> undelete disk2:/file=C0001234.RSQ
If the file can be undeleted successfully (i.e., without corruption), then you will be asked if you wish to restore the file. Type "y" or "n".
DFU> exit

NOTE: The undelete function will lock access to the disk while it searches for a file and until you respond "y" or "n" to restoring it. This means that all programs and commands trying to access the disk (i.e., by other people using the system) will appear to freeze momentarily until the disk is unlocked. If you search for a specific file, the lock period will be very short (maybe 15-30 seconds). If you search for files in general (e.g., *.RSQ), the lock period will be longer (maybe 5 to 10 minutes). Note, you cannot search specific locations for files (i.e., a folder on a disk). Files are restored to their original location on disk.

Mount a CDROM

Device could be dqa0 or dqb0. I'm not sure which works:

$ mount/foreign dqa0:

OR

$ mount/override=id dqa0:

Then

$ dismount dqa0:

Archive a directory as a .zip file to mike.kin

  • Go to the parent directory of the directory that you want to zip.

$ cd ur  ! or $ cd DISK5:[BONELAB.PROJECTS]

  • Make a zip file of your directory, for example (here the $ is just the prompt character - don't type that):
$ zip -r -V PROJ_CATS.ZIP CATS.DIR

We would like to standardize on a file naming convention of PROJ_YYYY.ZIP, where YYYY is the project name (which can be longer than 4 characters).

  • FTP your file to mike. For example
$ ftp mike.kin.ucalgary.ca

This series of ftp commands should do it:

FTP> cd /Data0/microct_archive
FTP> binary
FTP> put PROJ_CATS.zip
FTP> quit

Notice that zipped microct archives go into the /Data0/microct_archive directory.

  • You can now delete the zip file and your original directory.
delete PROJ_CATS.zip
dl CATS.DIR;1

Restore a zipped archive file from mike.kin

  • Go to the directory where you want to unzip your files.
cd DISK5:[BONELAB.PROJECT]
  • FTP the .zip file from mike. For example
$ ftp mike.kin.ucalgary.ca
FTP> cd /Data0/microct_archive
FTP> binary
FTP> get proj_cats.zip
FTP> quit
  • Now unzip it.
$ unzip PROJ_CATS.ZIP
  • You can now delete the zip file.
delete PROJ_CATS.zip

Processes and Jobs

Monitor system usage

$ monitor/interval=1 processes/topcpu
$ monitor/interval=1 system
$ show error
$ show system
$ @SCOM:SHOW_DISKS.COM (or simply $ DISKS)

The command show error may indicate errors. One or two errors is OK.

To see what processes are running (specific to the machine, not cluster wide).

$ show device disk2/file
$ show user /full

Control processors on multi-processor machines

For example, on the itanium there are two processors. By default, only one takes reconstruction jobs. The other is left for so that evaluations can take place without competing for the CPU.

But if a bottleneck is the reconstruction, it can be switched as user system:

$ set que sceva2_slow/job=2

so that it will do two reconstruction jobs simultaneously.

Understand difference between mcr and run

The command mcr is the same as run, but only with mcr you can hand over 'in-line' parameters to an .exe file:

$ run ut:ctheader.exe c000124.isq

does not work, but you have to say

$ mcr ut:ctheader.exe c000124.isq

But funnily if you define a symbol in microct_setup_user.com (or login.com),

$ ctheader :== $ut:ctheader.exe

with just neither run nor mcr, but the 'funny' $ sign, then you can also hand over the ISQ name in-line.

Small detail with big effect...

File do all -- apply one command to a whole set of files

$ fda ctheader dk0:[microct.data.0001234...]*.isq

to see the header of all isq files of sample 1234 (the three dots ... means all subdirectories)

Or:

$ fda aix dk0:[microct.data.0001234.00005678]*.aim

to see the processing log of all aim files of scan 5678

Wildcard "*" means multiple characters, "%" is for ONE character:

$ fda aix dk0:[microct.data...]C%%%%%%%.aim

(yes, 7 %'s)

to show the aim header of the gray-scale c0000135.aim (etc) files only, and NOT from the _seg.aims also.

Warning: CAUTION! Always test the wildcard expression first with

$ dir dk0:[xxx...]*.aim


The 'file do all' fda command can even be combined with a pipe, or an /output qualifier:

$ pipe fda aix dk0:[microct...]*.aim | search sys$pipe "Slope"

will show you all "Slopes" in a row. (but you may not see which slope belongs to which aim file anymore...)

or:

$ fda/output=sys$scratch:all_headers.log aix dk0:[microct...]*.aim

will write all the output into the .log file - which you can then either edit, or $ search sys$scratch:all_headers.log "String"

or whatever you want.

Another example with output:

$ pipe fda type *.log | search sys$pipe "BV/TV" /output=BVTV.txt

"fda" is our self-written script, so you may have to try-n-error a bit...

$ fda command file_wildcard [Optional: further parameters]

If the command consists of multiple words with spaces inbetween (e.g. mcr ut:xxx.exe), then enclose the command in double-quotes

$ fda "mcr ut:uct_ext_header_display" dk0:[microct...]*.isq 8

Grab more than one line using pipe and search command:

$ pipe fda aix *.aim | search sys$pipe "dim", "pos", "name"


NB: the further parameters may not contain wildcards - so unfortunately, the fda can NOT be used to 'adaptively' rename a whole bunch of files.

File Transfers To And From Other Systems

Access the shared network volume Data0 (mike)

Data0 is the data volume served by mike.kin . It should be mounted at DNFS1: on the VMS system, though it must be manually re-mounted anytime you restart the computers.

The directory path is DNFS1:[000000], which is stored under the symbol "MIKE". To get a directory listing, you can enter:

dir DNFS1:[000000]
or
dir mike

To change into the mike.kin volume and access subdirectories as you would in PROJECTS or DATA:

cd mike

Subdirectories are a little unusual. For example the dir command shows:

Directory DNFS1:[000000]

$5N$S$POTLIGHT-$V100.DIR;1              $5N$T$RASHES.DIR;1  $5NCOM.APPLE$5NTIMEMACHINE$5NDONOTPRESENT;1
$5NFSEVENTSD.DIR;1  $U$SERS.DIR;1       .$DS_S$TORE;1       ERIC.DIR;1         

To access the ERIC.DIR directory, you leave off the .DIR part. For example:

dir DNFS1:[000000.ERIC]

IMPORTANT:

Files transferred by NFS are limited in size to 2GB. (OpenVMS uses a very old NFS standard.) File transfers larger than this will fail silently!

If you copy files onto mike from a non-VMS machine and want to use it again on VMS there are two options:

  • Copy files from mike to the projects directory and change the file attribute from STREAM to FIXED
$ set file/attr=(rfm:fix,lrl:32356) <filename>.<ext>


  • Use FTP to transfer files from mike to the projects directory.


Use the PROJECT TOOLS

These tools were developed by Helen Buie and apply to the vivaCT 40 and uCT 35 systems.

Backup Tool:
$@COM:BACKUPPROJECT
-the user will be prompted for information regarding their backup
-a command script is generated based on the user's input
-a saveset file is created for the whole project
-a saveset file is created for the COM directory
-a saveset file is created for the IMA directory
-savesets are created in DISK6:[BONELAB.PROJECTS.BACKUP] for the vivaCT/uCT and DISK3:[MICROCT.PROJECTS.ARCHIVE] for the XtremeCT
-a project info file is created
-a file list is created of the full saveset (whole project)
-all files are transferred to mike.kin.ucalgary.ca in ../../Data0/microct_archive/
-after the transfer, the saveset files are deleted
-the log for the backup and the file list are emailed to the user
-if you do not receive an email and the job has failed, please check sys$scratch for the log


Delete Tool:
$@COM:DELETEPROJECT
-the user will be prompted for information regarding the deletion
-a command script is generated to delete all files, then all directories
-the command script is opened so that the user can check the files to be removed
-the user is then asked if they would like to run the command file


Restore Tool:
$@COM:RESTOREPROJECT
-the user will be prompted for the name of the saveset to be restored
-the saveset file info is obtained from mike.kin.ucalgary.ca to determine the original project location
-the user is asked if they wish to restore to the original location, or to a new location
-a command script is generated to transfer the saveset, reset the file attributes, and extract the files
-the user is then asked if they would like to run the command file


Known Bugs in Project Tools:
-if the user specifies too long a file name, the program project tools will fail with the following error:

    RMS-E-CRE, ACP file create failed
SYSTEM-W-BADFILENAME, bad file name syntax



OpenVMS Desktop and Graphical Applications

Create a customized button in the session manager

The session manager part to enable the double-click on the AIM file: Session Manager, 'Options', 'Menu', enter new item SAP with command:

@decw$user_defaults:sap$vue

Then move that menu point into 'Applications' menu. Also: 'Options', 'File types', Create 'AIM' file type. Move 'rename', 'copy', 'purge' etc. into menu, Select 'SAP', click on 'Change double click', and also move SAP into menu.

EVE Editor

Launch an editor such as EVE

On the command line

$ edit/display=decwindows/tpu fname.txt

Configure the EVE editor

The following file, called tpu.dat, should be installed in disk1:[microct.xdefaults]:

#
# DECTPU V3.1 1993-04-22 15:50 defaults
# CHANGED B.KOLLER 21-JUN-90
#
# Copyright (c) 1993 Digital Equipment Corporation.  All rights reserved.
#
#
# The following are all the resource names that DECTPU supports.
#
Tpu.Tpu$MainWindow.Title:		DECTPU Copyright © Digital Equipment Corporation 1992.  All Rights Reserved.
Tpu.Tpu$MainWindow.ApplicationTitle:	DECTPU
Tpu.Tpu$MainWindow.IconName:		DECTPU
Tpu.Tpu$MainWindow.X:			610
Tpu.Tpu$MainWindow.Y:			0
#
# The following resource names are commented out so that users can specify
# *rows and *columns and have DECTPU obey those directives.  If DECTPU finds
# finds no resource names governing the number of rows and columns it should
# have, it uses 24 rows and 80 columns.
#
#
Tpu.Tpu$MainWindow.Columns:	80
Tpu.Tpu$MainWindow.Rows:	56
*EVE_MENU_BAR*background:	#ADADADADADAD
Tpu*XmScrollBar*background:	#ADADADADADAD
Tpu*XmDialogShell*background:	#ADADADADADAD
Tpu*XmMenuShell*background:	#ADADADADADAD
*background:			white
Tpu*condensedFont: OFF
Tpu*fontSetSelection: 0

# 0 = big font
# 1 = little font
# 2 = GS font (German Standard)
# 3 = Fine font (used only for non-latin 1 fonts?)

Use EVE Editor Commands

  • mark -> ctrl-space
  • delete -> remove (delete)
  • insert -> insert here (insert)
  • learn -> ctrl-k (ctrl-r to stop)

Note: The right 'alt' key on the PC accesses the menu for EVE.

copy <PF1><Remove> on VMS
paste <Insert Here> on VMS or <ctrl><insert> on PC
cut <Remove> on VMS or <delete> on PC
learn <CTRL><K>
stop <CTRL><R> (then give a key sequence such as <CTRL><Q>)
repeat <PF1><#><(CTRL-Q)> (the CTRL-Q depends on the given key sequence).
find next <PF3>
enter search string <PF1><PF3>
replace string <PF1><S>
margins Mouse click bottom of window type: set right 999
kill line <PF4>
kill word - (minus key on number pad)
advance next line 0 (zero on number pad)
select text <CTRL><SPACE>


Helpfull hint: To avoid having the EVE editor automatically create multiple lines from a long input sequence set the margins [FORMAT - SET MARGINS] to some high number eg. 500.


Use EVE Editor Commands Remotely with XWin32

Default key settings:

remove (cut) and append to previous paste buffer 9 (nine on number pad)
paste <insert>
learn <CTRL><K>
stop <CTRL><R> (then give a key sequence such as <CTRL><Q>)
repeat <CTRL>-Q or given key sequence
kill word - (minus key on number pad)
advance next line 0 (zero on number pad)
go to end of line 2 (two on number pad) or <CTRL><E>
go to start of line <backspace> or <CTRL><H>
go to start of word 1 (one on number pad)
delete line to left of cursor <CTRL><U>
turn on/off select text <CTRL><SPACE> or . (on number pad)
select all text <CTRL><O>
turn on/off overstrike <CTRL><A>
save and exit <CTRL><Z>
enter command <CTRL><B>


You may find it useful to define keys. For example, define keys to cut, copy and paste:

   To Cut <CTRL><X>:
   <CTRL><B> (enter command)
   Command:  define key=Ctrl/x cut
   To Copy <CTRL><C>:
   <CTRL><B> (enter command)
   Command:  define key=Ctrl/c copy
   To Paste <CTRL><V>:
   <CTRL><B> (enter command)
   Command:  define key=Ctrl/v paste



Use terminal based editor (EVE)

$ edit file.txt

If you are using this from a remote terminal, you will need to initiate a vt100 terminal.

$ set term /vt100

Some useful commands:

  • ctrl-z -> exit with save
  • ctrl-y -> kill without saving
  • do-key, then type 'quit' or 'exit' (what is the do key on a remote terminal?)
  • PF2 -> shows special keypad functions
  • GoldKey -> PF1

Remote Access

Export the VMS display to SUN or LINUX terminal

# - temple
$ - sceval
# xhost +temple.ucalgary.ca
# ssh -X microct@sceval.ucalgary.ca
$ set display /create /transport=tcpip /node=temple.ucalgary.ca

NOTE: Do not use xhost+. Always specific exactly which computer is being allowed X access.

View the XtremeCT VMS filesystem from a Windows PC

The HP program that allows the VMS file system to be viewed by a PC is called Pathworks (on the VMS system). The following information is needed to connect to the VMS system:

USERNAME: xtremect
PASSWORD: uct
WORKGROUP: microct

Then, in Windows explorer, while connected in the same network as the VMS station (i.e., .130) enter the following IP address for Thomas (SC3309):

\\136.159.130.28\

Alternatively, map the drive.

Right click on my computer and choose map network drive. 

Folder:
\\136.159.130.28\UCT_DATA1
or
\\136.159.130.28\UCT_DATA2

User name: xtremect@microct
Password:  uct

View the VivaCT40/uCT35 VMS filesystem from a Windows PC

The HP program that allows the VMS file system to be viewed by a PC is called Pathworks (on the VMS system). The following information is needed to connect to the VMS system:

USERNAME: vct_40
PASSWORD: uct
WORKGROUP: microct

Then, in Windows explorer, while connected in the same network as the VMS station enter the following IP address for SCEVAL:

\\136.159.74.140\

Alternatively, map the drive.

Right click on my computer and choose map network drive. 

Folder:
\\136.159.74.140\SB_DATA
or
\\136.159.74.140\SB_PROJ
or
\\136.159.74.140\BH_DATA
or
\\136.159.74.140\BH_PROJ


User name: vct_40@microct
Password:  uct

Map a Network Drive to the VMS filesystem from Windows

To do this you must be on the same network as the OpenVMS system. For main campus and the XtremeCT, you will map the drive to Thomas (136.159.130.28), the workstation connected to the scanner.

Right click on My Computer and choose Map Network Drive... 

Folder:  \\136.159.130.28\uct_data1     !FOR THE PROJECTS DISK

         and/or 

         \\136.159.130.28\uct_data2     !FOR THE DATA DISK

User name: microct\xtremect
Password:  uct

Note: You must use the numerical IP address and not the host name (i.e. thomas.kin.ucalgary.ca).

Use Hummingbird Exceed for remote access

  • Screen definition
Server visual = PseudoColor
Window mode = multiple
  • Keyboard input
Primary = decemus
Alternate = us
  • EVE commands
select = "end"
cut = "delete"
paste = "insert"
move forward a word = CTRL + right_arrow
move to start of document = CTRL + up_arrow
move to end of document = CTRL + down_arrow

Use XWin32 for remote access

Run XWin32. Run Putty and connect to sceval.ucalgary.ca. Use the terminal normally to run programs, which should open with XWin32.

Additional terminal windows can be opened with $ dec

If you try to connect from somewhere other than the university, you will probably get the following error when trying to open a window:

  Xlib: connection to "sceval.ucalgary.ca:10.0" refused by server
  Xlib: Can not connect to a host on a restricted network
  X Toolkit Error: Cannot Open Display
  %DWT-F-DWTABORT, xtoolkit fatal error

Type the following at the command prompt to direct the display:

  $ set display/create/transport=tcpip/node=Your_IP_Address/server=0

You can find your IP address from: http://www.ip-adress.com/

If you're running XWin32 from off campus and behind a router, forward ports 6000 - 6010 TCP and 177 UDP to your computer.

Set up Putty with gold-key access

Download putty: http://www.chiark.greenend.org.uk/~sgtatham/putty/

Set 'keyboard' to Vt400, and 'initial state of numeric keyapad' to 'Application', and now the 'NumLock' key is the gold key (like PF1), and the editor can repeat stuff.

Then

$ set term/vt100

to enable the editor in the terminal.

And duplication of a line is:

- (which would be PF4) to erase a line, 
then twice "numlock, then -"  (gold-PF4 is 'restore line')

Administrative Tasks

Check current licenses on VMS system

This can be used to see what educational licenses (and other licenses) are currently on the system:

$ SHOW LICENSE

To apply for an educational license go to http://www.openvmsedu.com

Shut down the Alpha stations and start up again

Warning: Do not do this unless absolutely necessary.

For shutdown

At the login screen, type "shutdown"/no password and hit enter. Then, you can turn the computer off at the prompt.

Then, you may turn the disk array off (unplug it as there is no power switch).

After you move the computer, power on the disk array and then the computer.

Restart the screen server

If the monitor fails to show the login prompt and displays a blank gray screen...telnet to the computer from another computer (e.g. a PC or so) and login as user system. Run the restart command:

$ @sys$startup:decw$startup restart

confirm (answer yes) and logout.

$ logout

This will kill all programs on your screen, but it will leave all batch jobs running, so if you do a BATCH measurement, this will survive! (but interactive scan will be killed)

Fix a computer that is running very slow and is non-responsive!

This is usually caused by people logging in via SSH multiple times. The solution involves resetting the SSH/TCPIP daemon.

  • If you are local at the computer:

You will need to log in as user system. ONLY EXPERIENCED USERS SHOULD EVER LOG IN AS SYSTEM!

The system will be extremely slow (it will take 5 minutes just to get a log in prompt). This is expected.

$ set host 0   ! user name 'system' and password	
$
$ @sys$startup:tcpip$ssh_shutdown    ! shutdown SSH
$
$ set host 0   ! user name 'system' and password	
$
$ @sys$startup:tcpip$ssh_startup     ! restart SSH

Alternatively, you can reboot the system to reset the SSH. This is not an appropriate solution and it is solving the problem by hitting it with a jack hammer. Sometimes it is the only choice though.

  • If you are remotely logged in:

You will have to log in as user system and run a script called STOP_START_TCPIP.COM.

This works essentially the same as for the above method, except that since it would be impossible to restart SSH remotely once it is shut down, two separate scripts are called and submitted on SCEVAL_FAST (make sure the queue isn't clogged) separated by a 1 minute delay. The first script called is STOP_TCPIP.COM and the second is START_TCPIP.COM.

To execute this process, you must log in as system, go to the SYS$SCRATCH directory, and interactively execute the script:

$ @STOP_START_TCPIP.COM

Fix non-responsive tape drive

This can occur if the user ejects the tape with the little button (and not with the recommended "dismount" button in the uct_backup program). This can also occur if a tape is mounted immediately after one is dismounted. You get the same error for both cases, "medium offline".

  • Check all that all cables are connected.
  • Check that the number on the back of the drive says "5" (use +/- to adjust if necessary)
  • Check that the top connector has a cable connecting to the computer and the bottom one has a terminator.
  • Try turning the tape drive on and off again.
  • Log in as user system (you will need a password from Steve):
$ mcr sysman io auto/sele=mk
$ @sys$startup:scanco_setup_devices.com

$ show device tp0

If it's online again, then great. If not, then the last resort is to reboot the entire system. If this doesn't work, then shut down the system (see user manual for proper steps) and eject the tape. You may need to turn the computer back on before it will eject. The tape drive should be turned on first (no tape), then the server, and any other computers. Check that the drive is online ($ show device mk). If it is, then test the drive by initializing, mounting and dismounting a brand new tape. If the drive is not online, do not insert any tapes or they will likely get stuck. Log in as system and re-try the command lines shown above.


Make commands available to all users with symbols or paths

DCL$PATH is one way to do that, WE don't use it...

$ def dcl$path disk1:[microct.main],disk1:[microct.util]

then, if you type $ uct_t it will first try to

$ @uct_t.com and then $ r uct_t.exe

however, we usually define it by giving full path:

$ progx :== $disk1:[microct.main]progx.exe
$ com_proc_x :== @disk1:[microct.main]procedure.com

then, you can just type the shortcut ('symbol' in VMS language)

We use the 'cd' to set the default path, you may also use this in your command procedure:

proc.com:

$ cd 'p1'
$ dir *.*/size

$ define COM disk1:[microct.commands]
$ p :== @COM:PROC.COM

these both go into login.com

then, you can just type:

$ p disk4:[microct.data.0000007.000009]*.ISQ

Edit a symbol set by Scanco such as AIX

picture_position,left Warning: Extreme caution! Explicit permission for this change or similar changes must be obtained from Dr. Steven Boyd.

Log in as user calibration

$ set proc/priv=bypass
$ cdc (changes to MICROCT_COMMAND)
$ sea *.com aix

Edit that file which is called MICROCT_SETUP_COMMON.COM

Another example: To make the backspace/insert keys work properly, edit the login.com and insert the line

$ set terminal/insert

Anywhere suitable.

Change the date and time

To do this, you will need to login as system

Once logged in:

show time
set time=dd-mmm-yyyy:hh:mm:ss

To change the time on all computers at once, add /cluster at the end of the set time line.