lsg04.htm
来自「linux-unix130.linux.and.unix.ebooks130 l」· HTM 代码 · 共 3,109 行 · 第 1/5 页
HTM
3,109 行
<LI>The delay=<I>secs</I> option gives the time in tenths of a second that the system should wait before booting the image. If no delay is provided, the boot is immediate.
<BR>
<BR>
<LI>The disktab=<I>file</I> option gives the name of the disk parameter table. If no filename is given, /etc/lilo/disktab is used.
<BR>
<BR>
<LI>The fix-table option lets LILO adjust sector/head/cylinder addresses. This option is usually used with operating systems that may change these addresses. LILO readjusts incorrect entries if fix-table is specified.
<BR>
<BR>
<LI>The force-backup=<I>file</I> option is similar to backup, but it overwrites any existing file. If force-backup is used in the configuration options, any other backup option is ignored.
<BR>
<BR>
<LI>The install=<I>sector</I> option installs the image in the specified boot sector. If no value is given, /etc/lilo/boot.b is used.
<BR>
<BR>
<LI>The label=<I>name</I> option renames an image to the alternate string name.
<BR>
<BR>
<LI>The linear option generates linear sector addresses instead of sector/head/cylinder addresses. Linear addresses are independent of disk geometry and are translated in real time. Linear boot disks may not be portable.
<BR>
<BR>
<LI>The literal=<I>string</I> option is similar to the append variable but it removes any other options, using only those specified in <I>string</I>.
<BR>
<BR>
<LI>In the map=<I>file</I> option, <I>file</I> is the map file location. If no value is given, /etc/lilo/map is used.
<BR>
<BR>
<LI>The message=<I>file</I> option uses the contents of <I>file</I> as a message displayed before the boot prompt. The message cannot be larger than 64K. If the message is changed or moved, the map file must be rebuilt.
<BR>
<BR>
<LI>The optional option makes an image optional. If the image's file can't be located, it is not booted. This option is useful for testing new kernels.
<BR>
<BR>
<LI>The password=<I>password</I> option sets a password for all images. If the restricted option exists, a password is required only to boot the image to which the configuration file refers.
<BR>
<BR>
<LI>The prompt option forces the boot prompt without checking for any keypresses. This option is usually combined with the timeout option to force unattended reboots.
<BR>
<BR>
<LI>The ramdisk=<I>size</I> option sets the optional RAM disk to <I>size</I>. A setting equal to zero suppresses the RAM disk.
<BR>
<BR>
<LI>The read-only option mounts the root filesystem as read-only.
<BR>
<BR>
<LI>The read-write option mounts the root filesystem as read-write.
<BR>
<BR>
<LI>The restricted option relaxes password protection.
<BR>
<BR>
<LI>The root=<I>dev</I> option specifies the device to be mounted as the root filesystem. If the value current is used, the root device is the device on which the root filesystem is currently mounted (unless changed with the -r command-line option).
<BR>
<BR>
<LI>The serial=<I>parms</I> option sets a serial line for control, initializing the line and accepting input from it (as well as the console). The format of the parameters is port, baud_rate, parity, bits. When serial is set, the delay value is set to 20 automatically, unless this value is overridden.
<BR>
<BR>
<LI>The timeout=<I>secs</I> option sets the number of tenths of a second that system waits for keyboard input before loading the image. this option is also used to specify password input timeouts. The default value is infinite.
<BR>
<BR>
<LI>The verbose=<I>level</I> option displays progress messages. The higher the level, the more messages are displayed. If the -v command-line option is also included, the highest level specified in either variable is used.
<BR>
<BR>
<LI>The vga=<I>mode</I> option sets the VGA text mode for use during booting. Valid values include normal (80x25 text mode), extended or ext (80x50 text mode), and ask (prompt for the mode during boot). To obtain a list of available modes, boot with the parameter vga=ask and press Enter when asked for a value. Case is not important in the values of the vga option.
<BR>
<BR>
</UL>
<P>If any parameter is not specified either on the command line or in the configuration file, default values are used. Some values are also maintained within the kernel image (such as ramdisk, root, and vga).
<BR>
<BR>
<A NAME="E68E24"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Boot Images</B></FONT></CENTER></H3>
<BR>
<P>LILO can boot a kernel image from several locations, such as a regular file on the root filesystem or any other mounted filesystem, a block device such as a floppy disk, or the boot sector of another partition or disk. The type of boot is dictated by entries in a configuration file. Boot image configuration files can have several variables defined, all of which have been mentioned in the preceding sections. Valid configuration file variables include alias, label, optional, password, ramdisk, read-only, read-write, restricted, root, and vga.
<BR>
<P>To boot a kernel image from a file, all that is necessary in the configuration file is the name of the image. For example, the line
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">image=/linux_main</FONT></PRE>
<P>boots the image called linux_main.
<BR>
<P>To boot an image from another device, the sectors that must be read on that device have to be specified. Several methods of providing the sector information exist. The starting sector must be provided, but you can then either specify a number of sectors to be read (start+length) or the end sector number (start-finish). If only one number is provided (the start sector), only that sector is read.
<BR>
<P>For example, the contents of this configuration file
<BR>
<PRE>
<FONT COLOR="#000080">image=/dev/fd0
range=1+512</FONT></PRE>
<P>will boot the kernel from the floppy disk, starting at sector 1 and reading the next 512 sectors.
<BR>
<P>You can specify more than one configuration for an image because LILO stores values in an image descriptor file and not in the image itself. For example, a configuration file can contain the following entries:
<BR>
<PRE>
<FONT COLOR="#000080">image=/linux_main
label=linux-hda1
root=/dev/hda1
image=/linux_main
label=linux-hda3
root=/dev/hda3
image=/linux_main
label=linux-flop
root=/dev/fd0</FONT></PRE>
<P>This code has three configurations for the same Linux kernel (linux_main), but it also has different root devices with three different alternate names. The boot devices for the image are /dev/hda1, /dev/hda3, and /dev/fd0 respectively. Whitespace in the configuration file is ignored, so the indentations are for ease of reading only.
<BR>
<BR>
<A NAME="E68E25"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Disk Parameter Table</B></FONT></CENTER></H3>
<BR>
<P>LILO is usually able to obtain information about the hard disks and floppy disks on the system by reading the kernel. On some systems(especially some SCSI adapters and adapters that do not behave as IDE or SCSI normal devices), though, this isn't possible. When LILO can't obtain the disk parameter information, it generates an error message about "bad geometry."
<BR>
<P>The disk parameters can be physically read by LILO from the file /etc/lilo/disktab, which exists only with some versions of Linux. When the disktab file exists, it takes precedence over any auto-detected values. The disktab file contains the device number (hexadecimal), its BIOS code, and the disk geometry. A sample disktab file could have the following entries:
<BR>
<PRE>
<FONT COLOR="#000080"># /etc/lilo/disktab - LILO disk paramter table
#
# Dev. num BIOS code Secs/track Heads/cyl Cyls Part. Offset
#
0x800 0x80 32 64 1714 0
0x801 0x80 32 64 1714 1001</FONT></PRE>
<P>This example shows a SCSI disk with two partitions. The first partition /dev/sda1 has a device number 800, and the second partition /dev/sda2 has the device number 801. Both partitions have the BIOS code 80. Both the device number and BIOS code have to be given in hex format, which accounts for the leading 0x. The disk has 32 sectors per track, 64 heads per cylinder, and 1714 cylinders. Because both partitions are on the same disk, these parameters will be the same.
<BR>
<P>The partition offset is an optional field. The first partition starts at offset 0, and the second starts at offset 1001 (the number of sectors from the start of the disk). The partition offsets need only be explicitly given when the kernel cannot obtain that information. Most hard disks (including removable and optical disks) don't need the partition offsets, but CD-ROMs sometimes do.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>When filling in the /etc/lilo/disktab file you don't have to have the details exactly right. Most systems will remap the drive parameters to 32 sectors per track and 64 heads, whether those numbers are correct or not. (This is a BIOS action.) The number of cylinders must be at least equal to or higher than the number of actual cylinders to avoid truncation of the disk space the operating system recognizes.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<P>Some BIOS versions will not allow disks exceeding certain values. This problem usually occurs with IDE and SCSI controller cards that are designed for DOS systems with relatively small (<1G) disk drives and older BIOSs. Device drivers allow some high-capacity drives to be used, although some systems will have a problem accessing files beyond the 1G limit.
<BR>
<BR>
<A NAME="E68E26"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Removing or Disabling LILO</B></FONT></CENTER></H3>
<BR>
<P>To prevent LILO from booting the system, you must disable the boot sector (by using fdisk to change the active partition) or remove it completely. Most versions of LILO can be quickly disabled with the command
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">/etc/lilo/lilo -u</FONT></PRE>
<P>If you are using the newer directory structure, substitute the pathname as necessary. Some later versions of LILO use the menu-driven setup utility instead of a lilo binary. In most cases, there is a file called /etc/lilo/install that can accomplish the same procedures.
<BR>
<P>When removing a LILO boot sector in the Master Boot Record of the disk, you must replace the MBR with another record. If you want to replace the MBR with a DOS MBR, from a booted DOS floppy disk, enter the command
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">fdisk /mbr</FONT></PRE>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?