Categories

Sunday 16 November 2014

Steps to migrate Ubuntu Server to another Machine

Hi,

I have  a requirement in my organisation to replicate the  server environment running in  operating system ubuntu in kvm to another machine in vmware. The current machine contains applications like apache, trac, postgresql, svn etc. One solution for migration is to shutdown kvm machine. Then convert the kvm disk images of the machines to the vmware disks using vmware tools as mentioned in the post

http://syamkumar-linux.blogspot.in/2014/08/how-to-install-vmware-tools-and-convert.html

This process will take many hours to complete and the system will be down on that time. As it is a critical system, we cannot afford that much downtime. So I decided to use an alternative method. That is migration of ubuntu server to another one. Below are the steps for that.

1)First We need to find out the version of ubuntu running on the current machineu. This can be get using the command.

cat /etc/issue

Ubuntu 12.04.2 LTS \n \l

2)Then we need to create a machine in vmware with the same version of ubuntu as in the current machine and install the ubuntu on it.

3)Now on the source machine we need find out the list of packages installed on the source.

sudo dpkg --get-selections | sed "s/.*deinstall//" | sed "s/install$//g" > ~/pkglist


The above command will list all the installed packages on the source machine and will store it in the file pkglist

4)Now on the destination machine install the packages same as in the source machine. That can be done by copying the file pkglist to the destination machine using scp or rsync. The use the below command to install the packages .

sudo aptitude update && cat pkglist | xargs sudo aptitude install -y


Now we have same packages and services running on the destination machine as in the source machine.


5)Now we need to transfer the config file and data from the source machine to the destination machine using scp or rsync.

That is you need to rsync the apache directory, document roots, postgresql data directory, trac configuration file, and trac modules etc. Make sure that you need to shutdown the services before copying it.

Once it is done. All the services will run on the destination machine like in source machine. That is it will behave like the source machine.

If you have done this steps correctly your migration will be succesfull.


Thanks and Regards
Syamkumar.M

Friday 14 November 2014

Command to reset the cpanel account password

Hi,

We can  reset the account password for the cpanel account by using commands. We usually do it by login to WHM interface and then use the modify account section. But this can be done simply using command line.
This post is usefull for some one who doesn't have a cpanel license on the server.


Below is the commands to reset the cpanel account password

1)First we need to change an environment variable in the current shell we are using export command

export ALLOW_PASSWORD_CHANGE=1

2)Then use the command

/scripts/chpass  username password 

This will change the account password

3)But the ftp password won't sync with the new update. So you need to run the below command to update it

/scripts/ftpupdate

Cheers
Syamkumar.M


Wednesday 15 October 2014

How to Fix "replication access was denied" Error in Active Directory

Hi,

Recently I faced an issue in which the Replication process on one of the Active directory server failed with the secondary giving error as "replication access was denied". Below is the steps to fix the issue.

1. Open the Active Directory Users and Computers snap-in
2. On the View menu, click Advanced Features.
3. Right-click the domain object, such as "mydomain.com", and then click Properties.
4. On the Security tab, select the account of the user whose credentials are used to run the sensor. (or add it if it does not exist here)
5. Click to select the Monitor Active Directory Replication check box from the list.
6. Click Apply, and then click OK.



Thanks and Regards
Syamkumar.M

Tuesday 12 August 2014

How to install VMware tools and convert kvm disk images to vmware .vmdk disks

Hi,

We had a requirement to move the kvm systems to vmware and for that at first we need to convert existing kvm machine disk images which is either in qemu/raw type to .vmdk images.

First we need to install vmware-tools on the machine where we are going to convert the disk images. Below are the steps to install the vmware tools.

Import the vmware gpg keys using the command
--------------------------------------------
rpm --import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub
rpm --import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub

Add vmware tools repository using the below command
---------------------------------------------
   echo -e "[vmware-tools]\nname=VMware Tools\nbaseurl=http://packages.vmware.com\
   /tools/esx/4.1latest/rhel6/\$basearch\nenabled=1\ngpgcheck=1" > /etc/yum.repos.d/vmware-tools.repo



Update yum and install it using the command
------------------------------------------ 
yum update
yum install vmware-open-vm-tools
yum install vmware-open-vm-dkms

It will install the necessary tools on the machine.

Now use the below command to convert the kvm disk image to vmware one

qemu-img convert machine.img -O vmdk machine.vmdk

