hot swap a SCSI hd

HOST ID / CHANNEL / SCSI ID/ LUN
# echo “scsi add-single-device 0 0 1 0″ > /proc/scsi/scsi                  // 添加硬盘
# echo “scsi remove-single-device 0 0 1 0″ > /proc/scsi/scsi            // 删除硬盘

Add comment January 5, 2008

bonding

1.
# cp /etc/sysconfig/network-scripts/ifcfg-eth0 ifcfg-bond0
2.
# cat ifcfg-bond0
DEVICE=bond0      <= change DEVICE=bond0
BOOTPROTO=static
IPADDR=172.31.0.13
NETMASK=255.255.252.0
BROADCAST=172.31.3.254
ONBOOT=yes
TYPE=Ethernet
3.
# cat ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
# cat ifcfg-eth1
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
4.
# vi /etc/modules.conf    <== add these two lines
alias bond0 bonding
options bond0 miimon=100 mode=1              <==mode 1 fault tolerance , mode 0 = load balancing
5.
# vi /etc/rc.d/rc.local     <== add these two lines
ifenslave bond0 eth0 eth1
route add -net 172.31.3.254 netmask 255.255.255.0 bond0
========================================
cat /proc/net/bonding/bond0

Add comment January 5, 2008

ntp

tinker panic 0
restrict default noquery notrust nomodify notrap
# server 127.127.1.0
# fudge  127.127.1.0 stratum 10   # LCL is unsynchronized
restrict 192.168.1.0 mask 255.255.255.0 nomodify
restrict 127.0.0.1
# Hong Kong Observatory
server stdtime.gov.hk prefer
restrict stdtime.gov.hk noquery
server asia.pool.ntp.org
restrict asia.pool.ntp.org noquery
# France Observatory
server ntp.obspm.fr
restrict ntp.obspm.fr noquery
# Swiss Federal Office of Metrology and Accreditation)
server ntp.metas.ch
restrict ntp.metas.ch noquery
# USNO, Stratum 1
# server tick.ucla.edu
# restrict tick.ucla.edu noquery nomodify
# server ntp.cuhk.edu.hk
# restrict ntp.cuhk.edu.hk noquery nomodify
# below are stratum 1 servers
# server tick.usno.navy.mil
# restrict tick.usno.navy.mil noquery nomodify
# server time-b.nist.gov
# restrict time-b.nist.gov noquery nomodify
multicastclient
# keys /etc/ntp.keys
# requestkey 15
# controlkey 15
# trustedkey 3 4 5 6 14
driftfile /var/ntp/ntp.drift
logfile  /var/log/ntp
statsdir /var/log/ntpstats

Add comment January 5, 2008

basic lesson

if [ -e abc.log ]; then
    echo “abc.log exist”
fi
-e check exist
-d check directory exist

Add comment January 5, 2008

sendmail and mailx

cat ${OUT_FILE} | /usr/sbin/sendmail -f “${FRM_MAIL}” ${TO_MAIL}
FRM_MAIL=sender
TO_MAIL=recipient
OUT_FILE=content    <– subject is inside the content eg. “Subject: Testing”
/usr/bin/mailx -r ${FRM_MAIL} -s “${MSG}” ${TO_MAIL} < ${OUT_FILE}
FRM_MAIL=sender
TO_MAIL=recipient
MSG=subject
OUTFILE_=content

Add comment January 5, 2008

veritas volume manager – add/remove disk

Remove the disk
Step 1
vxdiskadm
4
Step 2
vxdb rmdisk dbdg09
Step 3
format
“select the disk number”
type
format
save
quit

Add comment January 5, 2008

ifconfig aliases

add addition ip on the same netcard

# ifconfig hme0:1 202.6.192.27 netmask 255.255.255.0 up

Add comment January 5, 2008

how to start nfs service

nfs server side
eg. /nfs-server
 
#/sbin/rc2.d/K35nfs start  <– start service
#mountd
#nfsd -t 8 -u 8   <– start nfs port
#rpcinfo -p    <– show the shared port
#showmount -e  <– show export list
 
client side
#mount -t nfs <server-ip>:/nfs-server /mnt/nfs-server
 
PS. portmap is required to start

Add comment January 5, 2008

Next Posts


Categories

  • Computer News

  • Feeds