Discussion on Several Problems of Linux Lilo

zhaozj2021-02-11  222

Discussion on Several Problems of Linux Lilo

Linux guidance can be used in a variety of ways, and its loader LILO (Linux Loader) is a flexible bootloader that is more artistic, and the in-depth understanding of the LILO ( Helps us to handle multiple difficulties such as multiple systems, network boots, large hard drives and large memory. First, LILO's boot mechanism is well known that the initial start of the computer is controlled by the BIOS. After initialization of some hardware (eg: memory, keyboard, etc.), it will try to load the hard disk's main boot record (MBR) or floppy guide fan Area. The MBR can operate in two ways, which is positioned to the active partition and load the corresponding guiding sector, and then complete the loading of the basic components of the operating system within the partition; second, it is loaded directly from a designated partition. Information, and through which boot loaders such as LILO, OS / 2 Boot Loader and Partition Magic can be configured in this way. The boot sector of the floppy is equivalent to the boot sector of the hard disk activity partition, which is usually used to load the operating system on the floppy disk. From this, it can be seen that as long as the LILO is installed on the MBR, the active partition, or the boot floppy disk, it can take over the control of the computer, and then the subsequent boot process is completed by LILO. It is built in LILO to include a list of tabs, where it can be positioned to Linux kernel files, which can be linearly linear of LBA according to the cylindrical / head / sector (CHS) mode. Block mode, therefore, even if some SCSI control program LILO can operate well. When LILO is positioned, after the pre-boot process, the prompt: LILO BOOT: At this point, the system allows the selection to boot different operating systems or different kernel configurations, press the Tab key to display the option list, then enter optional Or directly enter from the default configuration, if you select boot Linux, you can also transfer parameters to the system kernel. Compared to other system boot loaders, LILO has greater flexibility, and its boot method is also more colorful. ● When LILO is installed on the MBR, active partition, or boot floppy disk of the hard disk, it is a substitute for the original bootstrap, which can boot any hard disk for Linux and other operating systems on either partition; ● In addition to the guiding sector, it does not Any hidden file, nor does it need to use a specific partition, which can be used in any partition, or even stored in a subdirectory of the DOS partition with Linux; ● It can boot several different kernel configurations Even a few different kernels; ● It can guide multiple Linux versions on the same machine; ● It boots Linux from the network. The flexibility of LILO makes its configuration is quite complicated. When there are multiple systems coexisting, it is recommended to install other operating systems first, and then load Linux so that LILO is relatively simple. Second, several important LILO boot parameters LILO's boot parameters have a lot, only for some important parameters. 1. "Boot =" This parameter indicates a device name (such as / dev / had) containing the boot sector. If this item is ignored, the leading sector is read from the current root partition.

2. "root =" This parameter tells the kernel which device is used as the root file system when the set value is used as the root file system, and the device name available for the root file system is: (1) / dev / hdan ~ / dev / hddn: ST-506 compatible with hard disk, N partitions (2) / dev / sdan ~ / dev / sden: SCSI compatible hard disk, N partitions (3) / DEV / XDan ~ / dev / xdbn: XT compatible hard disk, N partitions (4) / dev / fdn: floppy disk, A: (n = 0) or B: (n = 1) (5) / DEV / NFS: Signs of the root file system by the network 3. "NFSROOT =" If you need to provide the root file system through NFS to boot the disk-free workstation, this parameter specifies the ride, directory, and NFS where the network root file system is located. The format is: nfsroot = (:) (, nfs_options>) 4. "NFSADDRS =" Sets the various network interface addresses required for network communication, if there is no such parameter, the core will try to use the reverse Address Analysis Agreement (RARP) or Start Agreement (Bootp) identifies: nfsaddrs = : : : : : : 5. "Image =" Specifies the Linux kernel file. 6. "DELAY =" setting the waiting time before booting the first image. 7. "Disk =" This parameter defines a non-standard parameter for a particular hard disk. 8. "Append =" transmits an optional parameter line for the kernel, and the typical application is to specify parameters for hard disk automatically identify by the system, such as: append = "hd = 64, 32, 202" 9. "label =" This parameter specifies a name for each image for booting. 10. "Read-Only" settings in a read-only mode to root file system for File System Consistency Check (FSCK). 11. "Install =" Install a specified file as a new boot sector, default to /boot/boot.b. 12. "Loader =" Description The chain loader used, defaults to /boot/chain.b, if not started from the first hard disk or floppy disk, then this option must be explained. 13. "Table =" describes the device name containing the partition table. If this parameter is ignored, the bootloader will not pass the partition information to the bootable operating system. When the partition table pointed to this parameter is modified, the / sbin / lilo must be re-run. 14. The program executed when the kernel initialization is initialized, and the process is usually in init, getty, rc, and sh, version 1.3.43 to execute / sbin / init description command line, if there is a problem during the boot process If INIT = / bin / sh can be set directly to the shell.

15. "Ramdisk_start =" Since the kernel cannot be placed in a compressed memory file system image, in order to put the kernel image and the compressed memory image is placed in a floppy disk, add "ramdisk_start = ", so the kernel can start execution . 16. "MEM =" The purpose of this parameter is the number of memory used for Linux: such as MEM = 96MB, the purpose of the purpose is that the MEM = NOPENTIUM tells the kernel not to use the 4MB pagination table. 17. "VGA =" Sets the display mode, such as 80 × 50, 132 × 44, etc. Third, LILO typical configuration method usually, Linux's installer itself can complete the LILO installation configuration, which better solves the multi-system boot problem. If the system cannot automate this configuration, you can modify the configuration file manually. /etc/lilo.conf to achieve guidance under different conditions. 1. There is only one suggestion when the system can automatically complete the configuration: install lilo to the root of the Linux partition, not MBR. Suppose there is DOS / Windows in the current HDA1 installed Linux, and /etc/lilo.conf is approximately as follows: boot = / dev / hda2 # Specify boot position compact delay = 50 # delay 5 second root = current # 根 根 当 i = = / boot / vmlinuz # Specifies Linux kernel file label = linux # with linux to represent name other = / dev / hda1 # Other operating systems The partition Table = / dev / had # specifies the partition table Hard disk label = DOS # with DOS representative name 2. When the system cannot automatically complete the configuration, the system cannot automatically complete the configuration. It is not more than two: (1) BIOS can't see the root partition of Linux directly; (2) BIOS You can only read the first 504MB of the standard IDE hard drive. At this time, you must follow a basic principle: establish a smaller Linux partition that BIOS can access, which contains the necessary contents such as kernel files, mapping files, and link loaders, and roots can be another independent partition. As for other details on the configuration, we will explain the following examples. Example 1: The main hard disk is an IDE interface, the second hard disk is the SCSI interface, and the root file is on SCSI.

Countermeasure: A smaller Linux partition (/ DEV / HDA2) is divided on the IDE hard disk, which contains basic files, histed to / u2, the main content of its configuration file /etc/lilo.conf is: boot = / dev / hda #lilo MBR Install = / U2 / etc / boot.b # 主 主 安装 安装 安装 安装 m m 安装 安装 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件Boot the location of the program internal nuclear block compact timeout = 50 image = / u2 / vmlinuz # kernel file should be copied in advance to / u2 Label = Linux root = / dev / sda1 # Tell the kernel root system on the SCSI hard disk Read-Only Other = / dev / hda1 loader = / u2 / etc / lilo / chain.b # Indicates Loader Label = DOS Example 2: A standard IDE big hard disk needs to be installed Linux and DOS / Windows. For big hard disk problems, many people only know less than 1024 cylinders, and I don't know why standard IDE hard disks can only recognize 504MB. In fact, the BIOS's INT13 call is a CHS code of three bit yuan groups. 10 bits are column, 8 bits are magnetic head numbers, and 6 are sector numbers. The possible cylindrical number is 0 ~ 1023, the possible head number is 0 ~ 255, and the possible sector number on the track is 1 ~ 63, and the 24 bits can be addressed up to 8455716864 bit tuples (7.875GB). But unfortunately, the standard IDE interface allows 256 sectors / tracks, 65536 cylinders and 16 heads. Itself can access 237 = 137438953472 (128 GB), but there are only 63 sectors of the BIOS and 1024 cylindrical restrictions, only 528482304 (504 MB) can be derived. Countermeasure: 350MB (/ dev / hda1) is divided into DOS, 150MB (/ DEV / HDA2) in the top 500MB of the hard disk to Linux, and the parameters of the hard disk should be explained in the corresponding configuration file. Boot = / dev / hda ... ... disk = / dev / hda bios = 0x80 Sectors = 63 Heads = 16 cylinders = 2100 image = / vmlunuz append = "hd = 2100, 16, 23" root = / dev / HDA2 Label = Linux 4, LILO's uninstallation If you want to delete Linux from your hard drive, you can use your hard drive from your hard drive. However, LILO will remain there and will try to boot Linux each time the hard disk is started (or even all files are deleted). This situation only occurs when LILO is written to MBR. There are two ways to delete LILO. When LILO covers the boot sector, it retains a backup of a boot sector in /boot/boot.xxyy, where xxyy is a 16-en-applied device master / sub-number (Major / minor number), using command "LS -l / dev / device "to get the main / sub-number of the hard disk or partition. If these backup files already exist, then when you reinstall the LILO or reconstruct the kernel, it will not regenerate this file, which ensures that this backup file is the most original boot sector.

转载请注明原文地址:https://www.9cbs.com/read-3635.html

New Post(0)