
                    LILO, Linux Crash Rescue HOW-TO 
                                       
ߣAl Dev (Alavoor Vasudevan) [1]alavoor@yahoo.com
ߣƹΰ [2]u4561055@cc.ncu.edu.tw

   v7.0, 06 May 2001 ڣ25 May 2001
     _________________________________________________________________
   
   ļִ̽ Linux ϵͳлظķ Linux ϵͳĸԭ
    - LILO  linux ޷ Ӳ¼(Master Boot
   Record, MBR)𻵡ǰװҵϵͳ Windows NT  LILO  MBR
   д linux ޷
     _________________________________________________________________
   
1. 

     * 1.1 С Linux ϵͳ 
     * 1.2 ׼ 
     * 1.3 ظϵͳĿٲ
     * 1.4 ԤԴʩ
     * 1.5 Ƴ LILO
     * 1.6 
       
2. վ

3. ˷ļʽ

4. Ȩ Copyright
     _________________________________________________________________
   
1. 

   ޷ķⷢ linux ϵͳ ܻ𺦵Ӳ
   ¼ (MBR)  LILO (Linux boot Loader)  linux Ӳ϶
   ޷ʱͻᷢ С»ִŵ linux
   ϵͳĵϰװҵϵͳ 磺Windows 98/NTLILO ҲܻʧЧ
   
   ļһЩ顢ؾͿٵָٻظϵͳ طĵ
   ϰҳй LILO  Linux ļ
   
1.1 С Linux ϵͳ

   Ϊ˻ظκҵϵͳ Windows 95/NT/2000OS/2BeOS Linux 
   ҪװһƬƬС linux ϵͳ οгС
   linux ϵͳ -
     *  [3]Tomsrtbt
     * μѵ linux ϵͳ [4]MuLinux
     * [5]Trinux
     * [6]DLX
     * [7]FloppyFW
     * [8]Linux Router Proejct floppy
     * [9]Tiny Linux distributions
     * [10]TINYLinux
       
1.2 ׼

   ʹ¸½ڵ Tomsrtbt ֮ᣬ ȱҪϵͳ
    /etc/fstab/etc/lilo.conf ڵʱϵͳʱ൱
   õġ
     _________________________________________________________________
   
bash# cp /etc/fstab /etc/fstab.orig
bash# cp /etc/lilo.conf /etc/lilo.conf.orig
bash# cp /etc/hosts /etc/hosts.orig
bash# cp /etc/hosts.allow /etc/hosts.allow.orig
bash# cp /etc/hosts.deny /etc/hosts.deny.orig
bash# cp /etc/inetd.conf /etc/inetd.conf.orig
bash# cp /etc/inittab /etc/inittab.orig
bash# cp /etc/networks /etc/networks.orig
     _________________________________________________________________
   
1.3 ظϵͳĿٲ

   ѭЩִУԱ LILO ϵͳлظ
   
    1. ״ 1 ϵͳ޷ -
       ȡò tomsrtbt Ƭ [11]http://www.toms.net/rb 
       MuLinux Ƭ (ο [12]Tiny Linux) ʹ tomsrtbt Ƭ
        ʹ fdisk ָҳָ(partitions) ָʶ
       root ָ -
         _____________________________________________________________
       
bash# fdisk /dev/hda
bash# mkdir /test
bash# mount /dev/hda1 /test
bash# ls /test
Ӧûῴ root ָʾ -
bin   fd    lib   mnt  proc  sbin  usr
boot  dev   etc   home  lost+found  opt  root  tmp   var
         _____________________________________________________________
       
       ˷ָ root ָ¸ָ /dev/hda2  ټ
        hda3  hda4  hda5 ȣֱҳ root ָΪֹ  hda
       ޷ҵظϵĲװϣ  hdb, hdc, hdd ..
       ڽµ lilo 趨ʱ /usr/var /boot ָҲҪġ
       ҵϵͳΪroot ָ /dev/hda4
         _____________________________________________________________
       
bash# mkdir /hda4
bash# mount /dev/hda4 /hda4
bash# cat /hda4/etc/fstab
        Ķ fstab ݣҰ fstab  (mount) ָ -