It will take some time to convert based on the size of the disk.

Once it is finished. You can scp the converted disk file to the new vmware. Then create a new vmware machine using existing disk image as the convreted file.

That's it

Cheers
Syamkumar.M

Thursday 24 July 2014

"Cannot start session without errors, "

Hi,

I faced an issue after installing phpmyadmin on one of the server. I am unable to load the phpmyadmin url giving error as "Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. "

The issue was with some permission with session path of php

For fixing the issue. First note the php settings path in php.ini using the command

php -i | grep -i session

For me the session path is /var/lib/php

I just gave is 777 permission using the command

chmod 777 /var/lib/php

Then the issue was resolved and I was able to login to phpmyadmin now.

Thanks and Regards
Syamkumar.M

Friday 11 July 2014

How to Restore a table into a new table in the same database

HI,

Please use the commands to restore a table into another table in a database. Below are the commands for that .

Login to mysql database using the credentials and then run these commands in the prompt

CREATE TABLE chillar_card_recharge_new LIKE chillar_card_recharge;
INSERT chillar_card_recharge_new SELECT * FROM chillar_card_recharge;

In the first command it will create a table chillar_card_recharge_new like chillar_card_recharge.

In the second command it will copy the table data into the new table we had created.

Thanks and Regards
Syamkumar.M

Wednesday 18 June 2014

Troubleshooting using strace

Hi,

Today I faced some issues on bind9, as I was unable to start the bind service using service command. I just went through the logs /var/log/syslog. But didn't get any information about this issue. Finally I used strace which was very usefull to troubleshoot.


strace -f /usr/sbin/named -u bind

It will trace the whole process . Then I was able to find permission denied error for /usr/lib/ssl/openssl.cnf. I fixed the permission issue and then I was able to start the bind.

Cheers
Syamkumar.M

Thursday 24 April 2014

How to enable Java Plugin to firefox on centos

Hi,

Below are the steps to install and enable java plugin for firefox. First we need to install java on the machine and then do the following steps to enable the plugin on the firefox.



root@test:~# ln -sf /opt/java/jre1.7.0_05/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins/

root@test:~# export JAVA_HOME="/opt/java/jre1.7.0_05"

Testing the plugin.

root@test:~# firefox http://java.com/en/download/testjava.jsp

Regards
Syamkumar.M

Tuesday 15 April 2014

How to Detect and secure Linux Cpanel Server From Spamming

Hi,

We faced some severe spamming issue on a Cpanel server, upon  checking the email queue, I can see that there is more than 1 lakh of emails. On checking the headers I can see that almost all of them are spam. Below are the steps that I have  taken for fixing the spamming issues on the server.

Exim command to detect the email queue is

exim -bpc

exim -bp|exiqsumm 

command will give you summary of the queue. Once you get the Message IDs from the above command you can view the Header of an email using the command

exim -Mvh Message ID


This will list the headers including the php script which is sending emails, if any.

X-php-script

You can check the body of the message as well in exim to make sure that it was a body of spam email

exim -Mvb Message-ID


Mostly you will get the php script from the exim -Mvh command. But some times you won't get the php scripts from the headers. The hackers might made some custom changes so that it won't appear in the headers.

Then we can use the below command which will detect the directory under which exim is sending emails.

grep cwd /var/log/exim_mainlog | grep -v /var/spool | awk -F"cwd=" '{print $2}' | awk '{print $1}' | sort | uniq -c | sort -n

Also you will get the common subject of spam emails by searching for  duplicate subject lines from the exim logs.

awk -F"T=\"" '/<=/ {print $2}' /var/log/exim_mainlog | cut -d\" -f1 | sort | uniq -c | sort -n

The above commands will give you the directory in which exim is currently executing the emails.The above command will also list the count of emails. So you will know from which directory the emails are sending heavily. Just cd into the directory and check the php files inside or scan with available antivirus(clamav inside that directory)

clamscan -i -r Directory-Name


This will list the vulnerable php files. You just need to delete those files first.

After you find the files which caused the spamming you might need to run a full system scanning on the server using clamav antivirus to find out any other suspicious files are residing on the server.


clamscan -i -r /


Below are the steps to make the system more secure against spamming

1)First install a antivirus like clamav on the server and then scan whole the server and automate it to run daily or weekly using crontab.

2)Install CSF firewall on the server and enable lfd on it

