RH131 Unit1 System Initialization

Objectives
Upon completion of this unit, you should be able to:
- Discuss the boot sequece
- Understand GRUB’s role
- Understand init’s role
- Control System V services
Boot Sequence Overview
BIOS Initialization
Boot Loader
Kernel initialization
init starts and enters desired run level by executing:
- /etc/rc.d/rc.sysinit
- /etc/rc.d/rc and /etc/rc.d/rc?.d/
- /etc/rc.d/rc.local
- X display manager if appropriate
Boot Loader Components
Boot Loader
- 1st Stage – smalll, reside in MBR or boot sector
- 2nd Stage – loaded from boot partition
Minimum specifications for Linux:
- Label, kernel location, OS root filesystem and location of the initial ramdisk(initrd)
Minimum specification for other OS:
- boot device, label
GRUB and grub.conf
GRUB “the GRand Unified Bootloader”
- Command-line interface available at boot prompt
- Boot from ext2/ext3, ReiserFS, JFS, FAT, minix, or FFS file systems
- Supports MD5 password protection
/boot/grub/grub.conf
Changes to grub.conf take effect immediately
If MBR on /dev/hda is corrupted, reinstall the first stage bootloader with: /sbin/grub-install /dev/hda
Starting the Boot Process: GRUB
Image selection
- Select with space followed by up/down arrows on the boot splash screen
Argument passing
- Change an existing stanzain menu editing mode
- Issue boot commands interactively on the GRUB command line
Kernel Initialization
- Device detection
- Device driver initialization
- Mounts root filesystem read only
- Loads initial process (init)
init Initialization
init reads its config: /etc/inittab
- initial run level
- system initialization scripts
- run level specific script directories
- trap certain key sequences
- define UPS power fail/ restore scripts
- spawn getty on virtual consoles
- initialize X in run level 5
Run Levels
init defines run levels 0-6, S, emergency
The run level is selected by either
- the default in /etc/inittab at boot
- passing an argument from the boot loader
- using the command init new_runlevel
Show current and previous run levels: /sbin/runlevel
/etc/rc.d/rc.sysinit
Important tasks include:
- Activate udev and selinux
- Sets kernel parameters in /etc/sysctl.conf
- Sets the system clock
- Loads keymaps
- Enables swap partitions
- Set hostname
- Root filesystem check and remount
- Activate RAID and LVM device
- Enable disk quotas
- Check and mount other filesystems
- Cleans up stale locks and PID files
/etc/rc.d/rc
Initializes the default run level per the /etc/inittabe file initdefault line such as id:3:initdefault:
10:0:wait:/etc/rc.d/rc 0
11:1:wait:/etc/rc.d/rc 1
12:2:wait:/etc/rc.d/rc 2
13:3:wait:/etc/rc.d/rc 3 (default)
14:4:wait:/etc/rc.d/rc 4
15:5:wait:/etc/rc.d/rc 5
16:6:wait:/etc/rc.d/rc 6
System V run levels
Run level defines which services to start
- Each run level has a correponding directory: /etc/rc.d/rcX.d
- The system V init script reside in: /etc/rc.d/init.d
- Symbolic links in the run level directories call the init.d scripts with a start or stop argument
/etc/rc.d/rc.local
Run after the run level specific scripts
Common place for custom modification
In most cases it is recommended that you create a System V init script in
/etc/rc.d/init.d unless the service you are starting is so trivial it doesn’t warrant it. Existing scripts can be used as a starting point
Controlling Services
Utilities to control servcie startup
- system-config-services: graphical utility that requires an X interface
- ntsysv: ncurses based utility usable in virtual consoles
- chkconfig: a fast, versatile command line utility that works well and is usable with scripts and Kickstart installations
Utilities to control service manually
- service: immediately start or stop a standalone service
- chkconfig: immediately starts and stops xinetd-managed services
End of Unit1
Questions and Answers
Summary
- System BIOS
- GRUB
- init
- chkconfi and service
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值