📄 user.tex
字号:
sectors have to be altered.Please refer to the documentation accompanying the LOADLIN package forinstallation instructions and further details.\subsubsection{\LILO\ started by DOS-MBR}%%beginskip\bootthree{DOS-MBR \sep LILO \sep Linux \\ \branch {\rm other OS} \empty}%%endskip%:\begin{verbatim}%;+-------------------------------------------------------+%;| Master Boot Record Boot sector Operating system |%;|-------------------------------------------------------|%;| DOS-MBR ------------> LILO --------> Linux |%;| ---> other OS |%;+-------------------------------------------------------+%:\end{verbatim}This is a ``safe'' \LILO\ setup: \LILO\ is booted by the DOS-MBR. No other bootsectors have to be touched. If the other OS (or one of them, if there areseveral other operating systems being used) should be booted withoutusing \LILO, the otherpartition has to be marked ``active'' with \name{fdisk} or \name{activate}.Installation:\begin{itemize} \item install \LILO\ with its boot sector on the Linux partition. \item use \name{fdisk} or \name{activate} to make that partition active. \item reboot.\end{itemize}Deinstallation:\begin{itemize} \item make a different partition active. \item install whatever should replace \LILO\ and/or Linux.\end{itemize}\subsubsection{Several alternate branches}%%beginskip\bootfour{DOS-MBR \sep MS-DOS \sep COMMAND.COM \empty \\ \empty \branch LOADLIN \sep Linux \\ \branch LILO \sep Linux \empty \\ \empty \branch MS-DOS \cont \empty}%%endskip%:\begin{verbatim}%4+------------------------------------------------------------+%4| Master Boot Record Boot sector Operating system |%4|------------------------------------------------------------|%4| DOS-MBR ------------> MS-DOS ------> COMMAND.COM |%4| ---> LOADLIN ------> Linux |%4| ---> LILO --------> Linux |%4| ---> MS-DOS --- ... |%4+------------------------------------------------------------+%:\end{verbatim}An extended form of the above setup: the MBR is not changed and both branchescan either boot Linux or MS-DOS. (\LILO\ could also boot otheroperating systems.)\subsubsection{\LILO\ started by \name{BOOTACTV}\protect\footnotemark}\footnotetext{Other, possibly better known boot switchers, e.g. \name{OS/2BootManager} operate in a similar way. The installation procedures typicallyvary.}%%beginskip\bootthree{BOOTACTV \sep LILO \sep Linux \\ \branch {\rm other OS} \empty}%%endskip%:\begin{verbatim}%;+-------------------------------------------------------+%;| Master Boot Record Boot sector Operating system |%;|-------------------------------------------------------|%;| BOOTACTV -----------> LILO --------> Linux |%;| ---> other OS |%;+-------------------------------------------------------+%:\end{verbatim}Here, the MBR is replaced by \name{BOOTACTV} (or any other interactive bootpartition selector) and the choice between Linux and theother operating system(s) can be made at boot time. This approach should beused if \LILO\ fails to boot the other operating system(s).\footnote{%And the author would like to be notified if booting the other operatingsystem(s) doesn't work with \LILO, but if it works with an other boot partitionselector.}Installation:\begin{itemize} \item boot Linux. \item make a backup copy of your MBR on a floppy disk, e.g. \\ \verb"dd if=/dev/hda of=/fd/MBR bs=512 count=1" \item install \LILO\ with the boot sector on the Linux partition. \item install \name{BOOTACTV} as the MBR, e.g. \\ \verb"dd if=bootactv.bin of=/dev/hda bs=446 count=1" \item reboot.\end{itemize}Deinstallation:\begin{itemize} \item boot Linux. \item restore the old MBR, e.g. \\ \verb"dd if=/MBR of=/dev/hda bs=446 count=1" \\ or \verb"FDISK /MBR" under MS-DOS.\end{itemize}If replacing the MBR appears undesirable and if a second Linux partitionexists (e.g. \path{/usr}, \emphasize{not} a swap partition), \name{BOOTACTV}can be merged withthe partition table and stored as the ``boot sector'' of that partition.Then, the partition can be marked active to be booted by the DOS-MBR.Example:\begin{verbatim}# dd if=/dev/hda of=/dev/hda3 bs=512 count=1# dd if=bootactv.bin of=/dev/hda3 bs=446 count=1\end{verbatim}\emphasize{WARNING:} Whenever the disk is re-partitioned, the merged bootsector on that ``spare'' Linux partition has to be updated too.\subsubsection{\LILO\ alone}%%beginskip\boottwo{LILO \sep Linux \\ \branch {\rm other OS}}%%endskip%:\begin{verbatim}%; +----------------------------------------+%; | Master Boot Record Operating system |%; |----------------------------------------|%; | LILO ---------------> Linux |%; | ---> other OS |%; +----------------------------------------+%:\end{verbatim}\LILO\ can also take over the entire boot procedure. If installed as the MBR,\LILO\ is responsible for either booting Linux or any other OS. This approachhas the disadvantage, that the old MBR is overwritten and has to be restored(either from a backup copy, with \verb"FDISK /MBR" on recent versions ofMS-DOS or by overwriting it with something like \name{BOOTACTV}) if Linuxshould ever be removed from the system.You should verify that \LILO\ is able to boot your other operating system(s)before relying on this method.Installation:\begin{itemize} \item boot Linux. \item make a backup copy of your MBR on a floppy disk, e.g. \\ \verb"dd if=/dev/hda of=/fd/MBR bs=512 count=1" \item install \LILO\ with its boot sector as the MBR. \item reboot.\end{itemize}Deinstallation:\begin{itemize} \item boot Linux. \item restore the old MBR, e.g. \\ \verb"dd if=/fd/MBR of=/dev/hda bs=446 count=1"\end{itemize}If you've installed \LILO\ as the master boot record, you have toexplicitly specify the boot sector (configuration variable\craw{boot=}$\ldots$) when updating the map. Otherwise, itwill try to use the boot sector of your current root partition, whichwill usually work, but it will probably leave your system unbootable.\subsubsection{Names}The following names have been used to describe boot sectors or parts ofoperating systems:\begin{description} \item[``DOS-MBR''] is the original MS-DOS MBR. It scans the partition table for a partition that is marked ``active'' and loads the boot sector of that partition. Programs like MS-DOS' \name{FDISK}, Linux \name{fdisk} or \name{activate} (accompanies \LILO) can change the active marker in the partition table. \item[``MS-DOS''] denotes the MS-DOS boot sector that loads the other parts of the system (\path{IO.SYS}, etc.). \item[``COMMAND.COM''] is the standard command interpreter of MS-DOS. \item[``LOADLIN''] is a program that loads a Linux kernel image from an MS-DOS partition into memory and executes it. It is usually invoked from \path{CONFIG.SYS} and is used in combination with a \path{CONFIG.SYS} configuration switcher, like BOOT.SYS.\footnote{ \name{LOADLIN} is available for anonymous FTP from \\ \path{ftp://tsx-11.mit.edu/pub/linux/dos\_utils/lodlin\meta{n}.tar.gz} \\ \path{ftp://sunsite.unc.edu/pub/Linux/system/boot/dualboot/lodlin\meta{n}%.tgz} \\ \name{BOOT.SYS} is available for anonymous FTP from \\ \path{ftp://ftp.funet.fi/pub/Linux/tools/boot142.zip}} \item[``LILO''] can either load a Linux kernel or the boot sector of any other operating system. It has a first stage boot sector that loads the remaining parts of \LILO\ from various locations.\footnote{% \LILO\ can be found in \\ \path{ftp://tsx-11.mit.edu/pub/linux/packages/lilo/lilo-\meta{n}.tar.gz} \\ \path{ftp://sunsite.unc.edu/pub/Linux/system/boot/lilo/lilo-%\meta{n}.tar.gz} \\ \path{ftp://lrcftp.epfl.ch/pub/linux/local/lilo/lilo-\meta{n}.tar.gz}} \item[``BOOTACTV''] permits interactive selection of the partition from which the boot sector should be read. If no key is pressed within a given interval, the partition marked active is booted. \name{BOOTACTV} is included in the \name{pfdisk} package. There are also several similar programs, like PBOOT and OS-BS.\footnote{\name{pfdisk} is available for anonymous FTP from \\ \path{ftp://sunsite.unc.edu/pub/Linux/utils/disk-management/pfdisk.tar.Z} or \\ \path{ftp://ftp.funet.fi/pub/Linux/tools/pfdisk.tar.Z} \\ PBOOT can be found in \\ \path{ftp://ftp.funet.fi/pub/Linux/tools/pboot.zip}}\end{description}\subsection{Choosing the ``right'' boot concept}Although \LILO\ can be installed in many different ways, the choice isusually limited by the present setup and therefore,typically only a small number of configurations which fit naturallyinto an existing system remains. The following sections describe variouspossible cases. See also section \ref{broken}.The configuration file \path{/etc/lilo.conf} for the examplescould look like this:\begin{verbatim}boot = /dev/hda2compactimage = /vmlinuzimage = /vmlinuz.oldother = /dev/hda1 table = /dev/hda label = msdos\end{verbatim}It installs a Linux kernel image (\path{/vmlinuz}),an alternate Linux kernel image (\path{/vmlinuz.old}) anda chain loader to boot MS-DOS from \path{/dev/hda1}. The option \craw{compact}on the second line instructs the map installer to optimize loading.In all examples, the names of the IDE-type hard disk devices(\path{/dev/hda$\ldots$}) are used. Everything applies to other disk types(e.g. SCSI disks; \path{/dev/sda$\ldots$}) too.\subsubsection{BIOS restrictions}\label{broken}Nowadays, an increasing number of systems is equipped with comparably largedisks or even with multiple disks. At the time the disk interface of thestandard PC BIOS has been designed (about 16 years ago), such configurationswere apparently considered to be too unlikely to be worth supporting.The most common BIOS restrictions that affect \LILO\ are the limitation totwo hard disks and the inability to access more than 1024 cylinders perdisk. \LILO\ can detect both conditions, but in order to work around theunderlying problems, manual intervention is necessary.The drive limit does not exist in every BIOS. Some modern motherboardsand disk controllers are equipped with a BIOS that supports more (typicallyfour) disk drives. When attempting to access the third, fourth, etc. drive,\LILO\ prints a warning message but continues. Unless the BIOS reallysupports more than two drives, the system will \emphasize{not} be able toboot in that case.\footnote{However, if only ``unimportant'' parts of thesystem are located on the ``high'' drives, some functionality may beavailable.}The cylinder limit is a very common problem with IDE disks. There, thenumber of cylinders may already exceed 1024 if the drive has a capacityof more than 504 MB. Many SCSI driver BIOSes present the disk geometryin a way that makes the limit occur near 1 GB. Modern disk controllersmay even push the limit up to about 8 GB. All cylinders beyond the1024th are inaccessible for the BIOS. \LILO\ detects this problem andaborts the installation (unless the \craw{linear} option is used, seesection \ref{cfgglo}).Note that large partitions that only partially extend into the ``forbiddenzone'' are still in jeopardy even if they appear to work at first, becausethe file system does not know about the restrictions and may allocatedisk space from the area beyond the 1024th cylinder when installing newkernels. \LILO\ therefore prints a warning message but continues as longas no imminent danger exists.There are four approaches of how such problems can be solved:\begin{itemize} \item use of a different partition which is on an accessible disk and which does not exceed the 1024 cylinder limit. If there is only a DOS partition which fulfills all the criteria, that partition can be used to store the relevant files. (See section \ref{viados}.) \item rearranging partitions and disks. This is typically a destructive operation, so extra care should be taken to make good backups. \item if the system is running DOS or Windows 95, \name{LOADLIN} can be used instead of \LILO. \item if all else fails, installation of a more capable BIOS, a different controller or a different disk configuration.\end{itemize}\LILO\ depends on the BIOS to load the following items:\begin{itemize} \item \path{/boot/boot.b} \item \path{/boot/map} (created when running \path{/sbin/lilo}) \item all kernels \item the boot sectors of all other operating systems it boots \item the startup message, if one has been defined\end{itemize}Normally, this implies that the Linux root file system should be in the``safe'' area. However, it is already sufficient to put all kernels into\path{/boot} and to either mount a ``good'' partition on \path{/boot} orto let \path{/boot} be a symbolic link pointing to or into such apartition.See also \path{/usr/src/linux/Documentation/ide.txt} (or\path{/usr/src/linux/drivers/block/README.ide} in older kernels) for a detaileddescription of problems with large disks.\subsubsection{One disk, Linux on a primary partition}If at least one primary partition of the first hard disk is used as aLinux file system (\path{/}, \path{/usr}, etc. but \emphasize{not} as a swappartition), the \LILO\ boot sector should be stored on that partitionand it should be booted by the original master boot record or by aprogram like \name{BOOTACTV}.%%beginskip$$ \begin{tabular}{r|c|c|}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -