Subscribe:

Ads 468x60px

Pages

Wednesday, September 7, 2011

EX442 System Monitoring and Performance Tuning Certificate of Expertise


Systems Monitoring and Performance Tuning

EX442 System Monitoring and Performance Tuning Certificate of Expertise
  • use utilities such as vmstat,iostat,mpstat,sar, gnome-system-monitor, top and others to analyze and report system behavior
  • configure systems to provide performance metrics over a network via SNMP
  • query system performance metrics using SNMP
  • configure graphical SNMP client utilities such as MRTG,RRDtool, etc.
  • use the Pluggable Authentication Modules (PAM) mechanism to implement restrictions on critical system resources
  • use /proc/sys, sysctl and /sys to examine and modify and set kernel run-time parameters
  • use utilities such as dmesg, dmidecode, x86info, sysreport etc. to profile system hardware configurations
  • analyze system and application behavior using tools such as ps, strace, top, OProfile and Valgrind
  • configure systems to run SystemTap scripts
  • alter process priorities of both new and existing processes
  • configure systems to support alternate page sizes for applications that use large amounts of memory
  • given multiple versions of applications that perform the same or similar tasks, choose which version of the application to run on a system based on its observed performance characteristics
  • configure disk subsystems for optimal performance using mechanisms such as software RAID, swap partition placement, I/O scheduling algorithm selection, file system layout and others
  • configure kernel behavior by altering module parameters
  • calculate network buffer sizes based on known quantities such as bandwidth and round-trip time and set system buffer sizes based on those calculations
Read more...

Configure a High-Availability(HA) cluster using physical system


Port Number for the cluster
luci - 8084
ricci - 11111


Install luci and ricci on cluster nodes
[root@server1 ~]# yum install -y luci ricci


Initialize the luci
[root@server1 ~]# luci_admin init
Initializing the luci server


Creating the 'admin' user


Enter password:
Confirm password:


Please wait...
The admin password has been successfully set.
Generating SSL certificates...
The luci server has been successfully initialized


You must restart the luci server for changes to take effect.


Run "service luci restart" to do so


Start the luci service
[root@server1 ~]# service luci start
Starting luci: Generating https SSL certificates...  done             [  OK  ]


Point your web browser to https://server1.example.com:8084 to access luci


Open the firefox
[root@server1 ~]# firefox https://server1.example.com:8084 &


[root@server1 ~]# netstat -ntlp | grep 8084
tcp        0      0 0.0.0.0:8084                0.0.0.0:*                   LISTEN      11076/stunnel

Read more...

Wednesday, August 24, 2011

MySQL Checksum

This is another tool in the same toolkit as archiver. I just saw a great blog post on it athttp://blog.arabx.com.au/?p=883. Documentation can be found athttp://mysqltoolkit.sourceforge.net/doc/mysql-checksum-filter.html. This is an invaluable tool for ensuring your replicated tables are staying in sync, something that MySQL replication does not do. Tables will drift and if you are dealing with critical data for read support, reports or backups, this will prove invaluable.

This is referenced from the following site
Read more...

Nagios Plugins for Monitoring MySQL

You can come to know how to setup Nagios pluging for monitoring the mysql server by seeing this video and as well as pdf file
I am about to present the very first public appearance of PalominoDB's nagios plugin for MySQL.  This has been running on several clients in production for about 6 months, so we know it's stable.  The PDF's of the presentation slides and white papercan be downloaded, and are also available from our Community section (presentationsand white papers) in the menu bar at the top of each page.  Also you can download the code to use in your Nagios infrastructure.



The link of the pdf file. Please click here

Read more...


Login as root
# su -
# <Enter password>

open nagios configuration file
# vi /usr/local/nagios/etc/nagios.cfg

open your windows configuration file for editing
# vi /usr/local/nagios/etc/ojects/windows.cfg

###Enter insert mode and provide the monitored computer's IP address here###
###Host Definations###
define host {
use windows-server
host_name winserver
alias My Windows Server
address 192.168.91.2
}

