Wednesday, October 29, 2008

disabling bell beep sound on linux console

Sometimes its annoying to hear a beep sound everytime you hit on tab button for completion on linux console. Here is the quickway how to disable that beep sound.
All you have to do is add the following line in /etc/inputrc file or uncomment it if it presents.

set bell-style none

the following image is the default inputrc file on centos system. You can uncomment the line which says "set bell-style none" for disabling tab completion beep sound.

Monday, October 27, 2008

resolving latency problems on linux with latencytop utility

Finding out what is causing unresponsive behaviour, audio delays or stalls on your linux machines can be a hard task.
Latencytop utility gives information where latency is occured to diagnose problem.

Here is an example how to use latencytop on fedora core 9 distribution.

yum install latencytop


By default kernel does not enable latency statistics reporting.You have to enable it by hand.


echo 1 > /proc/sys/kernel/latencytop

this command enables it. disabling it is easy by echo 0 > /proc/sys/kernel/latencytop
latencytop uses the statistics from proc file system. statistics is in /proc/latency_stats file.

here is a screenshot where it shows latency caused disk io on ext3 filesystem and with which pid caused it.





note: if your linux system does not have /proc/latency_stats file. it's either is disabled when kernel is compiled or your kernel does not have latency stats support. In that case you have to patch your kernel an recompile it.
for patch see http://www.latencytop.org/download.php

Monday, October 20, 2008

extending laptop battery lifetime with Intel's Powertop utility

Powertop is designed to pinpoint resources (device drivers, software,etc..) that wakes up idle cpu and lets you extend battery life time by fixing or stopping the application. It's useful for laptop users and also for datacenters who wants to save power consumption.

Here is a sample output disk I/O which showing by powetop:

Saturday, October 18, 2008

display system statistics with systat on bsd systems

systat utility displays system statistics on bsd systems (freebsd, dragonfly, etc.).
system statistics includes swap, network interface, disk I/O , virtual memory (vmstat), network utilitzation (mbuf), TCP/IP statistics, network connections (netstat), icmp.

here is some systat options:
pigs,icmp,ip,tcp,ifstat,iostat,swap,mbufs,vmstat,netstat.
following is sample output for "systat -iostat" command:

Friday, August 29, 2008

editing text files with more

You can edit documents when using more. if you press "v" , your default editor will be started on current line. After saving and exiting your editor, you can continue using more.
Default editor is chosen by VISUAL and EDITOR variables. VISUAL environment overrides EDITOR variable.

Saturday, July 26, 2008

block I/O debugging in Linux

block_dump option enables you to see all read/write and block dirtying operations on files. It's default value is 0. Setting value to 1 enables block I/O debugging.


echo "1" > /proc/sys/vm/block_dump

You can see the log via dmesg, here is a sample output.



to set if off:

echo "0" > /proc/sys/vm/block_dump

Saturday, July 19, 2008

Want to see which memory bank is in use on your system?

System Management BIOS (SMBIOS) pecification reports information of your hardware. In short terms, it tells you what your system bios detects and supports.

In Linux, you can use dmidecode for accessing smbios information. For example, if you like to see which memory banks is in use and what the ram module sizes, you simply call dmidecode with memory parameter.

# dmidecode -t memory

Here is the output on my system, If you look sample output below, you will see total memory supported by your system and max memory module size which can be installed. Also which banks are installed and memory module details like size and speed.


# dmidecode 2.9
SMBIOS 2.4 present.

Handle 0x0005, DMI type 5, 24 bytes
Memory Controller Information
Error Detecting Method: 8-bit Parity
Error Correcting Capabilities:
None
Supported Interleave: One-way Interleave
Current Interleave: One-way Interleave
Maximum Memory Module Size: 1024 MB
Maximum Total Memory Size: 4096 MB
Supported Speeds:
Other
Supported Memory Types:
Other
Memory Module Voltage: 5.0 V
Associated Memory Slots: 4
0x0006
0x0007
0x0008
0x0009
Enabled Error Correcting Capabilities:
None

Handle 0x0006, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: A0
Bank Connections: 1
Current Speed: Unknown
Type: DIMM SDRAM
Installed Size: 1024 MB (Single-bank Connection)
Enabled Size: 1024 MB (Single-bank Connection)
Error Status: OK

Handle 0x0007, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: A1
Bank Connections: 2
Current Speed: Unknown
Type: Unknown
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK

Handle 0x0008, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: A2
Bank Connections: 3
Current Speed: Unknown
Type: Unknown
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK

Handle 0x0009, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: A3
Bank Connections: 4
Current Speed: Unknown
Type: Unknown
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK

Handle 0x001B, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 4 GB
Error Information Handle: Not Provided
Number Of Devices: 4

Handle 0x001C, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x001B
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 1024 MB
Form Factor: DIMM
Set: None
Locator: A0
Bank Locator: Bank0/1
Type: Unknown
Type Detail: None
Speed: 667 MHz (1.5 ns)
Manufacturer: None
Serial Number: None
Asset Tag: None
Part Number: None

Handle 0x001D, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x001B
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: A1
Bank Locator: Bank2/3
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: None
Serial Number: None
Asset Tag: None
Part Number: None

Handle 0x001E, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x001B
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: A2
Bank Locator: Bank4/5
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: None
Serial Number: None
Asset Tag: None
Part Number: None

Handle 0x001F, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x001B
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: A3
Bank Locator: Bank6/7
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: None
Serial Number: None
Asset Tag: None
Part Number: None

dmidecode also gives you information about your system's cache, bios and cpu.
Here is a sample output for processor:

# dmidecode -t processor

# dmidecode 2.9
SMBIOS 2.4 present.

Handle 0x0004, DMI type 4, 35 bytes
Processor Information
Socket Designation: Socket 775
Type: Central Processor
Family: Other
Manufacturer: Intel
ID: F6 06 00 00 FF FB EB BF
Version: Intel(R) Core(TM)2 CPU 630
Voltage: 1.3 V
External Clock: 266 MHz
Max Speed: 4000 MHz
Current Speed: 1866 MHz
Status: Populated, Enabled
Upgrade: Socket 478
L1 Cache Handle: 0x000A
L2 Cache Handle: 0x000B
L3 Cache Handle: Not Provided
Serial Number:
Asset Tag:
Part Number:

information about your system cache
# dmidecode -t cache

# dmidecode 2.9
SMBIOS 2.4 present.

Handle 0x000A, DMI type 7, 19 bytes
Cache Information
Socket Designation: Internal Cache
Configuration: Enabled, Not Socketed, Level 1
Operational Mode: Write Back
Location: Internal
Installed Size: 64 KB
Maximum Size: 64 KB
Supported SRAM Types:
Synchronous
Installed SRAM Type: Synchronous
Speed: Unknown
Error Correction Type: Unknown
System Type: Unknown
Associativity: Unknown

Handle 0x000B, DMI type 7, 19 bytes
Cache Information
Socket Designation: External Cache
Configuration: Enabled, Not Socketed, Level 2
Operational Mode: Write Back
Location: Internal
Installed Size: 2048 KB
Maximum Size: 1024 KB
Supported SRAM Types:
Synchronous
Installed SRAM Type: Synchronous
Speed: Unknown
Error Correction Type: Unknown
System Type: Unknown
Associativity: Unknown


# dmidecode -t bios

bios information includes vendor of your bios and it's version.Useful, to see if you are using and old bios and needing and bios update. Also, which devices are supported and which ones can be use for booting up your system.


Read more!

# dmidecode 2.9
SMBIOS 2.4 present.

Handle 0x0000, DMI type 0, 20 bytes
BIOS Information
Vendor: Award Software International, Inc.
Version: F6
Release Date: 05/28/2007
Address: 0xE0000
Runtime Size: 128 kB
ROM Size: 512 kB
Characteristics:
PCI is supported
PNP is supported
APM is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
EDD is supported
5.25"/360 KB floppy services are supported (int 13h)
5.25"/1.2 MB floppy services are supported (int 13h)
3.5"/720 KB floppy services are supported (int 13h)
3.5"/2.88 MB floppy services are supported (int 13h)
Print screen service is supported (int 5h)
8042 keyboard services are supported (int 9h)
Serial services are supported (int 14h)
Printer services are supported (int 17h)
CGA/mono video services are supported (int 10h)
ACPI is supported
USB legacy is supported
LS-120 boot is supported
ATAPI Zip drive boot is supported
BIOS boot specification is supported

Handle 0x001A, DMI type 13, 22 bytes
BIOS Language Information
Installable Languages: 3
n|US|iso8859-1
n|US|iso8859-1
r|CA|iso8859-1
Currently Installed Language: n|US|iso8859-1