Sundaramurthy Blog

July 3, 2010

dmidecode (Linux)

Filed under: Linux — sundar5 @ 11:25 pm

dmidecode:

dmidecode can give you a quick   hardware configuration info  such as

bios
system
baseboard
chassis
processor
memory
cache
connector
slot

etc….

DMI TYPE is used individually or in a comma separated list provide you with targeted information

Type Information
0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply

Note: Either you can use type number or information string

Example : Processor

dmidecode -t Processor
dmidecode -t 4

1. Without argument

root# dmidecode -t
dmidecode: option requires an argument — t
Type number or keyword expected
Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
cache
connector
slot

2. processor info

root# dmidecode -t processor
# dmidecode 2.9
SMBIOS 2.5 present.

Handle 0x0004, DMI type 4, 40 bytes
Processor Information
Socket Designation: CPU 0
Type: Central Processor
Family: Xeon MP
Manufacturer: Intel
ID: 7A 06 01 00 FF FB EB BF

3. processor info using type#(4)

root# dmidecode -t 4
# dmidecode 2.9
SMBIOS 2.5 present.

Handle 0x0004, DMI type 4, 40 bytes
Processor Information
Socket Designation: CPU 0
Type: Central Processor
Family: Xeon MP
Manufacturer: Intel
ID: 7A 06 01 00 FF FB EB BF
Signature: Type 0, Family 6, Model 23, Stepping 10
Flags:
….
…..
Version: Intel(R) Xeon(R) CPU           L5420  @ 2.50GHz
Voltage: 1.2 V
External Clock: 1333 MHz
Max Speed: 3400 MHz
Current Speed: 2500 MHz
Status: Populated, Enabled
Upgrade: Socket LGA771
L1 Cache Handle: 0x0005
L2 Cache Handle: 0x0006
L3 Cache Handle: 0x0007
Serial Number: To Be Filled By O.E.M.
Asset Tag: To Be Filled By O.E.M.
Part Number: To Be Filled By O.E.M.
Core Count: 4
Core Enabled: 4
Thread Count: 4
Characteristics:
64-bit capable

4. Chassis info

root# dmidecode -t 3

# dmidecode 2.9
SMBIOS 2.5 present.

Handle 0x0003, DMI type 3, 21 bytes
Chassis Information
Manufacturer: HP
Type: Rack Mount Chassis
Lock: Not Present
Version: 1.0
Serial Number: MXQ91800WX
Asset Tag: 529993
Boot-up State: Safe
Power Supply State: Safe
Thermal State: Safe
Security Status: None
OEM Information: 0x00000000
Height: Unspecified
Number Of Power Cords: 1
Contained Elements: 0

5.  Memory info

root# dmidecode -t Memory
# dmidecode 2.9
SMBIOS 2.5 present.

Handle 0x002C, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: Multi-bit ECC
Maximum Capacity: 16 GB
Error Information Handle: Not Provided
Number Of Devices: 6

Handle 0x002E, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x002C
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 4096 MB
Form Factor: DIMM
Set: None
Locator: DIMM1 A
Bank Locator: BANK1
Type: DDR2
Type Detail: Other
Speed: 667 MHz (1.5 ns)
Manufacturer: aD00000000000000
Serial Number: 00006018
Asset Tag:
Part Number: 48594D503135315037324350342D59352020

…..

biosdecode:

biosdecode is a command line utility to parses the BIOS memory and prints information about all structures

root # biosdecode
# biosdecode 2.9
BIOS32 Service Directory present.
Revision: 0
Calling Interface Address: 0x000F0010
PCI Interrupt Routing 1.0 present.
Router ID: 00:1f.0
Exclusive IRQs: None

Slot Entry 1: ID 00:00, on-board
Slot Entry 2: ID 00:02, on-board
Slot Entry 3: ID 00:03, on-board
Slot Entry 4: ID 00:04, on-board
Slot Entry 5: ID 00:05, on-board
Slot Entry 6: ID 00:06, on-board
…..
Slot Entry 14: ID 05:00, on-board
Slot Entry 15: ID 06:00, on-board
Slot Entry 16: ID 07:00, slot number 2
Slot Entry 17: ID 08:04, slot number 1
Slot Entry 18: ID 01:00, slot number 4
PNP BIOS 1.0 present.
Event Notification: Not Supported
Real Mode 16-bit Code Address: F000:6DE2
….
16-bit Protected Mode Data Address: 0x000F0000
ACPI 2.0 present.
OEM Identifier: HP
RSD Table 32-bit Address: 0xDFFA0000
XSD Table 64-bit Address: 0x00000000DFFA0100
SMBIOS 2.5 present.
Structure Table Length: 3061 bytes
Structure Table Address: 0x000FC690
Number Of Structures: 65
Maximum Structure Size: 222 bytes

Type Information
0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
Advertisements

March 20, 2010

How to clean-up linux /var directory

Filed under: Linux — sundar5 @ 1:09 am

steps:

1. Take copy of the /etc/logrotate.d/syslog file.

# cp -p /etc/logrotate.d/syslog  syslog_old

2.  Insert /var/log/all into syslog file

/var/log/messages /var/log/all /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}

/var/log/secure {
create 0600 root
}
3. run following command as root

#/usr/sbin/logrotate -f /etc/logrotate.d/syslog

February 24, 2010

System reboot time

Filed under: Command,Linux — sundar5 @ 12:20 am