Now exit and save this file
:wq

I have already downloaded "send_sms.sh" script into my desktop

I will copy "sms_send" script to the "libexec" folder
# cp /root/Desktop/sms_send.sh /usr/local/nagios/libexec

open your "commands config file for editing
# vi /usr/local/nagios/etc/objects/commands.cfg

Enter insert mode and type your command definations here
## ozeki's NG's 'notify-service-by-sms' command defination ##
define command{
command_name   notify-service-by-sms
command_line   /usr/local/nagios/libexec/sms_send.sh "--Nagios Service Notification --Host: $HOSTNAME$, State: $HOSTSTATE$, Service:$SERVICEDESC$, Description: $SERVICESTATE$, TIME:$LONGDATETIMES$"
}


## ozeki's NG's 'notify-host-by-sms' command defination ##
define command{
command_name   notify-host-by-sms
command_line   /usr/local/nagios/libexec/sms_send.sh "--Nagios Host Notification --Host: $HOSTNAME$, State: $HOSTSTATE$, TIME:$LONGDATETIMES$"
}

once it is done,exit and save your file
:wq

Open your "contacts" config file for editing
# vi /usr/local/nagios/etc/objects/contacts.cfg
## below the CONTACTS section edit the following ##
##Enter the notification command values for the contact##
define contact{
contact_name nagiosadmin;
use generic-contact;
alias Nagios Admin;
service_notification_commands   notify-service-by-sms
host_notification_commands   notify-host-by-sms
email nagios@localhost;
}


Onece it is done, exit and save your file.
:wq


To make changes come into force, restart Nagios service
# service nagios restart

Now you can start Nagios
# firefox http://localhost/nagios

Enter user name and password

click Host Group
click services
click criticals
As you can see there are already some problems with the monitored computer.

If you take a look at Ozeki NG - SMS Gateway you can see the sent message.
# firefox http://127.0.0.1:9501

Enter user name and password of SMS Gateway application

click admin
click sent
view the message have been sent.

For more information please visit Ozekisms site
Read more...

Saturday, August 20, 2011

Windows Shared HP printer in Ubuntu / Debian Linux (using samba)


Most of the Computer Labs in Industry and Education Institutions are equipped with Windows. So Printers are also connected to Windows machines. Here a Simple howto for sharing windows shared printers for Linux users. I have test with a HP1015 printer installed in an Windows XP machine and shared. My linux box is ubuntu 9.04 ( I also tested with ubuntu 8.04, 8.10 , debian 4.0 and 5.0).

First install samba

apt-get install samba

apt-get install smbfs

apt-get install cupsys

after this installations

open a browser and type

http://localhost:631/

you will get a cups administration page

select add printer

then type Name : anything
Location : anything
description : anything

now you will get a dropdown menu

select windows printer via samba

now there is text box Device URI

type smb://shibuscomputer/1015 ( see I have a shared hp 1015 printer at computer name called shibuscomupter and share name of printer is 1015 with permision to all)

after selecting uri u will get a page for selecting make

select your printer make in my case it is HP

next page select model HP Laserjet series PCL 4/5 CUPS v 1.2 (en)
now printer installation is over

you can make a test print now
Read more...

Famous Personalities of Computer Science

I am trying to collect photos of Famous Personalities of Computer Science.

Charles Babbage
(Father of Computer)
Famous mathematician, philosopher, inventor and mechanical engineer who originated the concept of a programmable computer.













Blaise Pascal (Father of Programming Language)

French mathematician, physicist, and religious philosopher










Alan Turing ( Father of Computer Science)



Alan Turing was conceived in Chhatrapur, Orissa, India.[4] His father, Julius Mathison Turing, was a member of the Indian Civil Service. Read More Here






