?? readme
字號:
| | | +--------------------------------------------+The entire disk can be accessed as /dev/hda, /dev/hdb, /dev/sda, etc. The primary partitions are /dev/hda1 ... /dev/hda4. +--------------------------------------------+ | Partition table /dev/hda | | +------------------------------------------| | | Partition 1 /dev/hda1 | | | | | |------------------------------------------| | | Partition 2 /dev/hda2 | | | | | |------------------------------------------| | | Extended partition /dev/hda3 | | | +----------------------------------------| | | | Extended partition table | | | |----------------------------------------| | | | Partition 3 /dev/hda5 | | | | | | | |----------------------------------------| | | | Extended partition table | | | |----------------------------------------| | | | Partition 4 /dev/hda6 | | | | | +--------------------------------------------+This hard disk has two primary partitions and an extended partition that contains two logical partitions. They are accessed as /dev/hda5 ...Note that the partition tables of logical partitions are not accessible as the first blocks of some devices, while the main partition table, all boot sectors and the partition tables of extended partitions are.Partition tables are stored in partition boot sectors. Normally, only the partition boot sector of the entire disk is used as a boot sector. It is also frequently called the master boot record (MBR). Its structure is as follows: +------------------------+ 0x000 | | | Program code | | | | | |------------------------| 0x1BE | Partition table | | | |------------------------| 0x1FE | Magic number (0xAA55) | +------------------------+The LILO boot sector is designed to be usable as a partition boot sector. (I.e. there is room for the partition table.) Therefore, the LILO boot sector can be stored at the following locations: - boot sector of a Linux floppy disk. (/dev/fd0, ...) - MBR of the first hard disk. (/dev/hda, /dev/sda, ...) - boot sector of a primary Linux file system partition on the first hard disk. (/dev/hda1, ...) - partition boot sector of an extended partition on the first hard disk. (/dev/hda1, ...)* * Most FDISK-type programs don't believe in booting from an extended partition and refuse to activate it. LILO is accompanied by a simple program (activate) that doesn't have this restriction. Linux fdisk also supports activating extended partitions.It _can't_ be stored at any of the following locations: - boot sector of a non-Linux floppy disk or primary partition. - a Linux swap partition. - boot sector of a logical partition in an extended partition.* - on the second hard disk. (Unless for backup installations, if the current first disk will be removed or disabled, or if some other boot loader is used, that is capable of loading boot sectors from other drives.) * LILO can be forced to put the boot sector on such a partition by using the -b option or the BOOT variable. However, only few programs that operate as master boot records support booting from a logical partition.Although LILO tries to detect attempts to put its boot sector at an invalid location, you should not rely on that.Booting basics--------------When booting from a floppy disk, the first sector of the disk, the so-called boot sector, is loaded. That boot sector contains a small program that loads the respective operating system. MS-DOS boot sectors also contain a data area, where disk and file system parameters (cluster size, number of sectors, number of heads, etc.) are stored.When booting from a hard disk, the very first sector of that disk, the so-called master boot record (MBR) is loaded. This sector contains a loader program and the partition table of the disk. The loader program usually loads the boot sector, as if the system was booting from a floppy.Note that there is no functional difference between the MBR and the boot sector other than that the MBR contains the partition information but doesn't contain any file system-specific information (e.g. MS-DOS disk parameters).The first 446 (0x1BE) bytes of the MBR are used by the loader program. They are followed by the partition table, with a length of 64 (0x40) bytes. The last two bytes contain a magic number that is sometimes used to verify that a given sector really is a boot sector.There is a large number of possible boot configurations. The most common ones are described in the following sections.MS-DOS alone- - - - - - +-------------------------------------------------------+ | Master Boot Record Boot sector Operating system | |-------------------------------------------------------| | DOS-MBR ------------> MS-DOS ------> COMMAND.COM | +-------------------------------------------------------+This is what usually happens when MS-DOS boots from a hard disk: the DOS-MBR determines the active partition and loads the MS-DOS boot sector. This boot sector loads MS-DOS and finally passes control to COMMAND.COM. (This is greatly simplified.)LOADLIN- - - - +------------------------------------------------------------+ | Master Boot Record Boot sector Operating system | |------------------------------------------------------------| | DOS-MBR ------------> MS-DOS ------> COMMAND.COM | | ---> LOADLIN ------> Linux | +------------------------------------------------------------+A typical LOADLIN setup: everything happens like when booting MS-DOS, but in CONFIG.SYS or AUTOEXEC.BAT, LOADLIN is invoked. Typically, a program like BOOT.SYS is used to choose among configuration sections in CONFIG.SYS and AUTOEXEC.BAT. This approach has the pleasant property that no boot sectors have to be altered.Please refer to the documentation accompanying the LOADLIN package for installation instructions and further details.LILO started by DOS-MBR- - - - - - - - - - - - +-------------------------------------------------------+ | Master Boot Record Boot sector Operating system | |-------------------------------------------------------| | DOS-MBR ------------> LILO --------> Linux | | ---> other OS | +-------------------------------------------------------+This is a "safe" LILO setup: LILO is booted by the DOS-MBR. No other boot sectors have to be touched. If the other OS (or one of them, if there are several other operating systems being used) should be booted without using LILO, the other partition has to be marked "active" with fdisk or activate.Installation: - install LILO with its boot sector on the Linux partition. - use fdisk or activate to make that partition active. - reboot. Deinstallation: - make a different partition active. - install whatever should replace LILO and/or Linux. Several alternate branches- - - - - - - - - - - - - +------------------------------------------------------------+ | Master Boot Record Boot sector Operating system | |------------------------------------------------------------| | DOS-MBR ------------> MS-DOS ------> COMMAND.COM | | ---> LOADLIN ------> Linux | | ---> LILO --------> Linux | | ---> MS-DOS --- ... | +------------------------------------------------------------+An extended form of the above setup: the MBR is not changed and both branches can either boot Linux or MS-DOS. (LILO could also boot other operating systems.)LILO started by BOOTACTV*- - - - - - - - - - - - - * Other, possibly better known boot switchers, e.g. OS/2 BootManager operate in a similar way. The installation procedures typically vary. +-------------------------------------------------------+ | Master Boot Record Boot sector Operating system | |-------------------------------------------------------| | BOOTACTV -----------> LILO --------> Linux | | ---> other OS | +-------------------------------------------------------+Here, the MBR is replaced by BOOTACTV (or any other interactive boot partition selector) and the choice between Linux and the other operating system(s) can be made at boot time. This approach should be used if LILO fails to boot the other operating system(s).* * And the author would like to be notified if booting the other operating system(s) doesn't work with LILO, but if it works with an other boot partition selector.Installation: - boot Linux. - make a backup copy of your MBR on a floppy disk, e.g. dd if=/dev/hda of=/fd/MBR bs=512 count=1 - install LILO with the boot sector on the Linux partition. - install BOOTACTV as the MBR, e.g. dd if=bootactv.bin of=/dev/hda bs=446 count=1 - reboot. Deinstallation: - boot Linux. - restore the old MBR, e.g. dd if=/MBR of=/dev/hda bs=446 count=1 or FDISK /MBR under MS-DOS. If replacing the MBR appears undesirable and if a second Linux partition exists (e.g. /usr, _not_ a swap partition), BOOTACTV can be merged with the 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:# dd if=/dev/hda of=/dev/hda3 bs=512 count=1# dd if=bootactv.bin of=/dev/hda3 bs=446 count=1_WARNING:_ Whenever the disk is re-partitioned, the merged boot sector on that "spare" Linux partition has to be updated too.LILO alone- - - - - +----------------------------------------+ | Master Boot Record Operating system | |----------------------------------------| | LILO ---------------> Linux | | ---> other OS | +----------------------------------------+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 approach has the disadvantage, that the old MBR is overwritten and has to be restored (either from a backup copy, with FDISK /MBR on recent versions of MS-DOS or by overwriting it with something like BOOTACTV) if Linux should 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: - boot Linux. - make a backup copy of your MBR on a floppy disk, e.g. dd if=/dev/hda of=/fd/MBR bs=512 count=1 - install LILO with its boot sector as the MBR. - reboot. Deinstallation: - boot Linux. - restore the old MBR, e.g. dd if=/fd/MBR of=/dev/hda bs=446 count=1 If you've installed LILO as the master boot record, you have to explicitly specify the boot sector (configuration variable BOOT=...) when updating the map. Otherwise, it will try to use the boot sector of your current root partition, which will usually work, but it will probably leave your system unbootable.Names- - -The following names have been used to describe boot sectors or parts of operating systems: "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' FDISK, Linux fdisk or activate (accompanies LILO) can change the active marker in the partition table.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -