RHCE视频笔记1331.docx

上传人:b****4 文档编号:5582777 上传时间:2023-05-08 格式:DOCX 页数:25 大小:589.64KB
下载 相关 举报
RHCE视频笔记1331.docx_第1页
第1页 / 共25页
RHCE视频笔记1331.docx_第2页
第2页 / 共25页
RHCE视频笔记1331.docx_第3页
第3页 / 共25页
RHCE视频笔记1331.docx_第4页
第4页 / 共25页
RHCE视频笔记1331.docx_第5页
第5页 / 共25页
RHCE视频笔记1331.docx_第6页
第6页 / 共25页
RHCE视频笔记1331.docx_第7页
第7页 / 共25页
RHCE视频笔记1331.docx_第8页
第8页 / 共25页
RHCE视频笔记1331.docx_第9页
第9页 / 共25页
RHCE视频笔记1331.docx_第10页
第10页 / 共25页
RHCE视频笔记1331.docx_第11页
第11页 / 共25页
RHCE视频笔记1331.docx_第12页
第12页 / 共25页
RHCE视频笔记1331.docx_第13页
第13页 / 共25页
RHCE视频笔记1331.docx_第14页
第14页 / 共25页
RHCE视频笔记1331.docx_第15页
第15页 / 共25页
RHCE视频笔记1331.docx_第16页
第16页 / 共25页
RHCE视频笔记1331.docx_第17页
第17页 / 共25页
RHCE视频笔记1331.docx_第18页
第18页 / 共25页
RHCE视频笔记1331.docx_第19页
第19页 / 共25页
RHCE视频笔记1331.docx_第20页
第20页 / 共25页
亲,该文档总共25页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

RHCE视频笔记1331.docx

《RHCE视频笔记1331.docx》由会员分享,可在线阅读,更多相关《RHCE视频笔记1331.docx(25页珍藏版)》请在冰点文库上搜索。

RHCE视频笔记1331.docx

RHCE视频笔记1331

RHCE视频教程笔记-133-1

RH133-01

installation

光盘引导后,在提示符下输入:

linuxaskmethod

可以支持:

localcdrom,harddrive,nfsimage,ftp,http方式

cpuonx862个物理超线程CPU

使用smporhugememkernel可以支持32个物理cpus

内存

标准x86kernel4G

smpi686/athlonkernel16G

hugememSMPkernel64G

blockdevices

/dev/hadIDEdrives

/dev/sdaSCSIdrives

/dev/fd0standardfloppy

characterdevices

/dev/tty[0-6]virtualconsoles

/dev/st0SCSItapedrive

只有在硬盘安装,光盘安装,NFS安装时才可以使用图形安装,也是默认的安装方式。

/mustinclude/etc,/lib/bin/sbin/dev

swapspaceistypically2*physicalRAM

typicalmountpoints:

/boot/home/usr/var/tmp/usr/local/opt

RAID

raid1读写速度慢,因为要读写2份

LVM:

LogicalVolumeManager,由IBM的AIX发展而来

PV---VG(virtualdisk)---PE---LV

可以动态放大lv

SElinuxoptionsandcontrol

disabled停用SElinux

Warm仅警告,而不套用安全规则

Active套用安全规则

PackageSelection

安装套件,如果空间足够的话,建议选择所有

Bypredefinedcomponents默认套件

Individually自定义安装

验证安装

dmesgand/var/log/dmesg查看系统信息

/var/log/messages当系统发生错误时会把所有错误信息记录在此目录下,打开查看有无错误

/root/install.log

可以在引导观盘启动后在提示符后输入noprobe

也可以输入linuxdd启动额外的驱动安装模式

system-config-*设置工具

system-config-date,system-config-dispaly等等。

systeminitializationandservice

bootsequenceoverview

BIOSMBR(BootLoader)Kernelinit(pid=1)根据runlevels执行相应的程序

BIOSinitialization

Peripheralsdetected(POST)

Bootdeviceselected

Firstsectorofbootdevicereadandexecuted

Bootloader

可以安装在如下2个地方

Installwithinadrive’sMasterBootRecord

Installwithinapartition’sbootsector

BootLoader

1stStage-small,residesinMBRorbootsector