bash# mount /dev/hda5 /hda4/boot
bash# mount /dev/hda6 /hda4/usr
bash# mount /dev/hda7 /hda4/var
bash# mount /dev/hda8 /hda4/opt
bash# mount /dev/hda9 /hda4/root
bash# mount /dev/hda10 /hda4/home
         _____________________________________________________________
       
       ҵϵͳΪ fstab ʾhda5  boothda6  usr 
       hda7  varhda8  opthda9  roothda10  home  hda11 
       windows95 Ŀ¼
       ༭ /etc/fstab ( /hda4/etc/fstab) Ҽ(³ʽ)
         _____________________________________________________________
       
        /dev/hda4  /hda4           ext2 defaults 1 1
        /dev/hda5  /hda4/boot      ext2 defaults 1 1
        /dev/hda6  /hda4/usr       ext2 defaults 1 1
        /dev/hda7  /hda4/var       ext2 defaults 1 1
        /dev/hda8  /hda4/opt       ext2 defaults 1 1
        /dev/hda9  /hda4/root      ext2 defaults 1 1
        /dev/hda10 /hda4/home      ext2 defaults 1 1
        /dev/hda11 /hda4/win95part vfat defaults 1 1

ҵĵУhda4 Ϊ linux  root ָhda5 Ϊ boot ָ
hda11 Ϊ windows 95  vfat ϵͳ

bash# mkdir /hda4/win95part
bash# mount /hda4/win95part
        ʹ fsck  e2fsck ָ޸ϵͳ
bash# man fsck
bash# man e2fsck
         _____________________________________________________________
       
    2. ״ 2  LILO Ч..
       ״ 1 Ĳų⡣޷²衣 
       ӦѾ /hda4 Ѿ༭ /etc/fstab ˡ
         _____________________________________________________________
       
bash# mount -a
bash# chroot /hda4 /sbin/lilo -q
bash# man chroot
bash# chroot /hda4 /sbin/lilo
         _____________________________________________________________
       
       Ҳѡֱʹ /sbin/lilo Դ chroot lilo ѡ -r ʵ
       Ͼͺ chroot ָһġ ǿҽʹ chrootҪʹ
       lilo -r Ϊʹ chroot ȽϷ㣬ҽҳ
         _____________________________________________________________
       
bash# man lilo
bash# /sbin/lilo -r /hda4
         _____________________________________________________________
       
    3. ״ 3  LILO Ч..
       ʹ״ 1 ״ 2 Ĳ޷ ʹ
       'mkbootdisk' Ƭ(춰װʱο 'man mkbootdisk'н)
       ʹĿƬ޸ָ mkbootdisk 
       mkbootdisk*.rpm ׼밲װ (ע治ͬ׼
       죻Ǣѯķ׼̻֯)
    4. ״ 4 ״ 123 Ĳ޷⣬Ҳûп
       Ƭ
        linux ϵͳĵԣ root ݵ벢ִ -
       ע⣺Լĺ(kernel)Ϊ bzImage (
       bzImage-2.4.4) Ӧʹ· vmlinuz-2.4.4 Ӳ
       (hard link)(ע vmlinuz  z vmlinux) δ˲
         mkbootdisk ָܻʧܡ
         _____________________________________________________________
       
bash# cd /boot
bash# ls -l vmlinuz*
bash# ln /boot/bzImage-2.4.4  /boot/vmlinuz-2.4.4
         _____________________________________________________________
       
        bzImage  vmlinuzִָ -
         _____________________________________________________________
       
bash$ man mkbootdisk
bash# cp /etc/lilo.conf /etc/lilo-original.conf
         _____________________________________________________________
       
       ༭ /etc/lilo.conf  '״ 1' õ root ָʽ
       ֮հ״ŵƬִ -
         _____________________________________________________________
       
bash# mkbootdisk --device /dev/fd0 2.2.12-20
(ע2.2.12-20 Ϊİ汾ţ linux İ汾ı䡣)
         _____________________________________________________________
       
       mkbootdisk  mkbootdisk*.rpm ׼밲װ (ע
       ͬ׼죻Ǣѯķ׼̻֯) ȷ
       /etc/lilo-original.conf Ļԭĵ /etc/lilo.conf!! Դ˿
       Ƭ״ 3 Ĳ衣
    5. ״ 5: ϣߵز ״ 1  4 Ѱ
       ˾İ״ 123 4 Ĳ趼޷ -
       һ ʹ tomsrtbt Ƭ (ο [13]Tiny Linux) 
       ָ ʹָ root ָдŵռķָ
       -
         _____________________________________________________________
       
        ༭ /etc/fstab д(µĳʽ
        ܱ밴Ĵŵʵ״ı) -
                /dev/hda4  /hda4        ext2 defaults 1 1
                /dev/hda11 /b1          vfat defaults 1 1
bash$ mkdir /hda4; mount /hda4
bash$ mkdir /b1; mount /b1
bash$ cd /
bash$ df
        鿴 /b1 Ƿ㹻Ĵŵռ䣬Աʹ tar  root ָ