3)Install chrootkit or RK hunter on the server and automate the scanning of those using cron jobs

4)Disable  shell access for users  on the Cpanel servers unless it is required.

5)Disable any unanonymous FTP uploads on the Cpanel server.

6)Disable variables like open_basedir and php exec_shell and register_globals of php on the server

Regards
Syamkumar.M





Sunday 6 April 2014

How to change Outgoing IP of exim in a Cpanel server

Hi All,

Some times the IP of a cpanel server may got black listed due to spamming and hence we shouldn't be able to send emails to gmail or yahoo etc. This would affect whole customers of a server as no email communication is not possible.  A work around or temperory solution for this issue was to change the outgoing email IP of the cpanel server. Below is the steps to change the ip of a outgoing exim email server in Cpanel.

1)First you need to stop the email service exim through command line.

root@server [~]# /etc/init.d/exim stop

2)Now Login to your WHM control panel and do the changes on the section Exim configuration Manager on WHM.

Reference /etc/mailips for outgoing SMTP connections [?]
Send outgoing mail from the IP address that matches the domain name in /etc/mailips (more information)
Make the above settings to on.
3)Now login to the server as root and then open the configuration file /etc/mailips

add the new outgoing ip adress for exim as 

*:X.X.X.X

Where x.x.x.x is the ip adress you need to change. Save the configuration file and exit.


4)Restart the exim service

/etc/init.d/exim restart




Now the email will be sending from new fresh ip which is not black listed.


Regards
Syamkumar.M


Tuesday 25 March 2014

psql: FATAL: parameter "listen_addresses" cannot be changed without restarting the server

Hi,

We faced an issue on one of the machine, where the postgresql commands are not runnning as root. Always getting the below error while executing any psql command

psql: FATAL:  parameter "listen_addresses" cannot be changed without restarting the server.

Initially I thought it was some thing to do with the settings on the pg_hba.conf file and postgresql.conf file where the variable listen_address is specified .The variable listen_adresses has been changed on postgresql.conf from

listen_addresses = '*'

to

listen_addresses = '10.11.16.112'

Then restarted the postgresql service. But still got the same error. One of the strange thing is that I am able to connect to postgresql command line from another machine to the machine having issue, but not from with in the machine as root.

Finally On checking, I found that there was a variable named PGOPTIONS was the issue.  Below is the steps I had done to resolve it.

Find the value of variable PGOPTIONS on the command line using the command

echo $PGOPTIONS
-i

SO I found out that the variable was defined in the server some where . I found out the variable on the environment file /etc/environment.

I changed the value from -i to Null value on /etc/environment

vi /etc/environment
PGOPTIONS=""


 Now the command echo $PGOPTIONS showed the null value

And now I am able to execute any psql command operations like pg_dump.

Regards
Syamkumar.M




Monday 24 March 2014

/etc/rc.local not running on the boot

Hi,

   /etc/rc.local is the file which runs once the system boots up. If we need to run few commands immediately once the system starts up, we can do it by adding those commands in /etc/rc.local.

Last week I faced an issue in which the commands inside the rc.local was not working, once the system boot.  I tried starting and stopping the systems so many times and tried to change the settings of /etc/rc.local, but still it was not working.  Then I read in one of the Centos Forums that it was some issue with the first boot.

In my machine firstboot got hanged and init was not able to execute the content inside /etc/rc.local. Below is the steps to resolve it

check to see if firstboot is still running and kill it:


ps ax |grep firstboot
killall firstboot


This will kill the first boot .

Then switch the firstboot permenantly using chkconfig

chkconfig firstboot off


The first boot issue was caused by some of the software installations which may confuse the firstboot.

Regards
Syamkumar.M
 

Tuesday 18 March 2014

How to change ulimit values permanently for a user in Centos

Hi,

ulimit is the parameter which defines the limits a process can use on a linux system.  It will provide control over the resources a user or a process in a shell can use.  You can list the current setting of ulimit values by login as your user and type the following commands

# ulimit -Hn
# ulimit -Sn


Default values should be 4096 and 1024 respectively.
 

So it will also determine the number of open files a user can open or edit. For increasing the ulimit, you need to change those paramentes in a configuration file called

/etc/security/limits.conf

If I need to change the ulimit value for my user on  a linux system. Then you should login to machine as root.

Open the above file in editor and then add the following content to it.

syam        soft nofile 9000
syam        hard nofile 65000