Gordon Moore ( Moor's Law)


Several measures of digital technology are improving at exponential rates related to Moore's law, including the size, cost, density and speed of components.








Claude E Shannon (Father of Information Theory)

Claude Elwood Shannon, the mathematician who laid the foundation of modern information theory while working at Bell Labs in the 1940s, died on Saturday. He was 84.

Read More Here






John Warner Backus ( Founder of FORTRAN)


John Warner Backus (December 3, 1924 – March 17, 2007) was an American computer scientist. He directed the team that invented the first widely used high-level programming language (FORTRAN) and was the inventor of the Backus-Naur form (BNF),
More
Read more...

Friday, August 19, 2011

Install spamassassin with sendmail

1. Install spamassassin on the server
# yum install spamassassin -y

2. Install required perl CPAN modules
# perl -MCPAN -e shell
cpan> install Digest::SHA1
cpan> install HTML::Parser
cpan> Install option perl modules...

3. Edit spamassassin configuration in /etc/mail/spamassassin/local.cf .
# vim /etc/mail/spamassassin/local.cf
# Encapsulate spam in an attachment (0=no, 1=yes, 2=safe)
report_safe 0

# Enable the Bayes system
use_bayes 1

# Enable Bayes auto-learning
bayes_auto_learn 1

# Enable or disable network checks
skip_rbl_checks 0
use_razor2 1
use_dcc 1
use_pyzor 1

# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_languages all

# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales all

4. Tell procmail to run spamc on everyone's mail. Add these to /etc/procmailrc :

DROPPRIVS=yes

:0fw
| /usr/bin/spamc

5. Restart spamassassin
# service spamassassin restart 
Read more...

Linux ext3 filesystem: Deleting files won't free space -- at 100% disk usage

We've had our / filesystem used 100% with 0 bytes available. To free up some space, we've deleted a whole bunch of files, but df still reports there are 0 bytes available. Rebooting the system did not have any effect.

Apparently, the system starts to reserve space for system use. The tune2fs command reports current filesystem usage.

To see how much space is reserved, run

# tune2fs -l /dev/VolGroup00-LogVol00

To reset the reserved space to zero, run the following command as a root user.

# tune2fs -r 0 /dev/mapper/VolGroup00-LogVol00

By running the command above, we were able to free the space available for the linux users to use.
Read more...

Auto Mount NTFS/FAT23 in Ubuntu


This how you can mount windows partitions in ubuntu. You can only read NTFS but you can read and write on FAT32.

1. Run this command to see what partitions are NTFS/FAT32: sudo fdisk -l
# fdisk -l

2. Create a new directory to mount the partition to: 
# mkdir /mnt/windows

3. Backup /etc/fstab: 
# cp -rvfp /etc/fstab /etc/fstab_backup

3. Edit /etc/fstab:
#vim /etc/fstab
## Copy this line to the end of the file and change hd1 with the correct windows partition ##
## For NTFS ##
/dev/hda1 /media/windows ntfs nls=utf8,umask=0222 0 0
## For FAT32 ##
/dev/hda1 /media/windows vfat iocharset=utf8,umask=000 0 0
4. save and quit
:wq

The next time you restart ubuntu, it will mount automatically. 
Read more...

svchost.exe using 100% CPU


Happens when Windows tries to use Automatic Update. This problem happened to my pc which I fixed after a couple of days googling and yahooing for a fix.


The !@#$ problem also happened during my final exam, the database programming course, I had to restart - yeah RESTART THREE TIMES not by shutting down but by pressing the power button because I couldn't save my files or quit the application. I lost my data three times.

So before I continue I would like to thank the ITSS at Saint Mary's University for the fantastic support and quality of work. Really! to lose my data three freaking times in the final exam and waste about 30min trying to get the damn thing to work. What a !@#$ lab is that?!

Anyway, I found this "fix" which is easy and actually works! cuz the other fixes I found either didn't work or messed up the registry. This fix from Microsoft Windows Live OneCare forum.

Here we go:

1. Click Start->Run, type "services.msc" (without quotation marks) in the open box and click OK.
2. Double click the service "Automatic Updates".
3. Click on the Log On tab, please ensure the option "Local System account" is selected and the option "Allow service to interact with desktop" is unchecked.
4. Check if this service has been enabled on the listed Hardware Profile. If not, please click the Enable button to enable it.
5. Click on the tab "General "; make sure the "Startup Type" is "Automatic". Then please click the button "Start" under "Service Status" to start the service.
6. Repeat the above steps with the other service: Background Intelligent Transfer Service (BITS).

Now re-register Windows Update components and Clear the corrupted Windows Update temp folder:
1. Click on Start and then click Run.
2. In the open field type "REGSVR32 WUAPI.DLL" (without quotation marks) and press Enter.
3. When you receive the "DllRegisterServer in WUAPI.DLL succeeded" message, click OK.
4. Please repeat these steps for each of the following commands:
REGSVR32 WUAUENG.DLL
REGSVR32 WUAUENG1.DLL
REGSVR32 ATL.DLL
REGSVR32 WUCLTUI.DLL
REGSVR32 WUPS.DLL
REGSVR32 WUPS2.DLL
REGSVR32 WUWEB.DLL

After the above steps are finished. Since temporary folder of Windows Update may be corrupted. We can refer to the following steps to rename this folder that:
1. Click Start, Run, type: cmd and press Enter. Please run the following command in the opened window: net stop WuAuServ (note, you might need to reboot before the net stop command will work)
2. Click Start, Run, type: %windir% and press Enter.
3. In the opened folder, rename the folder SoftwareDistribution to SDold.
4. Click Start, Run, type: cmd and press Enter. Please run the following command in the opened window: net start WuAuServ


DONE!

As always with Windows, it's good to reboot when you're done just to make sure it works. 
Read more...

Fix Master Boot Record


You can't start Windows? I had this problem after removing Linux partitions.
If you have Windows and install Linux on another partition, Linux will overwrite the master boot record of the boot disk. If you remove the Linux partitions you won't be able to load windows.


Here's how you can fix it:
1. Insert Windows CD.
2. Restart.
3. Make sure the CD starts up.
4. Let Windows setup - blue screen - loads.
5. Once done, it will show three options, choose Repair.
6. Select the Windows directory from the list - most likely it's 1 if you have one copy of Windows.
7. Enter the Administrator password.
8. Type: fixmbr
9. Type: yes, to confirm.
10. Type: exit



The computer will restart and Windows will load just fine.
Read more...

HR interview Questions


Read more...

Analyzing Web sites with Webalizer

The Webalizer is a fast, free web server log file analysis program. It produces highly detailed, easily configurable usage reports in HTML format, for viewing with a standard web browser.

The Webalizer is a freeware software package which interprets a web site's log file data and displays this data in HTML format. Its is a highly configurable application which can be deployed on both Windows and Unix platforms. The Webalizer can be installed on a web server to provide statistics online, or can be installed on a local hard disc to provide statistics offline. The Webalizer web log analysis software was created by Bradford L. Barrett

The Webalizer. It is intended to explain what statistics are displayed and how the data can be used to provide an insight into the activity of the web site, for the purpose of marketing analysis and future web development. This manual does not provide information on how to install or configure the Webalizer. Information regarding installation and configuration of The Webalizer  is available from the developer's web site. Download The Webalizer software here.


The Usage Statistics Overview page details:
  1. The web site to which the statistics are applicable (displayed in the title)
  2. The summary period for the statistics (for example, "last 12 months")
  3. The last time the statistics were generated (date and time stamp)
Webalizer depends upon the gd graphics library so you will need to installgd first .

Install gd package
# yum install gd

Install webalizer package
# yum install webalizer

Check whether the webalizer installed or not
# rpm -qa | webalizer

your browser to http://localhost/webalizer/ to see what you have. If you do, the only thing you’ll see is:

Not Found
The requested URL /webalizer/ was not found on this server.

# rpm  -ql  webalizer

/etc/cron.daily/00webalizer
/etc/webalizer.conf /var/www/usage


Note: The directive “outputDir    /var/www/usage ” must be changed to “outputDir  /var/www/html/webalizer”
# mkdir  /var/www/html/webalizer
# cp  /var/www/usage/*   /var/www/html/webalizer

Wait the cronjob to execute webalizer (probably the next day ) , or run it manually for now  –> webalizer .

Access with your browser locally or remotely .
# firefox http://localhost/webalizer/ &
# firefox http://192.168.1.xx/webalizer &


Read more...

Wednesday, August 17, 2011

Unable to restart the iscsid service


[root@server1 ~]# service iscsid restart
Stopping iSCSI daemon: iscsiadm: can not connect to iSCSI daemon (111)!
iscsiadm: initiator reported error (20 - could not connect to iscsid)
iscsiadm: Could not stop iscsid. Trying sending iscsid SIGTERM or SIGKILL signals manually


Starting iSCSI daemon:                                     [FAILED]


[root@server1 ~]# service iscsid stop
Stopping iSCSI daemon: iscsiadm: can not connect to iSCSI daemon (111)!
iscsiadm: initiator reported error (20 - could not connect to iscsid)
iscsiadm: Could not stop iscsid. Trying sending iscsid SIGTERM or SIGKILL signals manually


[root@server1 ~]# service iscsid start              [  OK  ]
Starting iSCSI daemon:                                    [FAILED]

Solution:
Adds a module to the Linux kernel
[root@server1 ~]# modprobe iscsi_tcp
[root@server1 ~]# iscsid
Read more...

Configure ISCSI target and ISCSI initiator in linux server

In my lab setup, I have a host named server1.example.com, with an IP address of 192.168.1.112, which runs RHEL 6. This will be my iSCSI Target. A second host, named client1.example.com (192.168.1.11), which is also running RHEL 6, will be the iSCSI initator. 


Solution:
Open-iSCSI project software feature are high-performance, transport independent, multi-platform implementation of RFC3720 iSCSI


Step to configure the iSCSI Target:
Creating the iSCSI Target
install scsi-target-utils
[root@server1 ~]# yum install scsi-target -y


Start the tgtd service
[root@server1 ~]# service tgtd start


Make the service persistent after reboots
[root@server1 ~]# chkconfig tgtd on


Note: The tgtd service hosts SCSI targets and uses the iSCSI protocol to enable communications between targets and initiators. 

we need storage device to use as a target. 1.Create an LVM volume and 2. Create file-based images


1. Create an LVM volume
[root@server1 ~]# fdisk -l


Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1           6       48163+  83  Linux
/dev/sda2               7         853     6803527+  83  Linux
/dev/sda3             854         903      401625   83  Linux
/dev/sda4             904        1044     1132582+   5  Extended
/dev/sda5             904         977      594373+  83  Linux


Create a raw partition
[root@server1 ~]# fdisk /dev/sda
The number of cylinders for this disk is set to 1044.
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)


