Archive for the ‘Commands’ Category

Even though the parted command shows the partition as ext3, you can format it as ext4.

(parted) mklabel gpt
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to
continue?
Yes/No? Yes                                                               
(parted) unit TB
(parted) mkpart primary 0.00TB 10.00TB
(parted) p                                                                
Model: LSI MR9261-8i (scsi)
Disk /dev/sda: 9.99TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      0.00TB  9.99TB  9.99TB  ext3         primary

(parted) quit                                                             
Information: You may need to update /etc/fstab.

[root@mh ~]# mkfs.ext4 /dev/sda1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
305025024 inodes, 2440183808 blocks
122009190 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
74469 block groups
32768 blocks per group, 32768 fragments per group
4096 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848, 512000000, 550731776, 644972544, 1934917632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done       

[root@mh ~]# blkid
/dev/sda1: UUID="1485be35-8319-4a49-b0bd-9ee465303b41" TYPE="ext4" PARTLABEL="primary" PARTUUID="a7f0e3ef-3e72-4bc9-849a-90dde882f07f" 
/dev/sdb1: UUID="6ca14ed0-e5e0-422a-9e82-ea72fc84516b" TYPE="ext4" 
/dev/sdb2: UUID="ceb6e531-4a0a-49b9-9e59-d8f1ae4593c6" TYPE="swap" 
/dev/sdb3: UUID="ab27cea4-abc8-49d8-894f-2c39408b196f" TYPE="ext4" 
[root@mh ~]# blkid|grep sda
/dev/sda1: UUID="1485be35-8319-4a49-b0bd-9ee465303b41" TYPE="ext4" PARTLABEL="primary" PARTUUID="a7f0e3ef-3e72-4bc9-849a-90dde882f07f" 
[root@mh ~]# blkid|grep sda >> /etc/fstab
[root@mh ~]# vi /etc/fstab
[root@mh ~]# mount -a

First need to install the fftw library. Download it here.

# ./configure --prefix=/code/fftw-3.3.4 --with-pic
# make
# make install

The –with-pic bit was added because the ROOT compilation complained about it.

For ROOT, –with-fftw3-incdir is directory with fftw3.h and –with-fftw3-libdir is directory with fftw library.

# ./configure --prefix=/code/root_v5.34.20 --enable-qt --with-fftw3-incdir=/code/fftw-3.3.4/include --with-fftw3-libdir=/code/fftw-3.3.4/lib
...
Enabled support for asimage, astiff, builtin_afterimage, builtin_ftgl, builtin_glew, builtin_lzma, cintex, explicitlink, fftw3, genvector, krb5, ldap, memstat, mysql, opengl, pgsql, python, reflex, shadowpw, shared, sqlite, ssl, tmva, vdt, x11, xft, xml.

# make
# make install

Normally, I’d do a make -j2 above. But, for some reason, it would just hang at a particular point in the compilation. So I took off the -j2 and things seemed to work.

$ root-config –features
asimage astiff builtin_afterimage builtin_ftgl builtin_glew builtin_lzma cintex explicitlink fftw3 genvector krb5 ldap memstat mysql opengl pgsql python reflex shadowpw shared sqlite ssl tmva vdt x11 xft xml thread

Commands to use to partition a new 3TB disk with parted.

[ ~]# parted /dev/sdg
GNU Parted 2.1
Using /dev/sdg
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Error: /dev/sdg: unrecognised disk label                                  
(parted) mklabel gpt                                                  
(parted) mkpart primary ext3 1 -1                                         
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? C                                                          
(parted) print                                                            
Model: ASMT 2105 (scsi)
Disk /dev/sdg: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart                                                           
Partition name?  []?                                                      
File system type?  [ext2]? ext3                                           
Start? 0%                                                                 
End? 100%

Using percentages worked better than trying to specify the start/stop sectors. Not sure why.

[ ~]# mkfs.ext3 /dev/sdg1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
183148544 inodes, 732566272 blocks
36628313 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
22357 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848, 512000000, 550731776, 644972544

[ ~]# tune2fs -c0 -i0 /dev/sdg1

I installed the following packages first. (I’ll add these to my kickstart file so they’re always installed.)

yum install python-devel \
python-imaging \
python-imaging-devel \
python-tools

My configure command:

./configure --with-python-incdir=/usr/include/python2.4 --with-python-libdir=/usr/lib64 --enable-qt --prefix=/code/root_v5.34.18_rhel5

When this finished, I just ran:

make -j2
make install

The -j2 basically means can use two cores on the cpu for ROOT. Probably could have done -j4, but thought I’d start with -j2 and see how it goes.

