作者 主題: Lpi 102 Task Oriented Topic 106 Boot, Initialization, Shutdown and Runlevels  (閱讀 4105 次)

0 會員 與 1 訪客 正在閱讀本文。

小徒兒

  • 區域板主
  • 鑽研的研究生
  • *****
  • 文章數: 622
    • 檢視個人資料
1.106.1 Boot the system

***giving commands to the boot loader
http://www.linuxaid.com.cn/articles/4/9/492536602.shtml ???

root (hd0,0) #tell the kernel image located partition

setup (hda0,0) #setup in the superblock of the /dev/hda1 partition
setup (hda0)  #setup in the MBR


install
source_of_stage1
where_to_install
source_of_stage2
p source_of_configuration_file

install (hd0,4)/boot/grub/stage1 (hd0) (hd0,4)/boot/grub/stage2 p (hd0,4)/boot/grub/menu.conf Now let's examine this command in detail:

install a built-in command that tells GRUB to install (hd0,4)/boot/grub/grub/stage1 to (hd0), the Master Boot Record. (hd0,4)/boot/grub/stage2



***giving options to the kernel at boot time
**Configuring Kernel at Boot time:

--in Lilo: image=/boot/bzImage-2.4.18-40test01
     append="root=/dev/hda3 ro mem=128M init=/bin/bash hdc=ide-scsi"


--in Grub:
kernel (hd0,0) #小徒註此為/boot核心所在磁區,與鳥哥linux私房菜p17-23中
or
root (hd0,0)
kernel #小徒註此為/boot核心所在磁區,與鳥哥linux私房菜p17-23中

引用
root [開機根目錄/ 所在的磁區代號]
定義不同

 /bzImage-2.4.18-40test01 ro root=/dev/hda3 mem=128M init=/bin/bash  #root=/dev/hda3 此才真為根目錄/ 所在磁區,不要弄混


**Configuring Running kernel

--echo 1 > /proc/sys/net/ipv4/ip_forward

--sysctl -w net.ipv4.ip_forward=1
sysctl -a #list all
sysctl -p #read the parameter in /etc/sysctl.conf

--vi /etc/sysctl.conf



***checking the events in the log files

tail /var/log/messages
less dmesg

1.106.2 Change runlevels and shutdown or reboot system

***changing to single user mode
telinit is a link to init
init 1
init s
init S

***shutdown or rebooting the system
init 0 (shutdown)
init 6 (reboot)


***alert users before switching runlevel
shutdown -r +5 System maintenance is required
shutdown -k thisisnot a real shutdown,but only send warning mesg.