[oracle@$ who -b
system boot  Nov 29 11:39

January 22, 2010

Multipath/EMC power path Setup (Redhat Linux)

Filed under: Linux — sundar5 @ 12:06 am

Multipath is used between host(s) and Storage array to avoid single point of faliure
at I/O channels. It also give I/O balance between the path.
Oracle Automatic Storage Management (ASM) on NetApp storage and have a better I/O
performance, you should to build ASM disks on either iSCSI or FCP devices on
NFS filesystem.  In Linux it is called native multipath (dm-multipath).

Multipath requires two packages:

– device-mapper
– multipath-tool

Note: device-mapper package is always installed by default

Install and configure Linux multipath:

1. Download the latest package from https://rhn.redhat.com and
install it on all hosts

# rpm -Uvh device-mapper-1.02.21-1.el4

2. Check the multipath rpm installation

# rpm -qa |grep mapper
device-mapper-1.02.21-1.el4
device-mapper-multipath-debuginfo-0.4.5-27.el4_6.3.0.1
device-mapper-multipath-0.4.5-27.el4_6.3.0.1

3. Load the dm_multipath kernel module

# modprobe dm_multipath

4. edit the multipath.conf file under /etc directory.

I. Comment-out the following line from multipath.conf file.

# devnode_blacklist { devnode “*” }

II. If you want Exclude internal drives (local drives), use the bellow command

example : devnode_blacklist {
devnode “^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*”
devnode “^hd[a-z]”

III. Create a device-specific section at the end of the file for the storage system as follow:

devices {
device {
vendor “NETAPP”
product “LUN”
path_grouping_policy multibus
features “1 queue_if_no_path”
path_checker readsector0
failback immediate
}
}

5.Add the multipath service to the boot sequence

#chkconfig –add multipathd
#chkconfig –list multipathd
#chkconfig multipathd on

6. Start the multipath daemon

#/etc/init.d/multipathd start

7.  Check multipath command.

# multipath -ll

mpath1 (360060160ae888a00e8b5892f190bdd33)
[size=146 GB][features=”1 queue_if_no_path”][hwhandler=”1 emc”]
\_ round-robin 0 [prio=4][active]
\_ 5:0:2:2   sdabd 133:688  [active][ready]
\_ 6:0:2:2   sdaob 66:1200  [active][ready]
\_ 1:0:2:2   sdbh  67:176   [active][ready]
\_ 2:0:2:2   sdof  128:432  [active][ready]
\_ round-robin 0 [enabled]
\_ 5:0:3:2   sdacf 135:624  [active][ready]
\_ 6:0:3:2   sdapd 68:1136  [active][ready]
\_ 1:0:3:2   sdcj  69:112   [active][ready]
\_ 2:0:3:2   sdph  130:368  [active][ready]

mpath2 (3600601603fb99c00fe8278261b0bdd33)
[size=146 GB][features=”1 queue_if_no_path”][hwhandler=”1 emc”]
\_ round-robin 0 [prio=4][active]
\_ 5:0:5:13  sdaeu 67:928   [active][ready]
\_ 6:0:5:13  sdars 128:1184 [active][ready]
\_ 1:0:5:13  sdey  129:160  [active][ready]
\_ 2:0:5:13  sdrw  134:416  [active][ready]
\_ round-robin 0 [enabled]
\_ 5:0:4:13  sdads 65:992   [active][ready]

II. Disable multipath

1. Take a copy of /etc/multipath.conf

cp /etc/multipath.conf /etc/multipath.conf_20080710

2. root user: Edit /etc/multipath.conf file and commentout all the entries in the file as root user

3. root user: Make sure the below entry in the multipath.conf file

blocklist {
devnode “*”
}

4. Take out the output of below command

sudo multipath -ll > /tmp/mpio_nodename.lst

5. disbale multipath process by using following command as root user.

# dmsetup ls   — displays all the device mapper
# /etc/init.d/multipathd stop
# /sbin/chkconfig multipathd off
# /sbin/dmsetup remove_all
# /sbin/rpm -e `rpm -qa | grep multipath`

6. Reboot the server

III. power path Installation

1. Download the PowerPath archive from

http://Powerlink.EMC.com > Support > Software Downloads and Licensing > Downloads D-R > PowerPath for Linux

2. # tar -xzf EMCpower.LINUX-5.3.1.00.00-111.tar.gz

3. # rpm -I EMCpower.LINUX-5.3.1.00.00-111.rhel5.x86_64.rpm

4. # rpm -ivh EMCpower.LINUX-5.3.1.00.00-111.rhel5.x86_64.rpm

Preparing…                ########################################### [100%]
1:EMCpower.LINUX         ########################################### [100%]
All trademarks used herein are the property of their respective owners.
NOTE:License registration is not required to manage the CLARiiON AX series array.

5. Apply license on EMC Powerpath (Registration)

# emcpreg -install

===========   EMC PowerPath Registration ===========
Do you have a new registration key or keys to enter?[n] y

Enter the registration keys(s) for your product(s),
one per line, pressing Enter after each key.
After typing all keys, press Enter again.
Key (Enter if done): “enter emc-powerpath-license-key

–> Enter the 24-character alphanumeric sequence found on the
License Key Card delivered with the PowerPath media kit

1 key(s) successfully added.
Key successfully installed.

1 key(s) successfully registered.

6.       /etc/init.d/PowerPath start

Starting PowerPath: done

7.      # rpm -qa |grep EMC

EMCpower.LINUX-5.3.1.00.00-111

8. #reboot
9. # Confirm devices /sbin/powermt display dev=all


January 15, 2010

Liunx command

Filed under: Linux — sundar5 @ 7:29 am

1. Linux version.

cat /etc/redhat-release

Red Hat Enterprise Linux AS release 4 (Nahant Update 6)

2. Processors related statistics

Display 2 reports of statistics for  all  processors  at  three second intervals

$ mpstat  -P  ALL   3     2

Linux 2.6.9-67.ELlargesmp (db01.yda.abccompany.com)  07/01/2010

08:31:49 AM  CPU   %user   %nice %system %iowait    %irq   %soft   %idle    intr/s
08:31:52 AM  all   10.31    0.00    4.82    5.38    0.09    1.39   78.01  21015.41
08:31:52 AM    0    6.85    0.00    3.08    0.34    0.00    0.00   89.73     11.30
08:31:52 AM    1   16.44    0.00    5.14    0.34    0.00    0.00   78.77      0.00
08:31:52 AM    2   13.01    0.00    4.45    0.00    0.00    0.00   82.88      0.00
08:31:52 AM    3   13.70    0.00    2.74    0.00    0.00    0.34   83.22   1024.66
08:31:52 AM    4   14.04    0.00    4.11   23.63    0.00    2.05   56.16    190.07
08:31:52 AM    5    3.77    0.00    1.37    0.00    0.00    0.34   95.21      0.00
08:31:52 AM    6    8.90    0.00    1.37    0.00    0.00    0.34   89.73      0.00
08:31:52 AM    7    0.34    0.00    0.68    0.00    0.00    0.34   99.32     62.67

08:31:52 AM  CPU   %user   %nice %system %iowait    %irq   %soft   %idle    intr/s
08:31:55 AM  all   10.31    0.00    5.00    5.78    0.06    1.44   77.41  20168.24
08:31:55 AM    0    1.35    0.00    2.03    0.34    0.00    0.34   95.95      6.42
08:31:55 AM    1   12.16    0.00    4.39    0.00    0.00    0.00   82.77      0.00
08:31:55 AM    2   20.27    0.00    8.11    0.00    0.00    0.00   69.93      0.00
08:31:55 AM    3    5.07    0.00    2.36   22.97    0.00    0.68   66.89     72.97
08:31:55 AM    4    5.07    0.00    1.69    0.00    0.00    0.00   93.24   1013.51
08:31:55 AM    5    0.34    0.00    1.01    0.00    0.00    0.00   97.97      0.00
08:31:55 AM    6   22.64    0.00    3.38    0.00    0.00    0.00   72.30      0.00
08:31:55 AM    7   30.74    0.00   11.82    1.01    1.01   14.19   39.19  15242.23

Average:     CPU   %user   %nice %system %iowait    %irq   %soft   %idle    intr/s
Average:     all   10.31    0.00    4.91    5.58    0.08    1.42   77.71  20588.95
Average:       0    4.08    0.00    2.55    0.34    0.00    0.17   92.86      8.84
Average:       1   14.29    0.00    4.76    0.17    0.00    0.00   80.78      0.00
Average:       2   16.67    0.00    6.29    0.00    0.00    0.00   76.36      0.00
Average:       3    9.35    0.00    2.55   11.56    0.00    0.51   75.00    545.58
Average:       4    9.52    0.00    2.89   11.73    0.00    1.02   74.83    604.59
Average:       5    2.04    0.00    1.19    0.00    0.00    0.17   96.60      0.00
Average:       6   15.82    0.00    2.38    0.00    0.00    0.17   80.95      0.00
Average:       7   15.65    0.00    6.29    0.51    0.51    7.31   69.05   7704.08
Average:       8   16.67    0.00    6.80    0.85    0.51    7.31   66.67   7902.21

Display  four reports of global statistics among all processors at three second intervals.

$ mpstat  3   4

Linux 2.6.9-67.ELlargesmp (db01.yda.abccompany.com)  07/01/2010

08:30:14 AM  CPU   %user   %nice %system %iowait    %irq   %soft   %idle    intr/s
08:30:17 AM  all   11.63    0.00    7.27    5.41    0.11    1.30   74.28  16517.97
08:30:20 AM  all   10.93    0.00    4.98    5.80    0.06    1.20   77.03  15067.91
08:30:23 AM  all    8.81    0.00    4.36    5.73    0.06    1.22   79.82  14998.99
08:30:26 AM  all    7.64    0.00    3.55    5.58    0.09    1.16   81.99  14989.04
Average:     all    9.75    0.00    5.04    5.63    0.08    1.22   78.28  15393.56
CPU
Processor number. The keyword all indicates that statistics  are calculated as averages among all processors

%user

user level (application) the percentage of CPU utilization that occurred

%nice

the percentage of CPU utilization. user level with nice priority            .

%system

Show  the percentage of CPU utilization that occurred while executing at the system level (kernel).

%iowait

Show  the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.

%irq

Show the percentage of time spent by the CPU or CPUs to  service interrupts.

%soft

Show  the percentage of time spent by the CPU or CPUs to service softirqs.

%idle

Show the percentage of time that the CPU or CPUs were  idle  and the system did not have an outstanding disk I/O request.

intr/s

Show  the  total number of interrupts received per second by the  CPU

Blog at WordPress.com.