Next need to set the following environment variables:

export ROOTSYS=/code/root_v5.34.18_rhel5
export PATH=$PATH:$ROOTSYS/bin
export PYTHONPATH=$ROOTSYS/lib/root:/usr/lib/python2.4:/usr/bin/python
export LD_LIBRARY_PATH=$ROOTSYS/lib

To see what features are installed, can use:

$ root-config --features
asimage astiff builtin_afterimage builtin_ftgl builtin_glew builtin_pcre builtin_lzma cintex explicitlink genvector memstat opengl python reflex shadowpw shared tmva vdt x11 xft thread

TEST THAT IT’S INSTALLED CORRECTLY
In ROOT:

root [0] gSystem->Load("libPyROOT")
(int)0
root [1] TPython::Exec("print 1+1")
2
(Bool_t)1

In python:

>>> import ROOT
>>> import MH
Traceback (most recent call last):
  File "", line 1, in ?
ImportError: No module named MH

(No errors for ROOT is what we want.)

As root, run activate_matlab.sh to start the activation process. You may have to first login to the mathworks account and set up the new computer.

[root@cps4 ~]# parted /dev/sda
GNU Parted 2.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: LSI 9750-8i DISK (scsi)
Disk /dev/sda: 12.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

(parted) mklabel gpt                                                      
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? Yes                                                               
(parted) mkpart primary 0 -0                                              
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Cancel                                                     

(parted) mkpart primary ext3 1 -1
(parted) print                                                            
Model: LSI 9750-8i DISK (scsi)
Disk /dev/sda: 12.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  12.0TB  12.0TB               primary

[root@cps4 ~]# mkfs -t ext3 /dev/sda1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
732422144 inodes, 2929670656 blocks
146483532 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
89407 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848, 512000000, 550731776, 644972544, 1934917632, 
	2560000000

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@cps4 ~]# tune2fs -c0 -i0 /dev/sda1
tune2fs 1.41.12 (17-May-2010)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds

Matt requested that /proc/sys/vm/overcommit_memory is set to 2 on some nodes. To do this, edit /etc/sysctl.conf. To the end of the file, add this line:

vm.overcommit_memory = 2

To make it take effect without rebooting, run:

sysctl -p

I was getting this error in my log files:

dovecot: IMAP(user): Time just moved backwards by 1 seconds. I'll sleep now until we're back in present.
http://wiki.dovecot.org/TimeMovedBackwards: 1 Time(s)

Looking at the website that was linked in the error message (very helpful), the solution was to edit /etc/ntp.conf and add the following:

# Added following to get rid of dovecot "Time moved backwards" error
tinker step 0

Restart ntpd and after two days the error stopped showing up in my logs. Yay!

Install epel repo to download some needed packages:

http://mirror.chpc.utah.edu/pub/epel/6/i386/repoview/epel-release.html

Packages want to get from epel:

patchy
cernlib-2006
(will also get xbae)

From this website, download:

Manual
Makefile
isajet.car
isared.tar.gz

Unzip, but don’t untar the isared.tar.gz file.

The cernlib from the epel repo puts the files we are concerned about in /usr/lib64/cernlib/2006-g77/lib. However, it puts a version number on the libraries we want to use and this will cause an error in our Makefile. So, in /usr/lib64/cernlib/2006-g77/lib, make the following links:

ln -s libpacklib.so.1 libpacklib.so
ln -s libpdflib804.so.2 libpdflib804.so
ln -s libmathlib.so.2 libmathlib.so
ln -s libkernlib.so.1 libkernlib.so

Next, edit the Makefile with our info. Here is what the one I used looked like:

#       Do not change this -- you will break everything.
SHELL = /bin/csh

########## Installation parameters #####################################

#       Some versions of make (e.g. Linux) treat inconsequential warnings
# as errors and stop. Ignore all errors; comment out if possible:
##.IGNORE:

#       Name for temporary subdirectory. This will be deleted and 
# recreated:
MAKETMP = ./MakeTmpDir

#       Link with CERN libraries. This is recommended for HP, IBMRT, or 
# LINUX to get date and time information but is not required:
##CERN = NOCERN
CERN = CERN

#       Directories for Cernlib, terminated with a /. These must be set
# if you select CERN or PDFLIB:
CERNDIR = /usr/lib64/cernlib/
CERNBIN = $(CERNDIR)/bin/
CERNLIB = $(CERNDIR)lib/
CERNLIB2 = $(CERNDIR)2006-g77/lib/

#       PDFLIB support. PDFLIB (part of the CERN library) contains many
# partion distributions but produces a larger executable image:
PDFLIB =
#PDFLIB = PDFLIB

