- Использование LILO
- Д.Колисниченко
- Другие возможности настройки LILO
- Параметры командной строки
- Configuring LILO, the Linux LoaderВ¶
- What is LILO?В¶
- The /etc/lilo.conf FileВ¶
- boot=/dev/hda В¶
- map=/boot/map В¶
- install=/boot/boot.b В¶
- compact В¶
- prompt В¶
- timeout=50 В¶
- image=/boot/vmlinuz-2.0.36 В¶
- label=linux В¶
- root=/dev/hda2 В¶
- read-only В¶
- other=/dev/hda1 В¶
- label=win В¶
- Applying ChangesВ¶
- Recovering a Lost LILOВ¶
- Removing LILOВ¶
- LILO UsageВ¶
- ResourcesВ¶
- Lilo linux and linux
- Contents
- Installation
- Configuration
- Sample setup
- Using an image as background
- Pacman hook
- Troubleshooting
- Read write error message whilst booting
- Devmapper not found error message after kernel upgrade
Использование LILO
Д.Колисниченко
LInux LOader (LILO) — программа, предназначенная для загрузки Linux и других операционных систем.
Существуют другие загрузчики, например bootlin, bootact, bootstar, но они постепенно вытесняются LILO.
Помимо LILO Linux еще можно загрузить с помощью loadlin, GRUB (загрузчик в Linux Mandrake) или NTLoader.
Подробнее об использовании NTLoader и программы loadlin можно прочитать в моей статье «Многоосность»
LILO состоит из трех частей:
- программа записи начального загрузчика lilo
- программа конфигурации liloconf
- файл конфигурации /etc/lilo.conf
Liloconf создает файл /etc/lilo.conf, который используется программой lilo для записи начального загрузчика.
Обычно LILO помещают в MBR (Master Boot Record). Но иногда LILO устанавливают на первый сектор того раздела, где установлен Linux. Второй способ обычно используется, если нужно обеспечить загрузку Linux:
- с помощью другого загрузчика, например NTLoader
- на старых машинах без поддержки LBA
При загрузке компьютера LILO выдает подсказку
LILO
или
LILO boot:
После чего нужно ввести метку той операционной системы, которую нужно загрузить. Для загрузки Linux обычно следует ввести linux. Для просмотра всех доступных меток, нажмите Tab. Современные версии LILO обычно имеют удобное меню. Выбор меток осуществляется с помощью стрелок.
Иногда на экран только выдается подсказка
LILO
Чтобы выбрать ядро нужно нажать клавишу Shift, после чего появиться подсказка
LILO boot:
и только теперь можно нажать Tab. Если вы введете команду help, то получите список всех команд LILO.
Примечание: поведение LILO зависит от его настройки в файле /etc/lilo.conf.
При запуске Linux можно передать ядру дополнительные параметры, например mem=1024M — устанавливает объем ОЗУ равным 1024MB. Можно сформировать строку параметров и записать ее в lilo.conf — эта строка будет передана ядру при загрузке Linux.
С помощью LILO можно организовать загрузку других операционных систем (Windows, FreeBSD. ) и загрузку разных версий ядра одной ОС (имеется в виду Linux).
Пример конфигурационного файла /etc/lilo.conf
Операционная система: Linux Mandrake 7.2
LILO version: 21.5
Для того, чтобы изменения вступили в силу (если вы изменили файл конфигурации), нужно выполнить команду lilo
Другие возможности настройки LILO
disk=параметры | Определяет нестандартные параметры для заданного диска |
disktab=файл_таблицы | Задает имя таблицы параметров диска. По умолчанию /etc/disktab. Использовать не рекомендуется |
ignore-table | Игнорирование ошибочных таблиц разделов |
nowarn | Запрещает сообщения о возможных неприятностях |
serial=параметры | Разрешает управление с последовательной линии. Загрузчик берет ввод из заданного последовательного порта и из клавиатуры. break по последовательной линии аналогична shift на клавиатуре. Параметры: |
[,bps[parity[bits]]]
port = 0..3 соответствует /dev/ttyS0 — /dev/ttyS3. Могут быть задействованы все 4 порта.
bps: скорость порта в бодах. По умолчанию 2400
Поддерживаются значения: 110, 150, 300, 600, 1200, 2400, 4800, 9600
parity: контроль по четности. n — без четности, e= — по четности, o — по нечетности
bits: число битов в символе — 7 или 8. По умолчанию 8, если нет контроля четности
Параметры по умолчанию
0,2400n8
Параметры append, ramdisk, read-only, read-write, root, vga могут быть заданы в разделе глобальный параметров.
Они будут использованы если они не заданы в конфигурационных секциях.
Параметры командной строки
Здесь описаны самые используемые параметры lilo. Для более подробного описания, введите man lilo
Источник
Configuring LILO, the Linux LoaderВ¶
What is LILO?В¶
LILO is the LInux LOader, the most popular boot loader for Linux. (For some background on boot loaders, see Choosing a Boot Loader ) It is used to load Linux into memory and start the operating system. On a machine with multiple operating systems, LILO can be configured to boot the other systems as well.
Normally LILO is initially configured for you during the Linux installation process. However, you may find that default configuration is not correct, or you wish to customize it. And there may even come a time when you need to remove LILO from your computer. Here are some instructions that should help you on your quest.
The /etc/lilo.conf FileВ¶
As with many Linux utilities, LILO can be customized with a configuration file in the /etc directory. The lilo.conf file has its own man page which is quite thorough. In fact, it may be a little too thorough for simple configuration. So here’s the lowdown on your basic lilo.conf file.
The sample lilo.conf file shown below is for a typical dual-boot configuration, with Windows installed on the first partition and Linux on the second. You can probably use this as-is, except for the image= line and possibly the root= line, depending on where Linux was installed. Detailed explanation follows.
boot=/dev/hda В¶
Tells LILO where to install the bootloader. In this case, it is going into the master boot record of the first hard drive, which means LILO will control the boot process of all operating systems from the start. It could also have been /dev/hda2 , the boot sector of the Linux partition. In that case, the DOS bootloader would need to be in the master boot record, and booting Linux would require setting the Linux partition active using fdisk.
map=/boot/map В¶
The map file is automatically generated by LILO and is used internally. Don’t mess with it.
install=/boot/boot.b В¶
Tells LILO what to use as the new boot sector. This file contains the “bootstrap” code that starts your operating system. Don’t mess with it.
compact В¶
Makes LILO read the hard drive faster. Normally you want this, but some older systems may hang. Remove it if yours is one of these.
prompt В¶
Tells LILO to prompt us at boot time to choose an operating system or enter parameters for the Linux kernel. Keep this.
timeout=50 В¶
Tells LILO how long to wait at the prompt before booting the default operating system, measured in tenths of a second. The configuration shown waits for 5 seconds. If timeout is 0 or not present, LILO waits forever (if prompt is specified, otherwise boots the default immediately).
image=/boot/vmlinuz-2.0.36 В¶
The name of a Linux kernel for LILO to boot. This begins a section, and the lines that follow give specific parameters for this particular kernel. You may have up to sixteen image sections, but one should suffice. The first image listed in the file is the default, unless you specify otherwise.
label=linux В¶
The name that is used to identify this image at the LILO: boot prompt. Typing this name will select this image. When asked to list the available images (by pressing TAB at the LILO: prompt), LILO will display this name in the list.
root=/dev/hda2 В¶
Tells LILO where the root (/) file system is (in other words, where Linux lives), so that the Linux kernel can mount it at boot time. Unless you are doing something extremely high-tech, all your images should use the same root= parameter. In my case, Linux is installed in the second primary partition.
read-only В¶
Tells LILO to instruct the Linux kernel to initially mount the root file system as read-only. It will be remounted as read-write later in the boot process. This is the normal method of booting Linux. Don’t change it unless you are sure you know what you are doing.
other=/dev/hda1 В¶
Like the image line, this begins a section. other tells LILO to boot an operating system other than Linux. It is given the value of the partition where this other operating system lives. LILO will simply load and execute the boot sector of this partition at boot time.
label=win В¶
Same as the label above, gives you a way to refer to this section.
By copying this basic layout, you should be able to get LILO to boot Windows or any new Linux kernels you build. Before you begin editing, make sure you create a backup copy of the original lilo.conf just in case something goes wrong. And don’t forget to apply your changes!
Applying ChangesВ¶
Anytime you edit the /etc/lilo.conf , or if you move or rename any of the files used by LILO, including the Linux kernel itself (the vmlinuz file), you must apply your changes before they will take effect. Failing to do so might cause LILO to be unable to boot Linux!
To apply changes, run the following command (you will need to be SuperUser ):
You should get a response that looks like this:
The asterisk * indicates the default boot image. If you see anything other than this, something went wrong. Go back through your lilo.conf and read the man page to see what it was.
Recovering a Lost LILOВ¶
If you reinstall DOS or Windows after installing LILO, you may find that the LILO: boot prompt no longer appears. This might also occur if certain disk utilities or anti-virus utilities attempt to “repair” your master boot record. (Some anti-virus programs will see LILO as a virus!)
To fix this, you just need to reinstall LILO. That means you have to boot into Linux some other way, either using Loadlin or a Linux boot floppy. (See Choosing a Boot Loader ). At the Linux command prompt just type /sbin/lilo as described under Applying Changes. When you reboot, LILO will be back where it belongs!
Removing LILOВ¶
If you have LILO installed as your master boot record and you decide to uninstall Linux or upgrade your hard drive, you will need to remove LILO from the master boot record before you remove it’s files from the hard drive. LILO makes a backup copy of your original master boot record before it installs itself. To remove LILO and return to the original, issue this command:
If this fails for some reason, consult the LILO documentation for alternatives.
If the LILO files have already been removed, or you are unable to coax LILO into removing itself, try using the DOS fdisk program to rebuild the master boot record with this command (from a DOS boot floppy):
LILO UsageВ¶
At boot time, LILO will present you with a boring prompt:
If you do nothing, LILO will wait the amount of time specified in its configuration file and then boot the default operating system image. You can choose an operating system image to boot by typing its label here. If you can’t remember what the labels are, press the TAB key to see a list. The default image is normally labelled “linux”. If your lilo.conf was built by the Linux setup program, you may also have one called “dos” that boots the DOS or Windows partition.
If you need to pass special parameters to the Linux kernel, you can do it by typing them after the image name. For example, if you need to login to Linux in single-user mode to repair a damaged system (or because you forgot the root password), you can type:
Or if that fails, try:
See the BootPrompt How-To for more neat things you can do at the LILO: prompt.
ResourcesВ¶
man pages: lilo, lilo.conf
Documentation: /usr/doc/lilo-*/ contains a very thorough, printable postscript User Guide, with source.
Источник
Lilo linux and linux
The LInux LOader, or LILO for short, is a legacy multi-boot loader for Linux systems. In spite of being the standard choice over the course of several years, it has been slowly phased out. As of January 2016, LILO is no longer actively developed.
Contents
Installation
LILO is available as lilo AUR and lilo-git AUR (the development version). LILO only works on BIOS systems.
Running the command lilo (as root) will install LILO to the MBR. Before running the lilo command you should edit /etc/lilo.conf to ensure that the root entry points towards the root partition. If your root partition is on /dev/sda1 then the root entry should look like this: root=/dev/sda1 . Remember to change the root line for both the ‘arch’ and the ‘arch-fallback’ entries.
Configuration
LILO is configured by editing the /etc/lilo.conf file and running lilo afterwards to apply the new configuration.
As a reminder, consider that LILO needs to be run after every kernel upgrade, otherwise the system is likely to be left in an unbootable state.
More help on setting up LILO can be found in the LILO-mini-HOWTO.
Sample setup
A typical LILO setup:
You can use hwinfo —framebuffer to determine what vga modes you can use.
Using an image as background
First prepare the background image:
- Open it in GIMP.
- Scale it to 640×480.
- Change it to indexed mode (Image > Mode > Indexed).
- Select Create optimal palette and set it to 16 colours. Choose whatever dithering method suits you.
- Open the «Indexed Palette» dialog. Make note of which colours you want to use for menu text entries, the clock, etc. In your lilo.conf , you refer to the colours by index.
- Export the image as a bmp in your /boot directory. In Export dialog check option Do not write color space information
Now edit lilo.conf . There are a few options that can be set for your graphical menu. See man lilo.conf for more information.
- bitmap= Set this to the file that you saved above.
- bmp-colors= , , , , ,
These are the colours of the entries in the menu. They refer to the foreground, background, and shadow colours respectively, followed by the same for highlighted text. Do not use spaces. The values used are indices into the colour palette that you discovered in the previous step. If you choose, you can leave a value blank (but do not forget the comma). The default background is transparent, the default shadow is to have none.
- bmp-table= , , , , , This option specifies where the menu is placed. x and y are the character coordinates. You can also suffix them with a p to specify pixel coordinates.
- bmp-timer= , , , , This option specifies the coordinates and colour of the timer that counts down the timeout before booting a default entry. It uses colour indices for the colours, and character (or pixel) coordinates.
Save lilo.conf , run lilo as root, and reboot and see how it looks!
Pacman hook
lilo needs to be run after every kernel update. You can use a pacman hook to automate it. See Pacman#Hooks or alpm-hooks(5) .
Make the directory /etc/pacman.d/hooks if it does not already exist.
Troubleshooting
Read write error message whilst booting
This error message is caused by a change in mkinitcpio which was in response to this Systemd commit. The change causes partitions to be fsck’ed twice when mounted read only. To fix this error edit /etc/lilo.conf and change the ‘read only’ line to ‘read write’ for both arch entries.
See this forum thread for more information.
Devmapper not found error message after kernel upgrade
It is possible that running the lilo command after a kernel upgrade results in a devmapper not found error. If this is the case run modprobe dm-mod before running lilo after a kernel upgrade.
Источник