Now you should see the changes to the ulimit value for a user when you switch user from the root. But still the limit won't get reflected when user login as ssh with the password. We need to add the following steps to get the changes reflected for the user upon ssh login as user .


  1. In /etc/pam.d/sshd added the line
session required pam_limits.so
  1. In /etc/pam.d/login added the line
session required pam_limits.so
  1. In /etc/ssh/sshd_config added
UsePAM yes

Now restart the sshd service

4. /etc/init.d/sshd restart

Now the ulimit values will be changed permenantly and you can see the values once you ssh into the machine as user.


ulimit -Hn
65000

ulimit -Sn

9000

Regards
Syamkumar.M




Tuesday 11 March 2014

How to Delete a line from gz file having huge size

Hi,

We got a task to delete a specific line from a 6Gb gzip file. Below is the steps followed to delete the line.

1)Use zgrep to search through the gzip files

zgrep is used to search a line or pattern from the gzipped file. The output will be same as that of grep command on a normal file. Here we use the command as below. There is a specific pattern on that line through which we need to find the line number and then delete the line from that file using sed.

zgrep -in pattern test1.gz

2)From the above command we got the line number which we need to delete. It is 5344402. Then we need to use sed command to delete line on that line number. But we can't use sed on a gzipped file. So we need to unzip the file

unzip test.gzsya

3)Now we can use sed command to delete that line from the test file

sed -i '5344402d' test

Above command will delete the line on that line number of the file.

4)Again zip the file

zip test






Thats all
Thanks

Monday 3 March 2014

Switch off redirection from http to https in DirectAdmin

Hi,

Below is the steps to disable redirection from http to https in the direct admin Login page. Default Direct admin Login URL is http://domainname:2222, where 2222 is the port used by Direct admin.

The DirectAdmin configuration file is

/usr/local/directadmin/conf/directadmin.conf

Open it in a text editor like vi to view its content

It contains all the default configuration for the directadmin like port and ssl.

Search for ssl in the file

SSL=1
cacert=/usr/local/directadmin/conf/cacert.pem
cakey=/usr/local/directadmin/conf/cakey.pem


You will get the result as above which contains certificate file location for the self signed certificate the directadmin is using.

You can turn the ssl off so that it will no longer redirect from http to https.

 SSL=0

Save the file and exit

Similarly if you need to change another port for directadmin Admin url you can change it in the above  configuration file.


Regards
Syamkumar.M




Thursday 27 February 2014

ImageMagic Installation in plesk Centos


Hi,

Below is the steps to install ImageMagic on  plesk server.

1)Install ImageMagic using yum

yum install ImageMagic

2)Also Install ImageMagic-devel package

yum install ImageMagick-devel

3)For compiling ImageMagic with php, we need the package called php-pear

yum install php-pear

4)Now compile ImageMagic with php using pecl

pecl install imagick

For the above command to work, server need to have gcc compiler installed.

Some times you will get the error as sh: phpize: command not found

 To fix that error you need to install php5-devel package using the command

yum install php-devel

5)Now the extension module for imagick.so will be created under the php modules directory usually under /usr/lib/php/modules/

So we need to add the extension to php.ini

find out the location of php.ini on the server using the command

php -i | grep php.ini

default location should be /etc/php.ini

vi /etc/php.ini

open it in a editor and add the following line under “extension_dir” directive

extension = “imagick.so”

6)Save file and restart apache.

ImageMagic should be installed now.  The path of the convert for the ImageMagic should be /usr/bin/convert.


Thanks
Syamkumar.M

Monday 24 February 2014

Fix Sungrid Engine state 'E' (error)

Hi All,

I got an error state named E on some of the nodes running sun grid engine. The error message is getting while I issue the command

qstat -f 

queuename                      qtype resv/used/tot. load_avg arch          states
---------------------------------------------------------------------------------
m1.large@machine1.com BIP   0/0/1          -NA-     lx26-amd64    au
---------------------------------------------------------------------------------
m1.large@machine2.com BIP   0/0/1          -NA-     lx26-amd64    au
---------------------------------------------------------------------------------
m1.large@machine3.com BIP   0/0/1          0.05   lx26-amd64    E
---------------------------------------------------------------------------------
m1.large@machine4.com BIP   0/0/1          -NA-     lx26-amd64    au
---------------------------------------------------------------------------------



