Category: Linux

NFS Quick howto for CentOS 5

To use NFS successfully, you’ll have to configure the server and the client. In this example, the client is and the server is The folder to be shared is /home/sharing, and to be mounted to /mnt on the client.

On the server:

1. Make directory that you want to use.
# mkdir /home/sharing

2. Edit /etc/exports, insert the client machine’s ip
# nano /etc/exports
Add this line:

3. Edit /etc/hosts.allow
# nano /etc/hosts.allow
Add this line:

4. Start NFS and portmap
# /etc/init.d/nfs start
# /etc/init.d/portmap start


On the client:

1. Start portmap
# /etc/init.d/portmap start

2. Mount the nfs folder
# mount /mnt

3. chech /var/log/messages for any error that might occur
# colortail -f /var/log/messages

4. Use mount to chech if the folder is mounted properly
# mount
The output should be like this: on /mnt type nfs (rw,addr=

5. Edit /etc/fstab to mount the shared folder on boot
# nano /etc/fstab
Add this line: /mnt nfs rw,hard,intr 0 0




apt-get install vsftpd

edit the VSftpd config at /etc/vsftpd.conf

ftpd_banner=Welcome to “what you want” FTP service.



CentOS fibre channel multipath

On the machine where you want to setup multipath you first need to find the WWN’s of the FC cards:

[root@admin ~]# cat /sys/class/scsi_host/host*/device/fc_host*/port_name
Now I have the WWN’s i can add them to my multipath config  (/etc/multipathd.conf)
blacklist {
devnode "*"

blacklist_exceptions {
devnode "^sd[b-z].*"

defaults {
udev_dir                /dev
polling_interval        5
selector                "round-robin 0"
path_grouping_policy    failover
getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
prio_callout            /bin/true
path_checker            readsector0
rr_min_io               100
max_fds                 8192
rr_weight               priorities
failback                immediate
no_path_retry           fail
user_friendly_names     yes

multipaths {
multipath {
wwid                    0x50014380029d41dc
alias                   fc1
path_grouping_policy    multibus
path_checker            readsector0
path_selector           "round-robin 0"
failback                manual
rr_weight               priorities
no_path_retry           5
multipath {
wwid                    0x50014380029d40b8
alias                   fc2

Now i have the default configuration I can do a dry run to see what devices would be created:

[root@admin ~]# /sbin/multipath -v2 -d

This will list all the mpath devices that would be created, you should see a line similar to:

: mpath4 (360000000000000000000000000000000)  HP,P2000 G3 FC

This ID can be used to create an alias to your volume:

multipath {
wwid                    360000000000000000000000000000000
alias                   myvolumename

Add this to the multipaths section of your multipath.conf file.

Now make sure the multipathd service is on:

[root@admin ~]# chkconfig multipathd on

Then start multipath:

[root@admin ~]# service multipathd start
Starting multipathd daemon

You should now have your multipath volume in /dev/mapper

or visible by doing

[root@admin ~]# fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
64 heads, 32 sectors/track, 152627 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         100      102384   83  Linux
/dev/sda2             101      152627   156187648   8e  Linux LVM

Disk /dev/sdd: 49.9 GB, 49999986688 bytes
64 heads, 32 sectors/track, 47683 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdd doesn't contain a valid partition table

Disk /dev/sdh: 49.9 GB, 49999986688 bytes
64 heads, 32 sectors/track, 47683 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdh doesn't contain a valid partition table

Disk /dev/sdl: 49.9 GB, 49999986688 bytes
64 heads, 32 sectors/track, 47683 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdl doesn't contain a valid partition table

Disk /dev/sdp: 49.9 GB, 49999986688 bytes
64 heads, 32 sectors/track, 47683 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdp doesn't contain a valid partition table

Disk /dev/dm-3: 49.9 GB, 49999986688 bytes
255 heads, 63 sectors/track, 6078 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Now you can see your new volume, in this case /dev/dm-3

Create new partition:

[root@admin ~]# fdisk /dev/dm-3

once the new partition is created you can create filesystem

[root@admin ~]# mkfs.ext3 /dev/dm-3p1

and finally mount your volume somewhere

[root@admin ~]# mount /dev/dm-3p1 /mnt/myvolume

SLURM: A Highly Scalable Resource Manager

SLURM is an open-source resource manager designed for Linux clusters of all sizes. It provides three key functions. First it allocates exclusive and/or non-exclusive access to resources (computer nodes) to users for some duration of time so they can perform work. Second, it provides a framework for starting, executing, and monitoring work (typically a parallel job) on a set of allocated nodes. Finally, it arbitrates contention for resources by managing a queue of pending work.

While other resource managers do exist, SLURM is unique in several respects:

  • It is designed to operate in a heterogeneous cluster with up to 65,536 nodes and hundreds of thousands of processors.
  • It can sustain a throughput rate of over 120,000 jobs per hour with bursts of job submissions at several times that rate.
  • Its source code is freely available under the GNU General Public License.
  • It is portable; written in C with a GNU autoconf configuration engine. While initially written for Linux, other UNIX-like operating systems should be easy porting targets.
  • It is highly tolerant of system failures, including failure of the node executing its control functions.
  • A plugin mechanism exists to support various interconnects, authentication mechanisms, schedulers, etc. These plugins are documented and simple enough for the motivated end user to understand the source and add functionality.


sudo  apt-get install slurm


vmware tools install Linux

The first steps are performed on the host, within Workstation menus:

1. Power on the virtual machine.
2. After the guest operating system has started, prepare your virtual machine to install VMware Tools. 

Choose VM > Install VMware Tools.

The remaining steps take place inside the virtual machine.

3. As root (su -), mount the VMware Tools virtual CD-ROM image, change to a working directory (for example, /tmp), uncompress the installer, then unmount the CD-ROM image.

mount /dev/cdrom /mnt/cdrom

cd /tmp

Note: If you have a previous installation, delete the previous vmware-distrib directory before installing. The default location of this directory is

4. Untar the VMware Tools tar file:

tar zxf /mnt/cdrom/VMwareTools-5.0.0-<xxxx>.tar.gz

umount /dev/cdrom

Where <xxxx> is the build/revision number of the VMware Workstation release.

5. Run the .tar VMware Tools installer:
cd vmware-tools-distrib

Respond to the configuration questions on the screen. Press Enter to accept the default value.

6. Log off of the root account.

How To Set Up A Ubuntu/Debian LAMP Server

•Apache 2 – Linux Web server
•MySQL 5 – MySQL Database Server
•PHP5 – PHP Scripting Language
•phpMyAdmin – Web-based database admin software.

Before proceeding to install, update the necessary packages with debian with this command.
apt-get install update

1. Installing Apache + PHP

apt-get install apache2 php5 libapache2-mod-php5

Apache configuration file is located at: /etc/apache2/apache2.conf and your web folder is /var/www.

To check whether php is installed and running properly, just create a test.php in your /var/www folder with phpinfo() function exactly as shown below.

nano /var/www/test.php

# test.php

<?php phpinfo(); ?>

Point your browser to: http://”ip adress”/test.php

2. Installing MySQL Database Server

apt-get install mysql-server mysql-client php5-mysql

The configuration file of mysql is located at: /etc/mysql/my.cnf

By default mysql creates user as root and runs with no passport. You might need to change the root password.

To change Root Password:

mysql -u root

mysql> USE mysql;

mysql> UPDATE user SET Password=PASSWORD(‘new-password’) WHERE user=’root’;


3. PhpMyAdmin Installation

apt-get install phpmyadmin

The phpmyadmin configuration file is located at: /etc/phpmyadmin folder.

To set up under Apache all you need to do is include the following line in /etc/apache2/apache2.conf:

Include /etc/phpmyadmin/apache.conf

Now restart Apache:

/etc/init.d/apache2 restart

Point your browser to: http://domain/phpmyadmin

That’s it! MySQL and phpMyAdmin are ready. Log in with your mysql root password and create users to connect to database from your php script.