Command (m for help): n
First cylinder (978-1044, default 978):
Using default value 978
Last cylinder or +size or +sizeM or +sizeK (978-1044, default 1044): +200M


Command (m for help): t
Partition number (1-6): 6
Hex code (type L to list codes): 8e
Changed system type of partition 6 to 8e (Linux LVM)


Command (m for help): p


Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1           6       48163+  83  Linux
/dev/sda2               7         853     6803527+  83  Linux
/dev/sda3             854         903      401625   83  Linux
/dev/sda4             904        1044     1132582+   5  Extended
/dev/sda5             904         977      594373+  83  Linux
/dev/sda6             978        1002      200781   8e  Linux LVM


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


Calling ioctl() to re-read partition table.


WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.


[root@server1 ~]# partx -a /dev/sda


Create physical volume
[root@server1 ~]# pvcreate /dev/sda6
  Physical volume "/dev/sda6" successfully created


Create volume group
[root@server1 ~]# vgcreate vol01 /dev/sda6
  Volume group "vol01" successfully created


Create logical volume
[root@server1 ~]# lvcreate -L 150M -n log01 vol01
  Rounding up size to full physical extent 152.00 MB
  Logical volume "log01" created


2. Create file-based images
Create a new directory to store the image file
[root@server1 ~]# mkdir -p /var/lib/tgtd/virtualization


