这是我的第一篇博客文章,从系统开始,就如我的工作之路一样,是为纪念。
Linux的常见维护,做个MARK,备参考,以后陆续补充。
1.ifconfig
配置网卡的IP:
ifconfig eth0 192.168.0.1 netmask 255.255.255.0
配置网卡的硬件地址
ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
2.路由配置
(1)默认路由--网关
route del default gw ip
route add default gw ip
(2)指定网段路由
route add -net 192.168.0.0 gw 192.168.0.1
route del -net 192.168.0.0 gw 192.168.0.1
3.LVM管理
4.rawdevices
由于RHEL5中取消了rawdevices,如果不想将映射命令放到rc.local中的话,我们就需要将其配置到
/etc/udev/rules.d/文件夹中
修改文件
分区绑定为裸设备
#vi/etc/udev/rules.d/60-raw.rules
增加如下内容:
ACTION=="add",KERNEL=="/dev/sdb",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="17",RUN+="/bin/raw /dev/raw/raw1 %M %m"
ACTION=="add",KERNEL=="/dev/sdc",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="33",RUN+="/bin/raw /dev/raw/raw2 %M %m"
ACTION=="add",KERNEL=="/dev/sdd",RUN+="/bin/raw /dev/raw/raw3%N"
ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="49",RUN+="/bin/raw /dev/raw/raw3 %M %m"
KERNEL=="raw[1-3]",OWNER="grid",GROUP="oinstall",MODE="660"
start_udev
裸盘绑定成裸设备
[root@RAC1 rules.d]# raw /dev/raw/raw1 /dev/sdb
/dev/raw/raw1: bound to major 8, minor 16
[root@RAC1 rules.d]# raw /dev/raw/raw2 /dev/sdc
/dev/raw/raw2: bound to major 8, minor 32
[root@RAC1 rules.d]# raw /dev/raw/raw3 /dev/sdd
/dev/raw/raw3: bound to major 8, minor 48
ACTION=="add",KERNEL=="/dev/sdb",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="16",RUN+="/bin/raw /dev/raw/raw1 %M %m"
ACTION=="add",KERNEL=="/dev/sdc",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="32",RUN+="/bin/raw /dev/raw/raw2 %M %m"
ACTION=="add",KERNEL=="/dev/sdd",RUN+="/bin/raw /dev/raw/raw3%N"
ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="48",RUN+="/bin/raw /dev/raw/raw3 %M %m"
KERNEL=="raw[1-3]",OWNER="grid",GROUP="oinstall",MODE="660"
-- The End --