As shown above you can see that the machine3 is in E state. On the sungrid engine documentation E state  is an error state.



You will get the exact reason for this error state by issuing the command

qstat -f -explain E

  The E error state will not clear till the node is rebooted or restarting the grid engine. 

Because of this error, no job will hook in to that node and job will be in queue wait state.

Once you resolved the issues related to that node, you can issue the command 

# qmod -c '*'

This will clear the E state of the node and now job will hook into it.

Cheers
Syamkumar.M


Sunday 23 February 2014

Steps to Migrate Wordpress websites in Linux

Hi,

In this post, I am explaining the steps to migrate a wordpress website from one hosting space to another.

Wordpress is a popular blogging software now adays and is used in many of the popular websites. It was completely based on  mysql and php. The key configuration file for the wordpress is wp-config.php where the wordpress stores the database details.

Typical configuration details of mysql in wp-config.php is like below


// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'skm_wp717');

/** MySQL database username */
define('DB_USER', 'skm_wp717');

/** MySQL database password */
define('DB_PASSWORD', 'dbpassword');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

We should specify a database with a db user with full privileges to the database. Also need to specify the database password of the DB user.


Here I only describe the steps needed to migrate the wordpress website

1)First login to your wordpress website document root(for a cpanel it will be /home/user/public_html). And open the configuration file wp-config.php. Note down the database name, username, password from it.

2)Take a backup of the database you got from the configuration file wp-config.php.

If you have root access to the server, then you can create a database backup using mysql dump

mysqldump -u root -pdbpassword skm_wp717 > skm_wp717.sql

This will generate the mysql backup in sql format. 

Also you can export the backup of the database from the phpmyadmin.

3)Now you need to copy the data from the existing server to a new server.  I assume you already know the document root where the database files exists for the wordpress site. So you can eithere use scp or rsync to copy the files from here to there. You can also use the FTP as well.

scp example command for the transfer

scp -r root@servername:/home/user/public_html root@remoteserver:/home/newuser/public_html

Also copy the database to the new server using scp or rsync or ftp

scp root@servername:/home/user/skm_wp717.sql root@remoteserver:/home/


4)Now the data and mysql has been migrated.  You need to check if the permission for the files we transfered are correct with respect to the user in the new server. If not you need to change them manually

That is for changing the owner ship and group of the files in the new server .

cd /home/user
chown -R newuser:newuser public_html

if all the files need to have 644 permission , you can use the command find to change the permission of files to 644 and directories to 755.

Note: the below command is for cpanel users , as cpanel files need to have 644 permission for files and 755 permission for directories
cd public_html
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 { } \;

5)Now create a database (Eithere you can use the same name or another). If you have different name . then you need to change it in the wp-config.php

Also create a database user with password and grant all previlages to the user on that database.

6)Now restore the database tables from the backup sql file to the new database we had created.

mysql -u root -ppassword newdatabase < skm_wp717.sql

Once it completes you have all the database data on your new db.

7)Open wp-config.php and change the values to the new one on it. Modify database name , user and password to the new one if it is different from the old server. If you have created the db, user and password same as that of the old server, you can skipp this step, but need to cross check the wp-config.php

8)Open your website with the new configurations from the new server.  You can do it by specifying the new ip with the website name in /etc/hosts file in your linux system

open /etc/hosts

ip websitename


If every thing is correct, then the wordpress page will load fine.

Cheers
Syamkumar.M





Friday 21 February 2014

NFS4 share configuration in Ubuntu

Hi,

NFS is a service used to share a folder or a directory  located on one networked computer with other computers/devices on that network. It is a native Linux/ Unix protocol unlike samba, which can be shared both in windows and Linux

In NFS version 4 , there is a concept called pseudo file system.

That is there is a directory called /exports which is shared as pseudo file system and all of the directories in the server can be shared by binding it inside the /exports file system

/exports file system can be mounted using the command

mount -t nfs shareip:/ /mnt

That is there is no need to give the share name /exports on mounting it.

Also we can bind any directory inside the /exports folder and can be shared via nfs version4

Below is the steps to configure it

apt-get install nfs-kernel-server

Above command will install the required packages to run nfs server on ubuntu

In NFS 4 all of the directories we are going to share will exist inside a single pseudo file system

All of the directories can be shared under that pseudo file system using --bind option

Let's say we want to export our users' home directories in /home/users. First we create the export filesystem:

mkdir -p /export/users 
  