Create an image named virtimage2.img with a size of 100M.
[root@server1 ~]# dd if=/dev/zero of=/var/lib/tgtd/virtualization/virtimage2.img bs=1M seek=100 count=0


Configure the correct SELinux context for the new image and directory.
[root@server1 ~]# restorecon -R /var/lib/tgtd


Check the SELinux context for the new image and directory.
[root@server1 ~]# ls -ldZ /var/lib/tgtd/
drwxr-xr-x  root root root:object_r:var_lib_t:s0       /var/lib/tgtd/


Note: Targets can be created by adding an XML entry to the /etc/tgt/targets.conf file. The target attribute requires an iSCSI Qualified Name (IQN), in the format:
   iqn.yyyy-mm.reversed.domain.name:OptionalIdentifierText
where:
   yyyy-mm represents the 4-digit year and 2-digit month the device was started (for example: 2011-08);
   reversed.domain.name is the hosts domain name in reverse. For example, server1.example.com, in an IQN, becomes com.example.server1; and
   OptionalIdentifierText is any text string, without spaces, that helps the administrator identify which device is which.



Create the target
[root@server1 ~]# vim /etc/tgt/targets.conf
### At last add the following lines ###
<target iqn.2011-07.com.example.server1:trial>
backing-store /dev/vol01/log01                                     #LUN1
backing-store /var/lib/tgtd/virtualization/virtimage2.img   #LUN2
write-cache off
</target>


