강 명 수 [email protected]

Download 강 명 수 flag12@cherub.sungkyul

If you can't read please download the document

Upload: saddam

Post on 08-Jan-2016

64 views

Category:

Documents


4 download

DESCRIPTION

LINUX 부팅과정 & 부트로더. 강 명 수 [email protected]. 시스템 부팅 과정 이해도. Linux 부팅과 종료 (1). 부팅과 종료를 위한 프로세스 ( 명령어 ) Init, shutdown, reboot, halt, poweroff 등 Ex) init 0 부팅레벨 6 종류 ( 관련파일 :/etc/inittab, 관련프로세스 :init) 레벨 0 : 시스템 종료 (init 0, halt, shutdown –h now) - PowerPoint PPT Presentation

TRANSCRIPT

  • [email protected] &

  • Power On

    ROM BIOS

    (GRUB)

    (/boot/vmlinuz-2.6.9-1.667)

    (root filesystem)

    (init)

    Login:

  • Linux (1) () Init, shutdown, reboot, halt, poweroff Ex) init 0

    6(:/etc/inittab, :init) 0 : (init 0, halt, shutdown h now) 1 : (), , root (init 1) 2 : NFS (init 2) 3 : NFS (init 3, full multiuser mode) 4 : ( ) 5 : X (init 5) 6 : (init 6, reboot, shutdown r now)

  • Linux (2) Init /etc/inittab ( init )/etc/rc.d/rcN.d K (N:0~6)/etc/rc.d/init.d /var/log/wtmp, /var/log/messages, /var/log/dmesg, /var/log/boot.log

  • Linux (1)1 : Power On( on) ROM-BIOS(basic input/output system) BIOS . , BIOS () 2 : BIOS (POST-Power On Self Test) (GRUB or LILO) , BIOS .

  • Linux (2)

  • Linux (3)3 : (GRUB) GRUB /boot/grub/grub.conf . , . GRUB () .GRUB (kernel) -(/boot/vmlinuz-) . .4 : swapper (PID 0) .swapper , . .(boot/grub/menu.lst-)Init /etc/inittab .

  • Linux (4)5 : init (/etc/inittab ) init . , , , .

  • Init inittab (1)

  • Init inittab (2)[ id : runlevels : action : process ]: id:3:initdefault: si::sysinit:/etc/rc.d/rc.sysinit

    Id : () (id, si, pr, pf, ca )Runlevels : Action : process ()respawn : wait : runlevel , init .once : runlevel .boot : . runlevel .bootwait : , init . (, /etc/rc) runlevel .

  • Init inittab (3)ondemand : ondemand runlevel . runlevel .initdefault : runlevel . sysinit : .powerwait : init SIGPWR .( )powerfail : powerwait , init .ctrlaltdel : Ctrl+Alt+Del process : ()

  • Init inittab (4) Id:3:initdefault: 0 : (init 0, halt, shutdown h now) 1 : (), , root (init 1) 2 : NFS (init 2) 3 : NFS (init 3, full multiuser mode) 4 : ( ) 5 : X (init 5) 6 : (init 6, reboot, shutdown r now)

  • Init inittab (5) si::sysinit:/etc/rc.d/rc.sysinit ( 500) Default path (/etc/sysconfig/network) , keymap fsck (/etc/fstab ) /proc depmod /usr/sbin/netconfig, /usr/sbin/timeconfig, /usr/sbin/sutoconfig, /usr/sbin/ntsysv Utmp, wtmp

  • [ ] [][ ][][dump][]: /dev/hda2 /home ext3 defaults 1 2: LABEL=/boot /boot ext3 defaults1 2[ ] .[] .[ ]Ext2, ext3, reiserfs, iso9660, nfs, swap, ufs, vfat, ntfs[]Defaults : rw, nouser, auto, exec, suidAuto, noauto, exec, noexec, suid, nosuid, user, nouser, ro, rw, usrquota, grpquota[dump ]0 : dump .1 : dump .[] : fsck, e2fsck0 : () .1 : .2 : .( )

  • Init inittab (6) l0:0:wait:/etc/rc.d/rc 0l1:1:wait:/etc/rc.d/rc 1l2:2:wait:/etc/rc.d/rc 2l3:3:wait:/etc/rc.d/rc 3l4:4:wait:/etc/rc.d/rc 4l5:5:wait:/etc/rc.d/rc 5l6:6:wait:/etc/rc.d/rc 6 (id:3:initdefault) (sshd, sendmail, xinetd, syslogd, named, httpd ) S K , /etc/rc.d/init.d .S K .

  • Init inittab (7) ca::ctrlaltdel:/sbin/shutdown t3 r nowCTRL + ALT + DEL .shutdown .UPS pf::powerfail::/sbin/shutdown f h +2 Power Failure; System Shutting Downpr::12345:powerokwait:/sbin/shutdown c Power Restored; Shutdown Cancelled pf UPS 2 shutdown.pr (UPS ) shutdown .

  • Init inittab (8) mingetty 1:2345:rewpawn:/sbin/mingetty tty12:2345:rewpawn:/sbin/mingetty tty23:2345:rewpawn:/sbin/mingetty tty34:2345:rewpawn:/sbin/mingetty tty45:2345:rewpawn:/sbin/mingetty tty56:2345:rewpawn:/sbin/mingetty tty6 mingetty. 6 2, 3, 4, 5 ALT+F1, ALT+F2, ALT+F3, ALT+F4, ALT+F5, ALT+F6 .

  • GRUB Grub LILO . .Chain-load , . , .

  • GRUB (1)/boot/grub/menu.lst or grub.conf/boot/grub/menu.lst or /boot/grub/grub.conf or /etc/grub.conf

  • GRUB (2)timeout=5GRUB , .Hiddenmenu , , GRUB

  • GRUB (3)default 0GRUB title . 0 fallback 1 splashimage xpm.gz GRUB .

  • GRUB (4)hiddenmenuGRUB .

    title root ( , )kernel /, root= initrd initrd /initrdEx) title Fedora Core3 (Kernel 2.6.9-1.667) root (hd0, 4) kernel /boot/vmlinuz-2.6.9-1.667 ro root=LABEL=/ rhgb quiet initrd /boot/initrd-2.6.9-1.667.img

  • GRUB (5)GRUB

  • GRUB (6)GRUB GRUB GRUB

  • Q & A