bash$ tar cvf /b1/root-hda4.tar   /hda4
         _____________________________________________________________
       
       ڶ  Linux Ƭؿװ redhat linux (עװ
        linux ׼)  /dev/hda4 (ǧҪװκζŵ׼
       ֻҪװ rootboot ϵͳ LILO ߡ Ҳ˵ѡС
       װ) װʽҲᰲװ LILO Ӳ 
       linux root ݵ룬ִ -
         _____________________________________________________________
       
bash$ man mkbootdisk
bash# cp /etc/lilo.conf /etc/lilo-original.conf
         _____________________________________________________________
       
       ע⣺ǵý lilo-original.conf ƻ lilo.conf!! ༭
       /etc/lilo.conf  '״ 1' õ root ָʽ룻֮
       հ״ŵƬִ -
         _____________________________________________________________
       
bash# mkbootdisk --device /dev/fd0 2.2.12-20
(ע2.2.12-20 Ϊİ汾ţ linux İ汾ı䡣)
bash# cp /etc/lilo-original.conf /etc/lilo.conf
         _____________________________________________________________
       
       Դ˿ƬǷ һ tar ֵĵ
        /b1/root-hda4.tar ظ (עʹ tar xvf ظ
       tar manpage)
       
1.4 ԤԴʩ

   ӦȡеԤԴʩδܷ⡣
   
     * һҪżԮƬıָʱһҪ 
       ״ŵƬִ -
         _____________________________________________________________
       
bash$ man mkbootdisk
mkbootdisk  mkbootdisk*.rpm ׼밲װ
(ע治ͬ׼죻Ǣѯķ׼̻֯)
bash$ mkbootdisk --help
bash$ mkbootdisk --device /dev/fd0 2.2.12-20
(ע2.2.12-20 Ϊİ汾ţ linux İ汾ı䡣)
         _____________________________________________________________
       
     * ֱ߱ӵ tomsrtbt ĿƬ
       [14]http://www.toms.net/rb (ο [15]Tiny Linux)
     * ֱ߱ӵ Yard ԮͿƬ
       [16]http://www.croftj.net/~fawcett/yard
     *  /root  /boot Ŀ¼ʹ Tomsrtbt Ƭ (ο
       [17]Tiny Linux) ִ
         _____________________________________________________________
       
bash# vi /etc/fstab
 -
                /dev/hda1 /a1 vfat defaults 1 1
                /dev/hdb1 /b1 vfat defaults 1 1
ҵϵͳΪ hda1 Ϊ linux ֮ root ָ '/'
bash# cd /
bash# tar cvf /b1/linux-root-partition-hda1.tar  a1
bash# tar cvf /b1/linux-boot-partition-hda1.tar  a1/boot
         _____________________________________________________________
       
1.5 Ƴ LILO

   ʹ DOS ʽ(boot loader)֮ȡ LILO
    MS DOS ʾָ
     _________________________________________________________________
   
        FDISK  /MBR
     _________________________________________________________________
   
   ˴ MBR  "Ӳ¼(Master Boot Record)"
   
   ο LILO ļȡƳ LILO ķЩļͨ linux ϵͳ
   ϵ /usr/doc/lilo* (ע /usr/share/doc/lilo*)Ҳο 'man
   lilo'
   
1.6 

    /etc/lilo.conf ֮ᣬִ lilo ʹĸıЧ ִ
    linux ѧߺܳĴִ -
     _________________________________________________________________
   
bash# lilo -v -v -v
     _________________________________________________________________
   
2. վ

   λַȡ LILOLinux ԮظѶ -
     * Mini Lilo HOWTO 
       [18]http://www.linuxdoc.org/HOWTO/mini/LILO.html
     * Bootdisk-HOWTO 
       [19]http://www.metalab.unc.edu/LDP/HOWTO/Bootdisk-HOWTO/index.html
     * Pre-made boot disks 
       [20]http://www.linuxdoc.org/HOWTO/Bootdisk-HOWTO/
     * Tomsrtbt boot floppy disk [21]http://www.toms.net/rb (
       [22]Tiny Linux)
     * Yard rescue and boot floppy disk
       [23]http://www.croftj.net/~fawcett/yard
     * BootPrompt-HOWTO 
       [24]http://www.linuxdoc.org/HOWTO/BootPrompt-HOWTO.html
     * Multiboot with LILO mini HOWTO 
       [25]http://www.linuxdoc.org/HOWTO/mini/Multiboot-with-LILO.html
     * Linux+WinNT mini HOWTO 
       [26]http://www.linuxdoc.org/HOWTO/mini/Linux+WinNT.html
     * Linux goodies main site [27]http://www.aldev.8m.com
     * Linux goodies mirror site [28]http://aldev.webjump.com
     * Vim color text editor for C++, C
       [29]http://metalab.unc.edu/LDP/HOWTO/Vim-HOWTO.html
       