#       RANLUX support. RANLUX provides better random numbers than the
# standard RANF, and each seed gives an independent sequence. It is
# more difficult to restart and slightly slower.
RANLUX = RANLUX
#RANLUX = NORANLUX

#       Computer type. Most only differ in minor ways, e.g., the system
# clock interface. Uncomment the right one:
# ANSI          ANSI Fortran
# DECS          DECStation with Ultrix
# HPUX          HP/700 with HPUX
# IBMRT         IBM RS/6000 with AIX
# LINUX         PC with LINUX and f2c/gcc or g77 or Absoft f77
# OSF           Digital OSF on Alpha processor
# SGI           Silicon Graphics with IRIX
# SUN           Sparc or PC with Solaris
#MACHINE = ANSI
#MACHINE = DECS
#MACHINE = HPUX
#MACHINE = IBMRT
MACHINE = LINUX
#MACHINE = OSF
#MACHINE = SGI
#MACHINE = SUN

#       Fortran 77 compiler.
#F77 = f77
#       For HPUX; note that f77 on HPUX is brain dead. fort77 is also an
# alternate f2c/gcc interface on Linux:
#F77 = fort77
#       GNU Fortran compiler
#F77 = g77
F77 = /usr/bin/g77

#       Fortran compile flags: Want -c, highest safe optimization, all
# variables static, and postpended underscore for Cernlib compatibility.
# Uncomment the right one or make your own:
#       DECS
#FFLAGS = -c -O -static -w
#       HPUX, -O is broken
#FFLAGS = -c -O2 -K +ppu -w
#       IBMRT
#FFLAGS = -c -O -qextname -w
#       LINUX with f2c/gcc or g77. The -fno-silent displays progress...
FFLAGS = -c -O -fno-automatic -fno-silent
#       LINUX  with Absoft Fortran
#FFLAGS = -c -O -w -f -s
#       OSF
#FFLAGS= -c -O -w
#       SGI
#FFLAGS = -c -O -static -w
#       SUN - the second option traps floating errors
#FFLAGS = -c -O -w
#FFLAGS = -c -O -w -fnonstd -ftrap=common

#       Use fsplit or CERN's fcasplit to split the whole Fortran source into
# individual subroutines:
#FSPLIT = $(CERNBIN)fcasplit
#FSPLIT = fsplit
FSPLIT = /usr/bin/fcasplit

#       Link command for Fortran, c.f. $(F77):
#LINK = f77
#LINK = fort77
#LINK = g77
LINK = $(F77)

#       Extra libraries (e.g. Cernlib) and flags for link. If you want 
# PDFLIB support, you must also define $(PDFLIB) above. The Zebra
# version requires libpacklib.a.
#LFLAGS =
#LFLAGS = -L$(CERNLIB) -lmathlib -lkernlib
#LFLAGS = -L$(CERNLIB) -lpdflib804 -lmathlib -lkernlib
LFLAGS = -L$(CERNLIB) -L$(CERNLIB2) -lpdflib804 -lpacklib -lmathlib -lkernlib

#       Ranlib command if required (it is for Sun 4.x and Linux):
RANLIB = ranlib
#RANLIB = $(ECHO)

#       Name for this Makefile:
MAKEFILE = Makefile

#       Patchy commands. YPATCHY can be either ypatchy or nypatchy,
# perhaps with a full path. A temporary cradle file YCRADLE is required;
# it is deleted and recreated:
#YPATCHY = $(CERNBIN)ypatchy
#YPATCHY = $(CERNBIN)nypatchy
YCRADLE = ./tmpcradle.cra
YPATCHY = /usr/bin/nypatchy

#       Echo command. /bin/echo works on most (all?) systems; plain echo
# fails on AIX 4.1:
ECHO = /bin/echo

#       Remove command:
RM = /bin/rm

#       Parameters to use ISATOOLS and ISAFLAVR. Note ISAFLAVR does not
# create a separate library.

ISATOOLS = ISATOOLS
#ISATOOLS =

LIBTOOLS = -lisared
#LIBTOOLS =

ISAFLAVR = ISAFLAVR
#ISAFLAVR =

########## End of installation parameters ##############################

Next make isatools.

[root@higgs isajet]# make isatools

Takes a while to run. This creates the file libisared.a.

Next run make.

[root@higgs isajet]# make

This should produce the following executables: isajet.x, isasusy.x and isasugra.x. You can run make clean to get rid of the temporary files.

After starting ROOT, need to check that it can make plot windows. In root, run this command to open up a new window.

root [0] TCanvas c