Save and quite
:wq


Note: Ensure that the /etc/tgt/targets.conf file contains the default-driver iscsi line to set the driver type as iSCSI (the driver uses iSCSI by default, but make sure that line is not commented out).
[root@server1 ~]# grep default-driver /etc/tgt/targets.conf
default-driver iscsi


IPTables configuration:
[root@server1 ~]# iptables -I INPUT -m tcp -p tcp --dport 3260 -j ACCEPT
[root@server1 ~]# service iptables save
[root@server1 ~]# service iptables restart


verify the new iscsi target
[root@server1 ~]# tgt-admin --show
Target 1: iqn.2011-07.com.example.server1:trial
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB
            Online: Yes
            Removable media: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
        LUN: 1
            Type: disk
            SCSI ID: IET     00010001
            SCSI SN: beaf11
            Size: 159 MB
            Online: Yes
            Removable media: No
            Backing store type: rdwr
            Backing store path: /dev/vol01/log01
            Backing store flags:
        LUN: 2
            Type: disk
            SCSI ID: IET     00010002
            SCSI SN: beaf12
            Size: 105 MB
            Online: Yes
            Removable media: No
            Backing store type: rdwr
            Backing store path: /var/lib/tgtd/virtualization/virtimage2.img
            Backing store flags:
    Account information:
    ACL information:
        ALL

Note: LUN 0 will appear as a device of type "controller". And also notice that the ACL list is set to ALL. This allows all systems on the local network to access this device.






Step to configure the ISCSI-initiator:


Install ISCSI-initiator
[root@server1 ~]# yum install iscsi-initiator -y


Start the iscsi service
# service iscsid start


Make the service persistent after reboots
[root@server1 ~]# chkconfig iscsid on


Now we can test whether the new iSCSI device is discoverable from client1.example.com:


[root@server1 ~]# iscsiadm -m discovery -t sendtargets -p server1.example.com
192.168.1.112:3260,1 iqn.2011-07.com.example.server1:trial
or
[root@server1 ~]# iscsiadm -m discovery -t sendtargets -p 192.168.1.112
192.168.1.112:3260,1 iqn.2011-07.com.example.server1:trial