2ndStage-loadedfrombootpartition

如果MBR被其他程序如SPFDisk占据了,那么bootloader会存在boot分区的bootsector来载入bootloader

Grubandgrub.conf

GRUB–theGRandUnifiedBootloader

Command-lineinterfaceavailableatbootprompt

Bootfromext2/ext3,ReiserFS,JFS,FAT,minix,orFFSfilesystems

SupportsMD5passwordprotection

/boot/grub/grub.conf

default=0#默认使用那个

timeout=5#超时时间

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

#背景图案

hiddenmenu

#隐藏菜单

titleCentOS(2.6.18-8.el5)

#标题

root(hd0,0)

#硬盘位置,/boot所在分区

kernel/boot/vmlinuz-2.6.18-8.el5roroot=LABEL=/rhgbquiet

#ro是只读的方式挂载/,也可以使用root=/dev/sdb2,就是/所在分区,也可以使用lvm的格式来表示,rhgb=RedHatgraphicalboot,在开机时会以图形的界面取代传统的画面,在开机过程中可以更改.或删除rhgb。

quiet是在开机过程中不显示错误信息,如果想显示,删除掉quiet即可.

initrd/boot/initrd-2.6.18-8.el5.img

#载入initrd-2.6.18-8.el5.img里的内容,此文件内存放驱动程序

在开机时选中要启动的linux,按a,进入grubappend>roroot=LABLE=/rhgbquiet

更改为grubappend>roroot=LABLE=/1

就可以进入单用户模式,也就是不需要root的密码就可以进入系统,进入后使用passwd可以修改root的密码.用在忘记root密码时操作.

我们可以在grub.conf里设置密码来保护grub.conf,可以在hiddenmenu上一行添加passwordredhat,此时就设置了grub的密码为redhat

密码可以支持MD5加密,在系统中输入grub-md5-crypt,提示输入2次密码,然后把加密过的密码复制下来,在grub.conf中添加

password--md5$1$9rGt0$Dkp/tkpLsrhwB1FdaDKqY

Kernelinitializationg

Kernelboottimefunctions

Devicedetection

Devicedriverinitialization

Mountsrootfilesystem(/)asreadonly

Loadsinitialprocess(init)

Initinitialization

Initreadsitsconfig:

/etc/inittab

Initialrunlevel

#id:

5:

initdefault:

Systeminitializationscripts

#si:

:

sysinit:

/etc/rc.d/rc.sysinit

runlevelspecificscriptdirectories

#l5:

5:

wait:

/etc/rc.d/rc5