Now we will bind the /home/users directory inside the /export as

mount --bind /home/users /export/users
Also add it on /etc/fstab

/home/users /export/users none bind 0 0
 


Now open the configuration file /etc/exports and add the following shares as given below

/export 10.11.15.0/24(rw,fsid=0,insecure,no_subtree_check,async) /export/users 10.11.15.0/24(rw,nohide,insecure,no_subtree_check,async)

That is we are exporting the share to subnet 10.11.15.0/24
Once it is done we can start the nfs kernel service using the below command

# service nfs-kernel-server restart
 
 
On the client side install package called

apt-get install nfs-common


Once it is done try to mount the nfs share using the command below

mount -t nfs shareip:/ /mnt

mount -t nfs shareip:/users /mnt/users

Cheers
Syamkumar.M



Thursday 20 February 2014

Lustre Troubleshooting

Hi,

 Last Week, we faced an issue in which our KVM infrastructure, we are using lustre share for storing the disk images of VMs. We have few critical vms running in one of the nodes and those machines get into paused state showing that disk space is full on nodes

Exact error message is given below

"block I/O error in device 'drive-ide0-0-1': No space left on device (28)"

Upon checking the hard drive disk space inside that vm in single usermode, I can see that it had almost 2 TB of free space.

So I believe it was some issue with disk image. So I ran fsck on the disk image in single user mode. But still it didn't worked. Finally I confirmed that it was some issue with the lustre file system, when one more VM running from lustre getinto paused state with the same error.

Finally I began to trouble shoot for lustre errors. Below are the steps that I have done on debugging the lustre

I checked the lustre logs and found the error as


"(vvp_io.c:1018:vvp_io_commit_write()) Write page 369920 of inode ffff8820120601b8 failed -28".


On lustre documentation the error code -28 is "The file system is out-of-space or out of inodes"(http://wiki.lustre.org/manual/LustreManual20_HTML/LustreTroubleshooting.html)


Also I checked the command to list the disk space of all of the OSTs in lustre

lfs df -h 


UUID                       bytes        Used   Available Use% Mounted on
klust01-MDT0000_UUID        1.2T      933.1M        1.1T   0% /klust01[MDT:0]
klust01-OST0000_UUID        9.1T        8.6T      202.8M 100% /klust01[OST:0]
klust01-OST0001_UUID        9.1T        5.8T        2.8T  68% /klust01[OST:1]
klust01-OST0002_UUID        9.1T        5.5T        3.1T  64% /klust01[OST:2]
klust01-OST0003_UUID        9.1T        5.8T        2.9T  67% /klust01[OST:3]
klust01-OST0004_UUID        9.1T        6.5T        2.2T  75% /klust01[OST:4]
klust01-OST0005_UUID        9.1T        6.6T        2.0T  76% /klust01[OST:5]
klust01-OST0006_UUID        9.1T        7.9T      796.0G  91% /klust01[OST:6]
klust01-OST0007_UUID        9.1T        6.4T        2.2T  74% /klust01[OST:7]
klust01-OST0008_UUID        9.1T        6.8T        1.8T  79% /klust01[OST:8]
klust01-OST0009_UUID        9.1T        6.4T        2.2T  74% /klust01[OST:9]
klust01-OST000a_UUID        9.1T        8.6T       48.2M 100% /klust01[OST:10]
klust01-OST000b_UUID        9.1T        7.9T      733.8G  92% /klust01[OST:11]

filesystem summary:       109.1T       82.8T       20.8T  80% /klust01


In above the OST 0 and OST 10 is filledup to 100%.

On checking I can see that both the VM disks are located in OST10  whose disk is filled up.

Below is the command to check in which OST the image locates

lfs getstripe /var/test.img

lmm_stripe_count:   2
lmm_stripe_size:    1048576
lmm_stripe_offset:  8
    obdidx         objid        objid         group
         8           1815776         0x1bb4e0                 0
        10           1728679         0x1a60a7                 0


 So finally we deleted some unused data from ost 10 and then rebooted the OST main node, which fixed the issue.

Cheers 
Syamkumar M 
 
   







Thursday 6 February 2014

How to make a KVM Virtual machine boot From CDROM

Hi,

If you have a running KVM VM and you need to boot this VM from a Bootable Linux iso image inorder to fix some issues on the KVM machine. Below are the steps to boot the KVM machine from CD ROM.

KVM machine is using the xml files for the configuration. We need to edit the configuration xml file inorder to make any changes in the VM.

1_First Shutdown the VM using the command.

virsh shutdown vmname

2)Open the configuration file of the VM using the command