Note: 192.168.1.112 is the ip address of your own iscsi target server


To view more information about your iSCSI Target
[root@server1 ~]# iscsiadm -m node -T iqn.2011-07.com.example.server1:trial -p 192.168.1.112
# BEGIN RECORD 2.0-872
node.name = iqn.2011-07.com.example.server1:trial
node.tpgt = 1
node.startup = automatic
iface.hwaddress = <empty>
iface.ipaddress = <empty>
iface.iscsi_ifacename = default
iface.net_ifacename = <empty>
iface.transport_name = tcp
iface.initiatorname = <empty>
node.discovery_address = 192.168.1.112
node.discovery_port = 3260
node.discovery_type = send_targets
node.session.initial_cmdsn = 0
node.session.initial_login_retry_max = 8
node.session.xmit_thread_priority = -20
node.session.cmds_max = 128
node.session.queue_depth = 32
node.session.auth.authmethod = None
node.session.auth.username = <empty>
node.session.auth.password = <empty>
node.session.auth.username_in = <empty>
node.session.auth.password_in = <empty>
node.session.timeo.replacement_timeout = 120
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 30
node.session.err_timeo.tgt_reset_timeout = 30
node.session.err_timeo.host_reset_timeout = 60
node.session.iscsi.FastAbort = Yes
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.session.iscsi.DefaultTime2Retain = 0
node.session.iscsi.DefaultTime2Wait = 2
node.session.iscsi.MaxConnections = 1
node.session.iscsi.MaxOutstandingR2T = 1
node.session.iscsi.ERL = 0
node.conn[0].address = 192.168.1.112
node.conn[0].port = 3260
node.conn[0].startup = manual
node.conn[0].tcp.window_size = 524288
node.conn[0].tcp.type_of_service = 0
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_interval = 5
node.conn[0].timeo.noop_out_timeout = 5
node.conn[0].iscsi.MaxXmitDataSegmentLength = 0
node.conn[0].iscsi.MaxRecvDataSegmentLength = 262144
node.conn[0].iscsi.HeaderDigest = None
node.conn[0].iscsi.IFMarker = No
node.conn[0].iscsi.OFMarker = No
# END RECORD


Log into the iSCSI target
[root@server1 ~]# iscsiadm -m node -T iqn.2011-07.com.example.server1:trial -p 192.168.1.112 -l
Logging in to [iface: default, target: iqn.2011-07.com.example.server1:trial, portal: 192.168.1.112,3260]
Login to [iface: default, target: iqn.2011-07.com.example.server1:trial, portal: 192.168.1.112,3260] successful.


