2008年7月28日 星期一

linux driver command

lsmod 
顯示目前已經載入的模組清單

insmod 
load module into kernel
ex: insmod hello.ko

rmmod:
remove module

modprobe:
like insmod,  but also install dependent modules
(the module dependency is stored in /lib/modules/x.y.z/modules.dep)

modprobe -r:
remove module

modinfo:
show module info

linux kernel version

red hat enterprise linux 4 update 4
core_2.6.9-42.EL_i686  &  core_2.6.9-42.ELsmp_i686,  core_2.6.9-42.ELsmp_x86_64,  core_2.6.9-42.EL_x86_64

red hat enterprise linux 5 update 1
core_2.6.18-53.el5_i686  &  core_2.6.18-53.el5_x86_64

red hat enterprise linux 5 update 2
core_2.6.18-92.el5_i686  &  core_2.6.18-92.el5_x86_64

suse linux enterprise server 9

core_2.6.5-7.244-smp_x86_64


suse linux enterprise server 10 

core_2.6.16.21-0.8-smp_i686  & core_2.6.16.21-0.8-smp_x86_64


suse linux enterprise server 10 sp1

core_2.6.16.46-0.12-smp_x86_64  


suse linux enterprise server 10 sp2

core_2.6.16.60-0.21-default_i686   ,core_2.6.16.60-0.21-default_x86_64

2008年7月25日 星期五

LVM

(1) 實體磁碟 --> PV( physical volume)
1. change id to 8e
ex:
   (a) fdisk  /dev/hda
   (b) p
         show information of hda
   (c)  t -->  1 --> 8e
        modify partition 1 's id to 8e
   (d) w
         alter partition table
   (e) partprobe
         let kernel read newest partition table

2. create pv  
   (a)pvscan:
        show information of pv
   (b)pvcreate 

2008年6月4日 星期三

x11

設定開機進入X11
edit /etc/inittab
id:3:initdefault:

設定開機進入文字介面:
edit /etc/inittab
id:5:initdefault:

x11 problem:
method 1:
edit /etc/X11/xorg.conf
defaultdepth =8

2008年6月3日 星期二

iscsi-initiator-utils

start:
/etc/init.d/iscsi start

discovery lun
iscsiadm -m discovery -t sendtargets -p 192.168.5.122
192.168.5.122 is lun's ip

/etc/init.d/iscsi restart
connect to the lun 192.168.5.122,  there is a new disk , sdd( use fdisk -l to show)

Format & mount
fdisk /dev/sdd
mke2fs -j -m 0 -O dir_index /dev/sdd1
mkdir /mnt/iscsi
mount /dev/sdd1 /mnt/iscsi

2008年6月2日 星期一

yum

設定search path

/etc/yum.conf:
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
bsoletes=1

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
#[base]
#name=Red Hat Linux $releasever - $basearch - Base
#baseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/$releasever/$basearch/

#[updates]
#name=Red Hat Linux $releasever - Updates
#baseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/updates/$releasever/

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el4/en/i386/dag/
gpgcheck=1
enabled=1

[freshrpms]
name=FreshRPMs
baseurl=http://dag.freshrpms.net/redhat/el4/en/i386/dag/
gpgcheck=1
enabled=1

[rpmfind]
name=RPMFind.net
baseurl=http://rpmfind.net/linux/dag/redhat/el4/en/i386/dag/
gpgcheck=1
enabled=1

[pdx.edu]
name=PDX.edu
baseurl=http://mirrors.cat.pdx.edu/dag/redhat/el4/en/i386/dag/
gpgcheck=1
enabled=1

Open-iSCSI

install  2.0-869.2
make

start:
rcopen-iscsi start

discovery:
iscsiadm -m discovery  -t st -p 192.168.4.123 

update chap information:
iscsiadm -m node -p 192.168.4.123 --op=update \   
--name=node.session.auth.authmethod --value=CHAP
iscsiadm -m node -p 192.168.4.123 --op=update \     --name=node.session.auth.username --value=andy
iscsiadm -m node -p 192.168.4.123 --op=update \     --name=node.session.auth.password --value=1234
login:
iscsiadm -m node -p 192.168.4.123 -l
or
iscsiadm -m node -r nodeId -l
the disk added after login is in /dev/sd*

delete record:
iscsiadm -m node -o delete
or
rm -rf /etc/iscsi/nodes/*
logout 
iscsiadm -m node -U all
daemon:
/etc/init.d/iscsi

increase iscsi ping time to prevent a lot of io error messages
node.conn[0].timeo.noop_out_interval = X
ode.conn[0].timeo.noop_out_timeout = X