virsh edit vmname

3)Search for the word cdrom and add the lines as below

<disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/opt/isos/CentOS-6.3-x86_64-bin-DVD1.iso'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>


Here we specified the iso image as the source file parameter.




4)Now the cdrom has been added on the VM. But now we need to make the cdrom as the first boot device.

For that we need to change the boot order of vm. Below is the lines which specifies the boot loader for the KVM vm


<os>
    <type arch='x86_64' machine='rhel6.2.0'>hvm</type>

<boot dev='cdrom'/>
<boot dev='hd'/>
    <bootmenu enable='yes'/>
  </os>






In above I put the boot device as cdrom in the parameter <boot dev='cdrom'/> and put it above the hd.

Now reboot the machine and then the vm will boot from the Linux iso image we added.

Cheers
Syamkumar




Friday 24 January 2014

"Device eth0 does not seem to be present" After Cloning a Centos machine on Vsphere


Hi,

After cloning or moving a machine in VSphere, On starting the Virtual machine, I got error message as below

"Device eth0 does not seem to be present" Delaying initialization.

On cloning a Virtual machine on Vsphere, we need to edit the MAC adress on the VM settings. This change is recognized by the new VM . But it will list the NIC as eth1 instead of eth0, as eth0 MAC adress(Adress of the VM from which we cloned it) is still in the configuration file of new VM.

The configuration file where the Centos machine stores its NIC information is in

  vi /etc/udev/rules.d/70-persistent-net.rule

This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:02:bf:b5", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:8b:2f:fd", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"


As you can see tat the new MAC Adress is recognized as the adress for eth1. So eth0 won't start.


so we need to edit that file and delete the first entry of in that file.


Then rename the eth1 to eth0  keeping only the second line.


After that start udev configuration using the command below


start_udev

Now restart network services:
service network restart
 
If there is proper configurations are set in the file /etc/sysconfig/network-scripts/ifcfg-eth0, then the eth0 will start.

Cheers
Syam
 


Error: Package: python-paramiko-1.7.6-1.el5.rf.noarch (rpmforge) Requires: python(abi) = 2.4

Hi,

 I had to install a package on a Centos 6.3 machine and I got python dependancy error as below.

Resolving Dependencies
--> Running transaction check
---> Package libedit.x86_64 0:2.11-4.20080712cvs.1.el6 will be updated
---> Package libedit.x86_64 0:20090923-3.0_1.el5.rf will be an update
---> Package libffi.x86_64 0:3.0.5-3.2.el6 will be updated
---> Package libffi.x86_64 0:3.0.9-1.el5.rf will be an update
---> Package perl-Test-Harness.x86_64 0:3.17-129.el6 will be updated
---> Package perl-Test-Harness.noarch 0:3.22-1.el5.rf will be an update
---> Package perl-Test-Simple.x86_64 0:0.92-129.el6 will be updated
---> Package perl-Test-Simple.noarch 0:0.98-1.el5.rf will be an update
---> Package portreserve.x86_64 0:0.0.4-9.el6 will be updated
---> Package portreserve.x86_64 0:0.0.5-2.el5.rf will be an update
---> Package python-beaker.noarch 0:1.3.1-6.el6 will be updated
---> Package python-beaker.noarch 0:1.5.3-1.el5.rf will be an update
--> Processing Dependency: python(abi) = 2.4 for package: python-beaker-1.5.3-1.el5.rf.noarch
---> Package python-mako.noarch 0:0.3.4-1.el6 will be updated
---> Package python-mako.noarch 0:0.3.5-1.el5.rf will be an update
--> Processing Dependency: python(abi) = 2.4 for package: python-mako-0.3.5-1.el5.rf.noarch
---> Package python-markupsafe.x86_64 0:0.9.2-4.el6 will be updated
---> Package python-markupsafe.x86_64 0:0.11-1.el5.rf will be an update
--> Processing Dependency: python(abi) = 2.4 for package: python-markupsafe-0.11-1.el5.rf.x86_64
---> Package python-paramiko.noarch 0:1.7.5-2.1.el6 will be updated
---> Package python-paramiko.noarch 0:1.7.6-1.el5.rf will be an update
--> Processing Dependency: python(abi) = 2.4 for package: python-paramiko-1.7.6-1.el5.rf.noarch
--> Finished Dependency Resolution
Error: Package: python-mako-0.3.5-1.el5.rf.noarch (rpmforge)
           Requires: python(abi) = 2.4
 Installed: python-2.6.6-36.el6.x86_64 (@anaconda-RedHatEnterpriseLinux-201301301459.x86_64/6.4)
               python(abi) = 2.6
           Available: python-2.6.5-3.el6.i686 (rhel-6-workstation-rpms)
               python(abi) = 2.6
           Available: python-2.6.5-3.el6_0.2.i686 (rhel-6-workstation-rpms)
               python(abi) = 2.6
           Available: python-2.6.6-20.el6.x86_64 (rhel-6-workstation-rpms)
               python(abi) = 2.6
           Available: python-2.6.6-29.el6.x86_64 (rhel-6-workstation-rpms)
               python(abi) = 2.6
           Available: python-2.6.6-29.el6_2.2.x86_64 (rhel-6-workstation-rpms)
               python(abi) = 2.6
           Available: python-2.6.6-29.el6_3.3.x86_64 (rhel-6-workstation-rpms)
               python(abi) = 2.6
