Archive for October, 2007

To check when CST or CDT is set to start:

 zdump -v /usr/share/zoneinfo/CST6CDT |grep 2007

I had a problem on one of my wordpress blogs where a user wanted to upload a file larger than 2MB. When attempting to upload, he got the error message:

The uploaded file exceeds the upload_max_filesize directive in php.ini.

The solution was to simply change the upload_max_filesize parameter in the php.ini file. But, after searching, I found that there wasn’t a php.ini file on the computer in question. I created a new one and tried it in /etc, /var/php5/etc and some other locations, but the change wasn’t registered. Finally I remembered that I could use php itself to tell me where it expected the file. To do this, I created a simple file, called phpinfo.php and put in the following info:

<? phpinfo(); ?>

Then, when I looked at that file in a browser, it showed that the location of the php.ini file should be /var/php5/lib.

Go to this website:

http://cernlib.web.cern.ch/cernlib/version.html

Download the latest version, which is a bunch of tar.gz files. Do not unzip them. Put the files in /cernlib/code. Run the script provided by cern to unzip and make all the files.

Here is the last script that I used:

#!/bin/sh

# Unpack the source files and set up the build structure, e.g.
#  /tmp/cernlib/2003/src (and lib)

list=`ls src_*.gz`

for ffile in $list
do
  gunzip -c $ffile | tar xf -
done

# Establish the environment variables for the build procedures
# Depending on the system, other directories may need to be added to the PATH
# e.g. for the build tools and alternative compilers.

CERN_LEVEL=`gunzip -c Imakefile.tar.gz | tar tf - | awk -F/ '{print $1}'`

CERN=`pwd`
CERN_ROOT=$CERN/$CERN_LEVEL
CVSCOSRC=$CERN/$CERN_LEVEL/src
PATH=$CERN_ROOT/bin:$PATH

export CERN
export CERN_LEVEL
export CERN_ROOT 
export CVSCOSRC
export PATH

# Create the build directory structure

cd $CERN_ROOT
mkdir -p build bin lib build/log

# Create the top level Makefile with imake

cd $CERN_ROOT/build
$CVSCOSRC/config/imake_boot

# Install kuipc and the scripts (cernlib, paw and gxint) in $CERN_ROOT/bin

gmake bin/kuipc > log/kuipc 2>&1
gmake scripts/Makefile
cd scripts
gmake install.bin > ../log/scripts 2>&1

# Install the libraries

cd $CERN_ROOT/build
gmake > log/make.`date +%m%d` 2>&1

Some of our machines have five 500gb disks configured into a single raid5 system. The cases that these disks are in have three empty slots. I’ve just added three more 500gb disks and configured these into another raid. The size of this raid will only be 1tb, but we’re pretty short on disk space, so that’s ok.

[root@cdfs tw_cli]# ./tw_cli
//cdfs> info

Ctl   Model        Ports   Drives   Units   NotOpt   RRate   VRate   BBU
------------------------------------------------------------------------
c8    9650SE-8LPML 8       8        1       0        4       4       -

//cdfs> info c8

Unit  UnitType  Status         %Cmpl  Stripe  Size(GB)  Cache  AVerify  IgnECC
------------------------------------------------------------------------------
u0    RAID-5    OK             -      64K     1862.61   ON     OFF      OFF 

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCAPW2252807
p1     OK               u0     465.76 GB   976773168     WD-WCAPW2071371
p2     OK               u0     465.76 GB   976773168     WD-WCAPW2252305
p3     OK               u0     465.76 GB   976773168     WD-WCAPW2252370
p4     OK               u0     465.76 GB   976773168     WD-WCAPW2252832
p5     OK               -      465.76 GB   976773168     WD-WCAPW1478014
p6     OK               -      465.76 GB   976773168     WD-WCAPW1478552
p7     OK               -      465.76 GB   976773168     WD-WCAPW1478397

//cdfs> /c8 add type=raid5 disk=5:6:7
Creating new unit on controller /c8 ...  Done. The new unit is /c8/u1.
Setting write cache=ON for the new unit ... Done.
Warning: You do not have a battery backup unit for /c8/u1 and the enabled
write cache (default) may cause data loss in the event of power failure.
Setting default Command Queuing Policy for unit /c8/u1 to [off] ... Done.

//cdfs> info c8

Unit  UnitType  Status         %Cmpl  Stripe  Size(GB)  Cache  AVerify  IgnECC
------------------------------------------------------------------------------
u0    RAID-5    OK             -      64K     1862.61   ON     OFF      OFF 
u1    RAID-5    OK             -      64K     931.303   ON     OFF      OFF 

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCAPW2252807
p1     OK               u0     465.76 GB   976773168     WD-WCAPW2071371
p2     OK               u0     465.76 GB   976773168     WD-WCAPW2252305
p3     OK               u0     465.76 GB   976773168     WD-WCAPW2252370
p4     OK               u0     465.76 GB   976773168     WD-WCAPW2252832
p5     OK               u1     465.76 GB   976773168     WD-WCAPW1478014
p6     OK               u1     465.76 GB   976773168     WD-WCAPW1478552
p7     OK               u1     465.76 GB   976773168     WD-WCAPW1478397

Now create a filesystem on this new raid.

[root@cdfs local]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 121573.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sdb: 999.9 GB, 999978696704 bytes
255 heads, 63 sectors/track, 121573 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-121573, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-121573, default 121573):
Using default value 121573

Command (m for help): p

Disk /dev/sdb: 999.9 GB, 999978696704 bytes
255 heads, 63 sectors/track, 121573 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      121573   976535091   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@cdfs local]# mkfs.ext3 -m0 -E stride=32 -j -O dir_index,resize_inode,spar se_super /dev/sdb1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
122077184 inodes, 244133772 blocks
0 blocks (0.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=247463936
7451 block groups
32768 blocks per group, 32768 fragments per group
16384 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

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

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@cdfs local]# tune2fs -c0 -i0 /dev/sdb1
tune2fs 1.35 (28-Feb-2004)
Setting maximal mount count to -1
Setting interval between check 0 seconds

Now mount and export the disk.