Posts

Showing posts from 2009

Linux Disable /var Access Time Updates ( noatime )

I've configured and mounted /var for squid caching and other purposes under Linux. I've noticed that the Linux file system keeps records of when files are created, updated, and accessed. My /var is exclusively used for caching purpose and I do not want to waste disk I/O while updating last-time-read attribute during reads and writes to files. How do I disable access time updates for /var partition? You can mount file systems with the noatime option. It will prevent inode access times from being updated. Please note that use noatime only when file update times are not critical. Backup client software also use file last update time to sync with backup server. However, the following type of servers may work without problem: a] Squid caching file b] News server c] Web servers etc. /etc/fstab File Edit /etc/fstab file and update it as follows: /dev/sdXY /mount-point ext3 defaults,noatime 1 2 OR /dev/md1 /var ext3 defaults,noatime 1 2 OR just remount the same from command mount LABEL

How to find WWN & WWPN numbers

Both Commands can give you WWN & WWPN nubers systool -c fc_host -v -----> Give Server FC WWN & WWPN numbers systool -c fc_transport -v --------> Give Server & Storage FC WWN & WWPN numbers cat /sys/class/scsi_host/host7/lpfc_drvr_version Emulex LightPulse Fibre Channel SCSI driver 8.2.0.22 cat /sys/class/scsi_host/host7/info Emulex LPe11000-S 4Gb 1-port PCIe FC HBA on PCI bus 05 device 00 irq 177

how to setup OpenLDAP log file

man slapd.conf ... loglevel Specify the level at which debugging statements and operation statistics should be syslogged (currently logged to the syslogd(8) LOG_LOCAL4 facility). Log levels are additive, and available levels are: 1 trace function calls 2 debug packet handling 4 heavy trace debugging 8 connection management 16 print out packets sent and received 32 search filter processing 64 configuration file processing 128 access control list processing 256 stats log connections/operations/results 512 stats log entries sent 1024 print communication with shell

unable to install rpm through YUM where YUM server on remote FTP.

[root@node11 ~]# yum install openldap* Loaded plugins: rhnplugin, security This system is not registered with RHN. RHN support will be disabled. ftp://node10/repodata/repomd.xml: [Errno 4] IOError: [Errno ftp error] 550 Failed to change directory. Trying other mirror. Setting up Install Process Package openldap-2.3.43-3.el5.i386 already installed and latest version Resolving Dependencies There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them. The program yum-complete-transaction is found in the yum-utils package. --> Running transaction check ---> Package openldap-clients.i386 0:2.3.43-3.el5 set to be updated ---> Package openldap-devel.i386 0:2.3.43-3.el5 set to be updated --> Processing Dependency: cyrus-sasl-devel >= 2.1 for package: openldap-devel ---> Package openldap-servers.i386 0:2.3.43-3.el5 set to be updated ftp://node10/repodata/filelists.xml.gz: [Errno 4] IOError: [Errno ftp error] 550 Failed t

0.0.0.0:* vs :::*

tcp 0 0 0.0.0.0:389 0.0.0.0:* LISTEN 3717/slapd tcp 0 0 :::389 :::* LISTEN 3717/slapd 0.0.0.0:* means support ipv4 :::* means support ipv6

SYSrq details & Magic Commands

http://en.wikipedia.org/wiki/Magic_SysRq_key

ext3 tuning

For the most part, you should plan on shutting down a system before tuning it (after making backups!). Tuning doesn't take too long and is a lot simpler to do if the system is offline. First off, you should check out your existing filesystem settings with: # tune2fs -l /dev/hdXY 1) Directory indexing - Which helps ext3 deal with any directories that have lots of files. (See the Gentoo Forum link for explanations of why.) # tune2fs -O dir_index /dev/hdXY # e2fsck -D /dev/hdXY The first command changes the ext3 system to use directory indexing for all new directories, the second command updates all existing directories. 2) Journal mode # tune2fs -O has_journal -o journal_data /dev/hdXY I prefer full journaled mode. The "-O has_journal" should be unnecessary (all ext3 file systems have journals after all) but probably ensures that things work if you accidently run it on a ext2 filesystem. 3) Journal size This requires poking around a bit to find out what your current journal

Unix bc Command Line Calculator in Batch Mode

You may be using bc command in command line for calculations. It can also be used for batch mode calculations as explained below. 1. Calculation using Single command $ echo "4+10" | bc 14 2. Calculation using Multiple commands $ echo "obase=15;5+9" | bc E 3. Using previous results in the current operation In the following example, “last” represents the result of the previous calculation. echo "1+3;last/2" | bc 4 2 In the following example, . (dot) represents the result of the previous calculation. $ echo "1+3;./2" | bc 4 2 4. Another way of executing bc calculation bc <<< 4+2 6

How ARP works?

How ARP works * When IP is requested to send a datagram to another IP address , it first looks in the ARP cache to find the corresponding MAC address . If there is no entry it then attempts to look for it using ARP . * In order to do this ARP sends an ARP request datagram to all LAN cards using a broadcast address .

Netdump problem in RHEL3

NetdumpClient# /etc/init.d/netdump restart disabling netdump rmmod: module netconsole is not loaded [FAILED] : cannot arp 10.0.0.1(Netdump Server IP) Usage: service netdump {start|stop|status|restart|condrestart|propagate} : cannot find 10.0.0.1 in arp cache Usage: service netdump {start|stop|status|restart|condrestart|propagate} initializing netdump Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters. You may find more information in syslog or the output from dmesg /lib/modules/2.4.21-4.ELsmp/kernel/drivers/net/netconsole.o: init_module: Operation not permitted /lib/modules/2.4.21-4.ELsmp/kernel/drivers/net/netconsole.o: insmod /lib/modules/2.4.21-4.ELsmp/kernel/drivers/net/netconsole.o failed /lib/modules/2.4.21-4.ELsmp/kernel/drivers/net/netconsole.o: insmod netconsole failed [FAILED] NetdumpClient# modinfo n

Process Priority

Process priority is -20 to 19 where -20 is highest… Normal user can change the process priority from 0 to 19. renice -10 -p "process id" Process ID priority will change after some time due scheduling policy The scheduling policy is also based on ranking processes according to their priority. Complicated algorithms are sometimes used to derive the current priority of a process, but the end result is the same: each process is associated with a value that denotes how appropriate it is to be assigned to the CPU. In Linux, process priority is dynamic. The scheduler keeps track of what processes are doing and adjusts their priorities periodically; in this way, processes that have been denied the use of the CPU for a long time interval are boosted by dynamically increasing their priority. Correspondingly, processes running for a long time are penalized by decreasing their priority. When speaking about scheduling, processes are traditionally classified as "I/O-bound&q

Process Details

Different commands to get the details of current processes The following command can give you detailed information on every running process in your system, sorted by percentage cpu, with no headers ("h" option). ps h -e -o %cpu,pid,user,state,start,time,etime,%cpu,%mem,cmd|sort -rn If you want to choose a particular process, use the -p option. ps -p "Process ID Number" -o %cpu,pid,user,state,start,time,etime,%cpu,%mem,cmd For more details like thread info etc see "man ps"

Compress & Uncompress

To compress a file gzip 10thosand.txt To get compression details gzip -l 10thosand.txt.gz compressed uncompressed ratio uncompressed_name 22634 48894 53.8% 10thosand.txt To uncompress gunzip 10thosand.txt.gz

Open file descriptor Problem

Use ulimit -a & check the open file system values cat /proc/sys/fs/file-nr 1344 0 101965(Values depend on apllication) so please increase the value