Check the logs for disk partion name is available
[root@server1 ~]# tail -f /var/log/messages
Aug 17 02:03:46 server1 kernel: scsi2 : iSCSI Initiator over TCP/IP
Aug 17 02:03:46 server1 kernel:   Vendor: IET       Model: Controller        Rev: 0001
Aug 17 02:03:46 server1 kernel:   Type:   RAID                               ANSI SCSI revision: 05
Aug 17 02:03:46 server1 kernel: scsi 2:0:0:0: Attached scsi generic sg1 type 12
Aug 17 02:03:46 server1 kernel:   Vendor: IET       Model: VIRTUAL-DISK      Rev: 0001
Aug 17 02:03:46 server1 kernel:   Type:   Direct-Access                      ANSI SCSI revision: 05
Aug 17 02:03:46 server1 kernel: SCSI device sdb: 311296 512-byte hdwr sectors (159 MB)
Aug 17 02:03:46 server1 kernel: sdb: Write Protect is off
Aug 17 02:03:46 server1 kernel: SCSI device sdb: drive cache: write through
Aug 17 02:03:46 server1 kernel: SCSI device sdb: 311296 512-byte hdwr sectors (159 MB)
Aug 17 02:03:46 server1 kernel: sdb: Write Protect is off
Aug 17 02:03:46 server1 kernel: SCSI device sdb: drive cache: write through
Aug 17 02:03:46 server1 kernel:  sdb: unknown partition table
Aug 17 02:03:46 server1 kernel: sd 2:0:0:1: Attached scsi disk sdb
Aug 17 02:03:46 server1 kernel: sd 2:0:0:1: Attached scsi generic sg2 type 0
Aug 17 02:03:46 server1 kernel:   Vendor: IET       Model: VIRTUAL-DISK      Rev: 0001
Aug 17 02:03:46 server1 kernel:   Type:   Direct-Access                      ANSI SCSI revision: 05
Aug 17 02:03:46 server1 kernel: SCSI device sdc: 204800 512-byte hdwr sectors (105 MB)
Aug 17 02:03:46 server1 kernel: sdc: Write Protect is off
Aug 17 02:03:46 server1 kernel: SCSI device sdc: drive cache: write through
Aug 17 02:03:46 server1 kernel: SCSI device sdc: 204800 512-byte hdwr sectors (105 MB)
Aug 17 02:03:46 server1 kernel: sdc: Write Protect is off
Aug 17 02:03:46 server1 kernel: SCSI device sdc: drive cache: write through
Aug 17 02:03:46 server1 kernel:  sdc: unknown partition table
Aug 17 02:03:46 server1 kernel: sd 2:0:0:2: Attached scsi disk sdc
Aug 17 02:03:46 server1 kernel: sd 2:0:0:2: Attached scsi generic sg3 type 0
Aug 17 02:03:46 server1 iscsid: Could not set session1 priority. READ/WRITE throughout and latency could be affected.
Aug 17 02:03:46 server1 iscsid: Connection1:0 to [target: iqn.2011-07.com.example.server1:trial, portal: 192.168.1.112,3260] through [iface: default] is operational now


Note: Now the target is enabled to be accessed upon reboots (persistent) and it's added to a node database in /var/lib/iscsi


Check the partition table
[root@server1 ~]# fdisk -l


Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1           6       48163+  83  Linux
/dev/sda2               7         853     6803527+  83  Linux
/dev/sda3             854         903      401625   83  Linux
/dev/sda4             904        1044     1132582+   5  Extended
/dev/sda5             904         977      594373+  83  Linux
/dev/sda6             978        1002      200781   8e  Linux LVM


Disk /dev/sdb: 159 MB, 159383552 bytes
5 heads, 61 sectors/track, 1020 cylinders
Units = cylinders of 305 * 512 = 156160 bytes


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


Disk /dev/sdc: 104 MB, 104857600 bytes
4 heads, 50 sectors/track, 1024 cylinders
Units = cylinders of 200 * 512 = 102400 bytes


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



Create partition Disk
[root@server1 ~]# fdisk /dev/sdc
p              -->Print partition
n              -->Create new partition
p              -->Primary partition
2              -->partition Number
Enter        -->starting cylinder
+100M    -->size of the partition
p              -->Print partition
w              -->Write and save the partition


Reboot or refresh the kernel partition table by using partx command
[root@server1 ~]# partx -a /dev/sdb


Format Disk
[root@server1 ~]# mkfs.ext3 /dev/sdb2


create directory /iscsidata
[root@server1 ~]#mkdir /iscsidata


mount disk(/dev/sdb) to mount point(/iscsidata)
[root@server1 ~]# mount /dev/sdb2 /iscsidata


check the the filesystem is mounted or not
[root@server1 ~]# df -h


Mount the partition at boot. create a enty in the /etv/fstab file
[root@server1 ~]# vim /etc/fstab
/dev/sdb2 /iscsidata ext3 _netdev 0 0


mount all the partition which is exists in the /etc/fstab
[root@server1 ~]# mount -a


check the the filesystem is mounted or not
[root@server1 ~]# mount | grep iscsi


check the disk
# df -h
Read more...