Error: Package: python-paramiko-1.7.6-1.el5.rf.noarch (rpmforge)
           Requires: python(abi) = 2.4
 Installed: python-2.6.6-36.el6.x86_64 (@anaconda-RedHatEnterpriseLinux-201301301459.x86_64/6.4)
               python(abi) = 2.6
           Available: python-2.6.5-3.el6.i686 (rhel-6-workstation-rpms)
               python(abi) = 2.6
           Available: python-2.6.5-3.el6_0.2.i686 (rhel-6-workstation-rpms)
               python(abi) = 2.6
           Available: python-2.6.6-20.el6.x86_64 (rhel-6-workstation-rpms)
               python(abi) = 2.6
           Available: python-2.6.6-29.el6.x86_64 (rhel-6-workstation-rpms)
               python(abi) = 2.6
           Available: python-2.6.6-29.el6_2.2.x86_64 (rhel-6-workstation-rpms)
               python(abi) = 2.6
           Available: python-2.6.6-29.el6_3.3.x86_64 (rhel-6-workstation-rpms)
               python(abi) = 2.6
Error: Package: python-beaker-1.5.3-1.el5.rf.noarch (rpmforge)
           Requires: python(abi)
 Installed: python-2.6.6-36.el6.x86_64 (@anaconda-RedHatEnterpriseLinux-201301301459.x86_64/6.4)
               python(abi) = 2.6
     Available: python-2.6.5-3.el6.i686 (rhel-6-workstation-rpms)
 
 
 

The reason is that the python 2.6 package was installed by default on the Centos .But the new installation needs the python 2.4 . The best option is to install python-devel package for that.

So we can install it by enabling the EPEL repository in Centos. Below are the steps to enable EPEL repository in Centos

Enable EPEL Repository

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm


Then do the following steps

yum clean all

yum clean metadata

Then install the required package. It will work


Cheers
Syam 
 
 

Friday 17 January 2014

Reset Qmail Admin Postmaster Password

Hi All,


You need to login to Qmail Admin as postmaster inorder to control the email settings or to create new email accounts for the domain etc. But once you forget the password of postmaster account of the domain, you won't be able to manage the domain through the admin toaster.


Below is the step to reset the Admin password for the Qmail

1)First login to the Qmail server
2)Reset the password using the command as below

"/home/vpopmail/bin/vpasswd postmaster@testdomain.com"

change the password to new one. Now you will be able to login to the postmaster account with the new password.

Regards
Syamkumar

Wednesday 8 January 2014

no iKVM64 in java.library.path on SuperMicro IP KVM

Hi All,


I faced an issue on accessing IPMI on  ubuntu 11.10. On launching java .jnlp file I am getting error message as below and got disconnected

"no iKVM64 in java.library.path on SuperMicro IP KVM"

A workaround for this problem is to download the .jnlp file and open it with an editor. Copy the two lines stated below, taken from the <resources> entry, to the corresponding <resources os=”Linux” arch=”amd64″> entry. Then start the file with java webstart.
<property name="jnlp.packEnabled" value="true"/>
<property name="jnlp.versionEnabled" value="true"/>


 

Ad