3. ˷ļʽ

   ˷ļ 11 ֲͬĸʽе - DVI, Postscript, Latex, Adobe
   Acrobat PDF, LyX, GNU-info, HTML, RTF(Rich Text Format), Plain-text,
   Unix man pages, single HTML file Լ SGML.
     * Դõ HTMLDVIPostscript SGML ʽ HOWTO 
       һ tar ball  -
       [30]ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/other-formats/
     * ָʽڣ [31]ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO
     * ֮ļ룬Ƿġġġ ġĵ
       [32]ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO ӭæ
       Եİ汾
       
   ˷ļ "SGML-Tools" ׫дģõ
    - [33]http://www.sgmltools.org ʹָԭʼ磺
     * sgml2html LILO-crash-rescue-HOWTO.sgml (ȡ html )
     * sgml2rtf LILO-crash-rescue-HOWTO.sgml (ȡ RTF  )
     * sgml2latex LILO-crash-rescue-HOWTO.sgml (ȡ latex )
       
   (עʹ ftp.linux.org.tw/pub/CLDP/src 
   zh-sgmltools-1.x-x.tar.gz װ֮ bg5sgml2htmlbg5sgml2rtf
   bg5sgml2latex  gbsgml2htmlgbsgml2rtfgbsgml2latex ָԭʼ
    SGMLtools ׼ʹ˵
   [34]http://www.linux.org.tw/CLDP/zh-sgmltools.html)
   
   LaTeX ļʹ sgml2latex  Postscript  dvips ת PDF
   ʹ Acrobat distill ( [35]http://www.adobe.com) ָۿ
   ʾ
     _________________________________________________________________
   
bash$ man sgml2latex
bash$ sgml2latex filename.sgml
bash$ man dvips
bash$ dvips -o filename.ps filename.dvi
bash$ distill filename.ps
bash$ man ghostscript
bash$ man ps2pdf
bash$ ps2pdf input.ps output.pdf
bash$ acroread output.pdf &
     _________________________________________________________________
   
   ʹ Ghostscript ָ ps2pdf ps2pdf Ǹ Adobe's Acrobat
   Distiller ƷƲӵ󲿷ָֹܵ  PostScript ת
   ɿЯʽļʽ(Portable Document Format, PDF) ps2pdfǱһ
    Ghostscript ָ (command script) (ε batch file) ѡ
   һ pdfwrite  "װ (output device)" ִС ΪҪʹ
    ps2pdf Ghostscript ڰװʱpdfwrite װñҪ
   makefile  װ Ghostscript ļ
   
    howto ļλ -
     * [36]http://sunsite.unc.edu/LDP/HOWTO/LILO-crash-rescue-HOWTO.html
       
   Ҳоվҵļ -
     * [37]http://www.caldera.com/LDP/HOWTO/LILO-crash-rescue-HOWTO.html
     * [38]http://www.WGS.com/LDP/HOWTO/LILO-crash-rescue-HOWTO.html
     * [39]http://www.cc.gatech.edu/linux/LDP/HOWTO/LILO-crash-rescue-HOW
       TO.html
     * [40]http://www.redhat.com/linux-info/ldp/HOWTO/LILO-crash-rescue-H
       OWTO.html
     * Ͽľվ (ַǻ۱ʶ, network-address-wise) ڴ
       ҵ [41]http://sunsite.unc.edu/LDP/mirrors.html ѡһվ
       Ŀ¼ /LDP/HOWTO/LILO-crash-rescue-HOWTO.html
       
   ҪĶ dvi ʽļʹ xdvi ʽxdvi ʽ Redhat Linux 
    tetex-xdvi*.rpm (ע治ͬ׼죻Ǣѯķ
   ׼̻֯) Դӿ(ControlPanel) | Ӧó
   ʽ(Applications) | (Publishing) | Tex ѡť֮ Ҫȡ
   dvi ʽļִָ -
   
        xdvi -geometry 80x90 howto.dvi
        man xdvi

   ʹû趨ӴС ʹ÷Page UpPage Down 
    Ҳʹ 'f', 'd', 'u', 'c', 'l', 'r', 'p', 'n' ĸ ơ
   ơСһҳһҳȡ Ҫرרѡ밴 'x'
   
   ʹ 'gv' (ghostview)  'ghostscript' Ķ postscript ʽ
     Redhat Linux ghostscript  ghostscript*.rpm ׼gv
    gv*.rpm ׼(ע治ͬ׼죻Ǣѯķ
   ׼̻֯) Դӿ(ControlPanel) | Ӧó
   ʽ(Applications) | ͼ(Graphics) ѡť֮gv Զ
   ghostscript Ի ghostscript  gv Ҳƽ̨İ汾 OS/2
    Windows 95  NTЩƽ̨ҲԹۿ˷ļ
   
     * ɴַ Windows 95OS/2ҵϵͳƽ̨
       ghostscript [42]http://www.cs.wisc.edu/~ghost
       
   ҪĶ postscript ʽļִָ -
   
                gv howto.ps
                ghostscript howto.ps

   ʹ Netscape NavigatorMicrosoft Internet explorer Redhat
   Baron Web browser κ 10 Ķ HTML ʽļ
   
   ʹ LyX -- һ latex  X-Windows ǰ˽棬Ķ latex ʽ
   ļ
   
4. Ȩ Copyright

   Ȩ߰ LDP (Linux ļƻ) Ϊ GNU/GPL LDP  GNU/GPL ƻ֮һ
    Ϊеĸļбߵʼλַ
   ʹ˷ݰȨļ޸Ļ ֪˷ļ
   ߡ ļӡΪ˵Ȩ
   
   ԭ (ԭΪ)
   
   Copyright policy is GNU/GPL as per LDP (Linux Documentation project).
   LDP is a GNU/GPL project. Additional requests are that you retain the
   author's name, email address and this copyright notice on all the
   copies. If you make any changes or additions to this document then you
   please intimate all the authors of this document. Brand names
   mentioned in this document are property of their respective owners.

References

   1. mailto:alavoor@yahoo.com
   2. mailto:u4561055@cc.ncu.edu.tw
   3. http://www.toms.net/~toehser/rb
   4. http://sunsite.dk/mulinux
   5. http://www.trinux.org/
   6. http://www.wu-wien.ac.at/usr/h93/h9301726/dlx.html
   7. http://www.zelow.no/floppyfw
   8. http://www.psychosis.com/linux-router
   9. http://www.txdirect.net/users/mdfranz/tinux.html
  10. http://tiny.seul.org/en
  11. http://www.toms.net/rb
  12. file://localhost/tmp/zh-sgmltools.17771/LILO-crash-rescue-HOWTO.txt.html#tiny
  13. file://localhost/tmp/zh-sgmltools.17771/LILO-crash-rescue-HOWTO.txt.html#tiny
  14. http://www.toms.net/rb
  15. file://localhost/tmp/zh-sgmltools.17771/LILO-crash-rescue-HOWTO.txt.html#tiny
  16. http://www.croftj.net/~fawcett/yard
  17. file://localhost/tmp/zh-sgmltools.17771/LILO-crash-rescue-HOWTO.txt.html#tiny
  18. http://www.linuxdoc.org/HOWTO/mini/LILO.html
  19. http://www.metalab.unc.edu/LDP/HOWTO/Bootdisk-HOWTO/index.html
  20. http://www.linuxdoc.org/HOWTO/Bootdisk-HOWTO/
  21. http://www.toms.net/rb
  22. file://localhost/tmp/zh-sgmltools.17771/LILO-crash-rescue-HOWTO.txt.html#tiny
  23. http://www.croftj.net/~fawcett/yard
  24. http://www.linuxdoc.org/HOWTO/BootPrompt-HOWTO.html
  25. http://www.linuxdoc.org/HOWTO/mini/Multiboot-with-LILO.html
  26. http://www.linuxdoc.org/HOWTO/mini/Linux+WinNT.html
  27. http://www.aldev.8m.com/
  28. http://aldev.webjump.com/
  29. http://metalab.unc.edu/LDP/HOWTO/Vim-HOWTO.html
  30. ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/other-formats/
  31. ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO
  32. ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO
  33. http://www.sgmltools.org/
  34. http://www.linux.org.tw/CLDP/zh-sgmltools.html
  35. http://www.adobe.com/
  36. http://sunsite.unc.edu/LDP/HOWTO/LILO-crash-rescue-HOWTO.html
  37. http://www.caldera.com/LDP/HOWTO/LILO-crash-rescue-HOWTO.html
  38. http://www.WGS.com/LDP/HOWTO/LILO-crash-rescue-HOWTO.html
  39. http://www.cc.gatech.edu/linux/LDP/HOWTO/LILO-crash-rescue-HOWTO.html
  40. http://www.redhat.com/linux-info/ldp/HOWTO/LILO-crash-rescue-HOWTO.html
  41. http://sunsite.unc.edu/LDP/mirrors.html
  42. http://www.cs.wisc.edu/~ghost