把5传递给/etc/rc.d/rc这个script,实际上是执行/etc/rc.d/rc5.d/*

Trapcertainkeysequences

#TrapCTRL-ALT-DELETE

#ca:

:

ctrlaltdel:

/sbin/shutdown-t3-rnow设定同时按这三个键时执行的命令

DefineUPSpowerfial/restorescripts

#pf:

:

powerfail:

/sbin/shutdown-f-h+2"PowerFailure;SystemShuttingDown"

#pr:

12345:

powerokwait:

/sbin/shutdown-c"PowerRestored;ShutdownCancelled"

电源失败和恢复是执行的命令

Generategettysonvirtualconsoles

使用1:

2345:

respawn:

/sbin/mingettytty1

2:

2345:

respawn:

/sbin/mingettytty2

3:

2345:

respawn:

/sbin/mingettytty3

4:

2345:

respawn:

/sbin/mingettytty4

5:

2345:

respawn:

/sbin/mingettytty5

6:

2345:

respawn:

/sbin/mingettytty6来生成6个virtualconsoles

InitiazileXinrunlevel5

在runlevel为5时,怎样初始化xwindow的指令

#x:

5:

respawn:

/etc/X11/prefdm–nodaemon

总的流程

id:

5:

initdefault-/etc/rc.sysinit

/etc/rc.5d/*和/etc/rc.local/sbin/mingetty/etc/X11/prefdm

Runlevels

RunlevelEffect

1halt(Donotsetinitdefaulttothis)

1,S,emergencysingle-usermodes(Onlytherootusercanbeloggedon)主要做一些维护系统的工作.1:

init/etc/rc.sysinit/etc/rc1.d/*

S:

init/etc/rc.sysinit

Emergency:

initsome/etc/rc.sysinit(执行必要的,不会全部执行)

2Multi-user,withoutNFSnetworking.

3Fullmulti-usermode.(includesnetworking)(textmode)

4Userdefinable,butduplicateofrunlevel3bydefault

5X11(includesnetworking)

6Reboot(Donotsetinitdefaulttothis)

可以使用以下几种方式来选择哪一种runlevel

1.更改/etc/inittab

2.passinganargumentfromthebootloader在开机时传一个参数给kernel

3.runninginitxafterboot(wherexisthedesiredrunlevel)

Showcurrentandpreviousrunlevels

/sbin/runlevel

/etc/rc.d/rc.sysinit

Importanttasksinclude:

1.Activateudevandselinux启用热插拔的设备如U盘和启动selinux

2.Setkernelparametersin/etc/sysctl.conf

3.Setthesystemclock

4.Loadskeymaps定义键盘

5.Enablesswappartitions

6.Setshostname设定在/etc/sysconfig/network

7.Rootfilesystemcheckandremount检查/目录有没有问题,并重新挂载成可读可写的状态

8.ActivateRAIDandLVMdevices

9.Enablediskquotas

10.Checkandmountotherfilesystem

11.CleansupstalelocksandPIDfiles清除开机时的缓存文件

/etc/rc.d/rc

不同runlevel对应的rcx.d里要执行的程序,其实这些程序都是连接到init.d文件夹下的程序,不同的runlevel执行不同的init.d下的程序集

DaemonProessses

Adaemonprocessisaprogramthatisruninthebackground,providingsomesystemservice

Twotypesofdaemons

Standalone

分为2类:

1在开机时由init直接启动的.2systemVdaemon如httpd

Transient–controlledbythe“super-daemon”xinetd

Transient类型的服务必须由xinetd来代替用户请求来呼叫相应的服务.

SystemVScript

Runleveldefineswhichservicestostart

Eachrunlevelshasacorrespondingdirectory

ThesystemVinitscriptsresidein:

/etc/rc.d/init.d

Symboliclinksintherunleveldirectoriescalltheinit.dscriptswithastartorstopargument

ls–l/etc/rc3.d/

K开头的是Kill,代表是kill所连接的这个服务,也就是不启动。

S开头的是Start,代表要启动所连接的这个服务,K或S后面的数字代表了执行的先后顺序,数字越小的越先执行,总的来说是K先执行,然后再执行S.

SystemVScripts服务启动和停止都使用同一个程序,不同的是后面参数不一样.

/etc/rc.d/rc.local

Runaftertherunlevelspecificscripts

Commonplaceformcustommodification

ls-l/etc/rc*.d/*local

VirtualConsoles

Definedin/etc/inittab

AccessedwithCtrl-Alt-Fn

/dev/ttyn:

virtualconsolen

/dev/tty0:

thecurrentvirtualconsole

echohello>/dev/tty3

echohello>/dev/tty0

DefaultRedHatEnterpriseLinuxconfiguration:

12consolesdefined,总共定义了12个tty

Consoles1-6acceptlogins,1-6可以使用

Xserverstartsonfirstavailableconsole,usually7

ControllingServices

Utilitiestocontroldefaultservicestartup

ntsysv:

aconsole-baseinteractiveutility

如果在ntsysv命令后没有加任何参数,默认只修改当前的level.如果要设定其他runlevel,必须在ntsysv后加参数,如ntsysv–level35

chkconfig:

afast,versatilecommandlineutility

chkconfiggpm–level123off

system-config-services:

graphicalutilitythatrequiresanXinterface

Utilitiestocontrolservicesmanually

Service:

immediatelystartorstopastandaloneservice

建议使用绝对路径/etc/init.d/gpmstop,支持所有linux版本,还有其他参数,reload=restart,status

Chkconfig:

immediatelystartsandstopsxinetd-managedservices

chkconfigtelnet–list

chkconfigtelnetoff

System-config-services:

graphicalutilitythatrequiresanXinterface

SystemStutdown

Shuttingdownthesystem(关机)

shutdown–hnow#h=halt

halt

poweroff

init0

以上4个命令都会在关机之前执行sync.

SystemReboot

Rebootingthesystem

shutdown–rnow

reboot

init6

Ctrl+Alt+Del

kernelserviceandconfiguration

KernelModules

Moduleskernelcomponents

kernel的模块是外挂在kernel上的,这样可以灵活的扩展kernel的功能,同时不增加kernel的大小,Modules有2个功能1.电脑周边设备的驱动.2.提供一些额外的档案系统

在载入kernel的时候可以设置kernelmodules

存放在/lib/modules

controllingmodules

使用命令lsmod—列出目前载入的modules,

modprobe可以让我们临时载入某个modules

KernelModulesConfiguration

Modulesexamination:

/sbin/modinfo显示模块信息及授权同意书签署情况

ModulesConfiguration:

/etc/modprobe.conf

可以设置:

aliases,parameters,actions

Ethernetinterface,soundcard,usbcontroller

ModulesDependencies:

modules.dep,depmod模块的依赖性,记录在/lib/modules/$(uname–r)/modules.dep里,也可以使用depmod–a来查看所有模块的依赖性

ManualControl:

insmod,rmmod

insmod可以载入某个module,跟modprobe差不多,不同的是modprobe会载入此mod依赖的mod,而insmod不会。

rmmod删除某个module

The/procfilesystem

/procisavirtualfilesystemcontaininginformationabouttherunningkernel

Contentsof“files”under/procmaybeviewdusingcat

如:

cat/proc/cpuinfo

Providesinformationonsystemhardware,networkingsettingsandactivity,memoryusageandmore

/procsubdirectories

/proc/scsi/包含了SCSI设备的信息

/proc/sys/包含了kernel的参数

/proc//会用数字的形式显示在屏幕上,包含了所有执行中的程序的信息

The/proc/sys/subdirectoriesallowsadministratorstomodifycertainparametersofarunningkernel

如或略ping包,命令行输入:

echo“1”>/proc/sys/net/ipv4/icmp_echo_ignore_all,

cat/proc/sys/net/ipv4/icmp_echo_ignore_all确认修改,ping测试一下

然后再改回0,ping测试一下.

/proc/sysconfigurationwithsysctl

/proc/sysmodificationsaretemporaryandnotsavedatsystemshutdown

Thesysctlcommandmanagessuchsettingsinastaticandcentralizedfashion:

/etc/sysctl.conf

使用sysctl–p命令来查看并使内容生效

sysctliscalledatboottimebyrc.sysinitandusessettingsin/etc/sysctl.conf

GeneralHardwareResources

当系统开机的时候,会在屏幕上看到kernel的引导信息,系统会通过klogd这个服务来写入到ringbuffer,我们可以使用dmesg这个命令来查看ringbuffer里的内容.ringbuffer的空间是有限的,当ringbuffer写满以后会把这些信息写入到/var/log/dmesg,这样避免信息被覆盖.

dmesgand/var/log/dmesg

kudzu

可以用来维护系统当中已经检测到的硬件的资料库,当系统检测到有新的硬件加入进来或有硬件移除时,kudzu会自动设定我们的系统或引导管理者来设定这个设备.并把检测到的设备写入到/etc/sysconfig/hwconf中,kudzu会使用/usr/share/hwdata/里面的硬件资料来检测目前系统里面的硬件设备.

之后系统会把检测到的设备的详细信息存储到/proc里去.

hwbrowser提供了图形界面的检测工具,我们可以通过这个工具来检测系统里有哪些硬件设备.

SystemBusSupport

PCIBusPCI是x86主机当中主要的插槽

/sbin/lspci此命令可以查看当前有哪些设备插在PCI插槽中

而这些PCI设备的信息会存储在/proc/bus/pci/中

ISABUS大部分ISA设备都支持热插拔PlugandPlay

如果在系统中检测到ISA设备的话,会将这些设备的信息存储在/proc/isapnp/中

HotswappableBusSupport

USBandIEEE1394Buses

当系统检测到有设备连接到USB接口或1394插槽中时,会自动启动/sbin/hotplug,并从/etc/hotplug/目录下载入相应的设备驱动程序

然后把这个设备的信息写入到/proc/bus/子目录中

可以

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 医药卫生 > 基础医学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2