File: user.tex

package info (click to toggle)
lilo 21-4
  • links: PTS
  • area: main
  • in suites: slink
  • size: 812 kB
  • ctags: 895
  • sloc: ansic: 3,420; asm: 2,546; sh: 767; perl: 607; makefile: 193; cpp: 3
file content (3385 lines) | stat: -rw-r--r-- 143,472 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
%
% Copyright 1992-1998 by Werner Almesberger.
% All rights reserved.
%
% See file COPYING for details.
%

%%def%:=
%:\begin{verbatim}
%:LILO - Generic Boot Loader for Linux ("LInux LOader") by Werner Almesberger
%:===========================================================================
%:
%:Version 21
%:
%:Important: The file INCOMPAT contains vital (in)compatibility information
%:           for this release of LILO. Read it before proceeding.
%:
%:Installing boot loaders is inherently dangerous. Be sure to have some means
%:to boot your system from a different media if you install LILO on your hard
%:disk.
%:
%:
%:There is also a LaTeX version of this document in the "doc" directory.
%:It is much nicer to read than pure ASCII.
%:
%:
%:Installation
%:------------
%:
%:Please read the file INCOMPAT for compatibility notes.
%:
%:The installation procedure is described in the section "Normal first-time
%:installation". Please read "Booting basics" for the whole story.
%:
%:*** QUICK INSTALLATION ***
%:
%:    If you want to install LILO on your hard disk and if you don't want
%:    to use all its features, you can use the quick installation script.
%:    Read QuickInst for details.
%:
%:
%:\end{verbatim}

%%beginskip
\documentstyle[fullpage]{article}

\parindent=0pt
\parskip=4pt
\tolerance=9000

\hyphenation{hexa-decimal}

% Okay, what follows is more TeX than LaTeX ...

\def\hditem#1{\hbox to 1.2in{#1\hfil}}
\def\boottwo#1{$$
  \bf
  \begin{tabular}{|ll|}
    \hline
    \hditem{\rm Master Boot Record} & \hditem{\rm Operating system} \\
    \hline
    #1 \\
    \hline
  \end{tabular}
  $$}

\def\bootthree#1{$$
  \bf
  \begin{tabular}{|lll|}
    \hline
    \hditem{\rm Master Boot Record} & \hditem{\rm Boot sector} &
      \hditem{\rm Operating system} \\
    \hline
    #1 \\
    \hline
  \end{tabular}
  $$}

\def\bootfour#1{$$
  \bf
  \begin{tabular}{|llll|}
    \hline
    \hditem{\rm Master Boot Record} & \hbox to 1.1in{\rm Boot sector\hfil} &
      \hditem{\rm Operating systems} & \hbox to 0.4in{\hfil} \\
    \hline
    #1 \\
    \hline
  \end{tabular}
  $$}
\def\sep{\rightarrowfill &}
\def\empty{&}
\def\branch{\hfill$\longrightarrow$ &}
\def\cont{---\,$\cdots$}
\def\key#1{$[$#1$]$}
\def\LILO{LILO}
\def\meta#1{{\it #1\/}}	% ... <blah> ...
\def\path#1{{\tt #1}}   % ... /foo/bar ...
\def\raw#1{{\tt #1}}	% ...  raw output  ...
\def\craw#1{{\tt #1}}	% ...  raw output  ...
\def\name#1{{\sf #1}}	% ... FooBar ...
\def\emphasize#1{{\bf #1}} % ... _don't_ ...
\def\unit#1{\hbox{\tt #1}} % ... \unit{-x foo} ...
%%def\\key{([^{}]*)}=[$1]
%%def\\LILO=LILO
%%def\\meta{([^{}]*)}=<$1>
%%def\\path{([^{}]*)}=$1
%%def\\raw{([^{}]*)}=~$1~
%%cmd\\craw{([^{}]*)}=((($x = $1) =~ tr/a-z/A-Z/), $x)
%%def\\name{={
%%def\\emphasize{([^{}]*)}=\\_$1\\_
%%def\\underline{([^{}]*)}=$1
%%def\\begin{command}=\\raw{$SI$SI$SI$SI
%%def\\end{command}=$SO$SO$SO$SO}
%%def\\addtocounter{([^{}]*)}{([^{}]*)}=~
%%def\\hbox{([^{}]*)}=$1
%%def(\\unit{[^{} ]*) ([^{}]*})=$1~$2
%%def\\unit{([^{} ]*)}=$1
%%def{\$([^{}])\$}=$1
%%def%4=    
%	^^^^
%       four invisible spaces here
%%def%;=        
%	^^^^^^^^
%       eight invisible spaces here

\newenvironment{command}{\def\[{$\bigl[$}\def\]{$\bigr]$}\def\|{$\big\vert$}%
  \parindent=-2em\advance\leftskip by -\parindent\vskip -\parskip~\par
  \begingroup\tt\textfont0=\font}{%
  ~\endgroup\par\advance\hoffset by \parindent}

\begin{document}

\title{\LILO \\
  \Large
  Generic boot loader for Linux \\
  Version 21 \\ ~\\
  \bf User's guide}
\author{Werner Almesberger \\
  {\tt Werner.Almesberger@epfl.ch}}
\date{December 4, 1998}

\maketitle
{
  \parskip=-1pt
  \setcounter{tocdepth}{2}
  \tableofcontents
}
%%endskip

~\\
\LILO\ is a versatile boot loader for Linux. It does not depend on a specific
file system, can boot Linux kernel images from
floppy disks and from hard disks and can even act as a ``boot manager'' for
other operating
systems.\footnote{PC/MS-DOS, DR DOS, OS/2, Windows 95, Windows NT, 386BSD,
SCO UNIX, Unixware, $\ldots$}

One of up to sixteen different images can be selected at boot time.
Various parameters, such as the root
device, can be set independently for each kernel. \LILO\ can even be
used as the master boot record.

This document introduces the basics of disk organization and booting,
continues with an overview of common boot techniques and finally describes
installation and use of \LILO\ in greater detail. The troubleshooting
section at the end describes diagnostic messages and contains suggestions
for most problems that have been observed in the past.

Please read at least the sections about installation and configuration if
you're already using an older version of \LILO. This distribution is
accompanied by a file named \path{INCOMPAT} that describes further
incompatibilities to older versions.

For the impatient: there is a quick-installation script to create
a simple but quite usable installation. See section \ref{quickinst} for
details.

But wait $\ldots$ here are a few easy rules that will help you to avoid
most problems people experience with \LILO:

\begin{itemize}
  \item \emphasize{Don't panic.} If something doesn't work, try to find
    out what is wrong, try to verify your assumption and only then attempt
    to fix it.
  \item Read the documentation. Especially if what the system does doesn't
    correspond to what you think it should do.
  \item Make sure you have an emergency boot disk, that you know how to
    use it, and that it is always kept up to date.
  \item Run \path{/sbin/lilo} \emphasize{whenever} the kernel or any part
    of \LILO, including its configuration file, has changed. When in doubt,
    run it. You can't run \path{/sbin/lilo} too many times.
  \item If performing a destructive upgrade and/or erasing your Linux
    partitions, de-install \LILO\ \emphasize{before} that if using it as the
    MBR.
  \item Don't trust setup scripts. Always verify the \path{/etc/lilo.conf}
    they create before booting.
  \item If using a big disk, be prepared for inconveniences: you may have
    to use the \craw{linear} option.
\end{itemize}


\newpage
\subsection*{System overview}

\LILO\ is a collection of several programs and other files:

\begin{description}
  \item[The map installer] is the program you run under Linux to put all
    files belonging to \LILO\ at the appropriate places and to record
    information about the location of data needed at boot time. This program
    normally resides in \path{/sbin/lilo}. It has to be run to refresh that
    information whenever any part of the system that \LILO\ knows about
    changes, e.g. after installing a new kernel.
  \item[Various files] contain data \LILO\ needs at boot time, e.g. the
    boot loader. Those files normally reside in \path{/boot}. The most
    important files are the boot loader (see below) and the map file
    (\path{/boot/map}), where the map installer records the location of
    the kernel(s).\footnote{\LILO\ does not know how to read a file system.
    Instead, the map installer asks the kernel for the physical location of
    files (e.g. the kernel image(s)) and records that information. This
    allows \LILO\ to work with most file systems that are supported by
    Linux.} Another important file is the configuration file, which is
    normally called \path{/etc/lilo.conf}
  \item[The boot loader] is the part of \LILO\ that is loaded by the BIOS
    and that loads kernels or the boot sectors of other operating systems.
    It also provides a simple command-line interface to interactively
    select the item to boot and to add boot options.
\end{description}

\LILO\ primarily accesses the following parts of the system:

\begin{description}
  \item[The root file system partition] is important for two reasons: first,
    \LILO\ sometimes has to tell the kernel where to look for it. Second, it
    is frequently a convenient place for many other items \LILO\ uses, such
    as the boot sector, the \path{/boot} directory, and the kernels.
  \item[The boot sector] contains the first part of \LILO's boot loader. It
    loads the much larger second-stage loader. Both loaders are typically
    stored in the file \path{/boot/boot.b}
  \item[The kernel] is loaded and started by the boot loader. Kernels
    typically reside in the root directory or in \path{/boot}.
\end{description}

Note that many of the files \LILO\ needs at boot time have to be accessible
with the BIOS. This creates certain restrictions, see section \ref{broken}.


\newpage
\section{Introduction}

The following sections describe how PCs
boot in general and what has to be known when booting Linux and using
\LILO\ in particular.


\subsection{Disk organization}
\label{diskorg}

When designing a boot concept, it is important to understand some of the
subtleties of how PCs typically organize disks. The most simple case are
floppy disks. They consist of a boot sector, some administrative
data (FAT or super block, etc.) and the data area. Because that
administrative data is irrelevant as far as booting is concerned, it is
regarded as part of the data area for simplicity.

%%beginskip
$$
\begin{tabular}{|c|c|}
  \hline
  Boot sector & \hbox to 1.5in{\hfil} \\
  \cline{1-1}
  \multicolumn{2}{|c|}{} \\
  \multicolumn{2}{|c|}{Data area} \\
  \multicolumn{2}{|c|}{} \\
  \hline
  \end{tabular}
$$
%%endskip
%:\begin{verbatim}
%;    +---------------------------+
%;    |Boot sector|               |
%;    |-----------+               |
%;    |                           |
%;    |         Data area         |
%;    |                           |
%;    |                           |
%;    +---------------------------+
%:\end{verbatim}

The entire disk appears as one device (e.g. \path{/dev/fd0}) on Linux.

The MS-DOS boot sector has the following structure:

%%beginskip
$$
\begin{tabular}{r|c|}
  \cline{2-2}
  \tt 0x000 & Jump to the program code\\
  \cline{2-2}
  \tt 0x003 & \\
  & Disk parameters \\
  & \\
  \cline{2-2}
  \tt 0x02C/0x03E & \\
  & Program code \\
  & \\
  & \\
  \cline{2-2}
  \tt 0x1FE & Magic number (0xAA55)\\
  \cline{2-2}
\end{tabular}
$$
%%endskip
%:\begin{verbatim}
%;            +------------------------+
%;      0x000 |Jump to the program code|
%;            |------------------------|
%;      0x003 |                        |
%;            |    Disk parameters     |
%;            |                        |
%;            |------------------------|
%;0x02C/0x03E |                        |
%;            |      Program code      |
%;            |                        |
%;            |                        |
%;            |------------------------|
%;      0x1FE | Magic number (0xAA55)  |
%;            +------------------------+
%:\end{verbatim}

\LILO\ uses a similar boot sector, but it does not contain the disk
parameters part. This is no problem for Minix, Ext2 or similar file systems,
because
they don't look at the boot sector, but putting a \LILO\ boot sector on an
MS-DOS file system would make it inaccessible for MS-DOS.

Hard disks are organized in a more complex way than floppy disks. They
contain several data areas called partitions. Up to four so-called
primary partitions can exist on an MS-DOS hard disk. If more partitions
are needed, one primary partition is used as an extended partition that
contains several logical partitions.

The first sector of each hard disk contains a partition table, and an
extended partition and \emphasize{each} logical partition contains a partition
table too.

%%beginskip
$$
\begin{tabular}{|l|l|l|}
  \hline
  \multicolumn{3}{|l|}{Partition table\hbox to 2in{\hfil\tt /dev/hda~}} \\
  \cline{2-3}
  & \multicolumn{2}{l|}{Partition 1\hfill {\tt /dev/hda1}} \\
  & \multicolumn{2}{l|}{} \\
  \cline{2-3}
  & \multicolumn{2}{l|}{Partition 2\hfill {\tt /dev/hda2}} \\
  & \multicolumn{2}{l|}{} \\
  \hline
\end{tabular}
$$
%%endskip
%:\begin{verbatim}
%;+--------------------------------------------+
%;| Partition table                  /dev/hda  |
%;| +------------------------------------------|
%;| | Partition 1                    /dev/hda1 |
%;| |                                          |
%;| |------------------------------------------|
%;| | Partition 2                    /dev/hda2 |
%;| |                                          |
%;+--------------------------------------------+
%:\end{verbatim}

The entire disk can be accessed as \path{/dev/hda}, \path{/dev/hdb},
\path{/dev/sda}, etc. The primary partitions are \path{/dev/hda1 $\ldots$
/dev/hda4}.

%%beginskip
$$
\begin{tabular}{|l|l|l|}
  \hline
  \multicolumn{3}{|l|}{Partition table\hbox to 2in{\hfil\tt /dev/hda~}} \\
  \cline{2-3}
  & \multicolumn{2}{l|}{Partition 1\hfill {\tt /dev/hda1}} \\
  & \multicolumn{2}{l|}{} \\
  \cline{2-3}
  & \multicolumn{2}{l|}{Partition 2\hfill {\tt /dev/hda2}} \\
  & \multicolumn{2}{l|}{} \\
  \cline{2-3}
  & \multicolumn{2}{l|}{Extended partition\hfill {\tt /dev/hda3}} \\
  \cline{3-3}
  & & Extended partition table \\
  \cline{3-3}
  & & Partition 3\hfill {\tt /dev/hda5}\\
  & & \\
  \cline{3-3}
  & & Extended partition table \\
  \cline{3-3}
& & Partition 4\hfill {\tt /dev/hda6}\\
  & & \\
  \hline
\end{tabular}
$$
%%endskip
%:\begin{verbatim}
%;+--------------------------------------------+
%;| 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 |
%;| | |                                        |
%;+--------------------------------------------+
%:\end{verbatim}

This hard disk has two primary partitions and an extended partition
that contains two logical partitions. They are accessed as
\path{/dev/hda5 $\ldots$}

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:

%%beginskip
$$
\begin{tabular}{r|c|}
  \cline{2-2}
  \tt 0x000 & \\
  & Program code \\
  & \\
  & \\
  \cline{2-2}
  \tt 0x1BE & Partition table \\
  & \\
  \cline{2-2}
  \tt 0x1FE & Magic number (0xAA55) \\
  \cline{2-2}
\end{tabular}
$$
%%endskip
%:\begin{verbatim}
%;            +------------------------+
%;      0x000 |                        |
%;            |      Program code      |
%;            |                        |
%;            |                        |
%;            |------------------------|
%;      0x1BE |    Partition table     |
%;            |                        |
%;            |------------------------|
%;      0x1FE | Magic number (0xAA55)  |
%;            +------------------------+
%:\end{verbatim}

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:

\begin{itemize}
  \item boot sector of a Linux floppy disk. (\path{/dev/fd0}, $\ldots$)
  \item MBR of the first hard disk. (\path{/dev/hda}, \path{/dev/sda}, $\ldots$)
  \item boot sector of a primary Linux file system partition on the first hard
    disk. (\path{/dev/hda1}, $\ldots$)
  \item partition boot sector of an extended partition on the first hard disk.
    (\path{/dev/hda1}, $\ldots$)\footnote{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
      (\name{activate}) that doesn't have this restriction. Linux \name{fdisk}
      also supports activating extended partitions.}
\end{itemize}

It \emphasize{can't} be stored at any of the following locations:

\begin{itemize}
  \item boot sector of a non-Linux floppy disk or primary partition.
  \item a Linux swap partition.
  \item boot sector of a logical partition in an extended partition.%
\footnote{\LILO\ can be forced to put the boot sector on such a
 partition by using the \raw{-b} option or the \craw{boot} variable.
 However, only few programs that operate as master boot records
 support booting from a logical partition.}
  \item 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.)
\end{itemize}

Although \LILO\ tries to detect attempts to put its boot sector at an
invalid location, you should not rely on that.


\subsection{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.


\subsubsection{MS-DOS alone}

%%beginskip
\bootthree{DOS-MBR \sep MS-DOS \sep COMMAND.COM}
%%endskip
%:\begin{verbatim}
%;+-------------------------------------------------------+
%;| Master Boot Record    Boot sector    Operating system |
%;|-------------------------------------------------------|
%;| DOS-MBR ------------> MS-DOS ------> COMMAND.COM      |
%;+-------------------------------------------------------+
%:\end{verbatim}

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 \path{COMMAND.COM}. (This is
greatly simplified.)


\subsubsection{LOADLIN}

%%beginskip
\bootfour{DOS-MBR \sep MS-DOS \sep COMMAND.COM \empty \\
  \empty \branch LOADLIN \sep Linux}
%%endskip
%:\begin{verbatim}
%4+------------------------------------------------------------+
%4| Master Boot Record    Boot sector    Operating system      |
%4|------------------------------------------------------------|
%4| DOS-MBR ------------> MS-DOS ------> COMMAND.COM           |
%4|                                 ---> LOADLIN ------> Linux |
%4+------------------------------------------------------------+
%:\end{verbatim}

A typical \name{LOADLIN} setup: everything happens like when booting MS-DOS,
but in \path{CONFIG.SYS} or \path{AUTOEXEC.BAT}, LOADLIN is invoked. Typically,
a program like \path{BOOT.SYS} is used to choose among configuration sections
in \path{CONFIG.SYS} and \path{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.


\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 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 \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 branches
can either boot Linux or MS-DOS. (\LILO\ could also boot other
operating systems.)


\subsubsection{\LILO\ started by \name{BOOTACTV}\protect\footnotemark}
\footnotetext{Other, possibly better known boot switchers, e.g. \name{OS/2
BootManager} operate in a similar way. The installation procedures typically
vary.}

%%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 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).\footnote{%
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:
\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 partition
exists (e.g. \path{/usr}, \emphasize{not} a swap partition), \name{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:
\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 boot
sector 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 approach
has 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 of
MS-DOS or by overwriting it with something like \name{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:
\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 to
explicitly specify the boot sector (configuration variable
\craw{boot=}$\ldots$) 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.


\subsubsection{Names}

The following names have been used to describe boot sectors or parts of
operating 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 is
usually limited by the present setup and therefore,
typically only a small number of configurations which fit naturally
into an existing system remains. The following sections describe various
possible cases. See also section \ref{broken}.

The configuration file \path{/etc/lilo.conf} for the examples
could look like this:

\begin{verbatim}
boot = /dev/hda2
compact
image = /vmlinuz
image = /vmlinuz.old
other = /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}) and
a 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 large
disks or even with multiple disks. At the time the disk interface of the
standard PC BIOS has been designed (about 16 years ago), such configurations
were apparently considered to be too unlikely to be worth supporting.

The most common BIOS restrictions that affect \LILO\ are the limitation to
two hard disks and the inability to access more than 1024 cylinders per
disk. \LILO\ can detect both conditions, but in order to work around the
underlying problems, manual intervention is necessary.

The drive limit does not exist in every BIOS. Some modern motherboards
and disk controllers are equipped with a BIOS that supports more (typically
four) disk drives. When attempting to access the third, fourth, etc. drive,
\LILO\ prints a warning message but continues. Unless the BIOS really
supports more than two drives, the system will \emphasize{not} be able to
boot in that case.\footnote{However, if only ``unimportant'' parts of the
system are located on the ``high'' drives, some functionality may be
available.}

The cylinder limit is a very common problem with IDE disks. There, the
number of cylinders may already exceed 1024 if the drive has a capacity
of more than 504 MB. Many SCSI driver BIOSes present the disk geometry
in a way that makes the limit occur near 1 GB. Modern disk controllers
may even push the limit up to about 8 GB. All cylinders beyond the
1024th are inaccessible for the BIOS. \LILO\ detects this problem and
aborts the installation (unless the \craw{linear} option is used, see
section \ref{cfgglo}).

Note that large partitions that only partially extend into the ``forbidden
zone'' are still in jeopardy even if they appear to work at first, because
the file system does not know about the restrictions and may allocate
disk space from the area beyond the 1024th cylinder when installing new
kernels. \LILO\ therefore prints a warning message but continues as long
as 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} or
to let \path{/boot} be a symbolic link pointing to or into such a
partition.

See also \path{/usr/src/linux/Documentation/ide.txt} (or
\path{/usr/src/linux/drivers/block/README.ide} in older kernels) for a detailed
description 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 a
Linux file system (\path{/}, \path{/usr}, etc. but \emphasize{not} as a swap
partition), the \LILO\ boot sector should be stored on that partition
and it should be booted by the original master boot record or by a
program like \name{BOOTACTV}.

%%beginskip
$$
  \begin{tabular}{r|c|c|}
    \cline{2-3}
    & \multicolumn{2}{|l|}{MBR\hbox to 1.3in{\hfill\tt /dev/hda~}} \\
    \cline{3-3}
    & & MS-DOS\hfill\tt /dev/hda1 \\
    \cline{3-3}
    $\rightarrow$ & & Linux {\tt /}\hfill\tt /dev/hda2 \\
    \cline{2-3}
  \end{tabular}
$$
%%endskip
%:\begin{verbatim}
%;    +--------------------------+
%;    | MBR            /dev/hda  |
%;    | +------------------------|
%;    | | MS-DOS       /dev/hda1 |
%;    | |------------------------|
%;--> | | Linux /      /dev/hda2 |
%;    +--------------------------+
%:\end{verbatim}

In this example, the \craw{boot} variable could be omitted, because
the boot sector is on the root partition.


\subsubsection{One disk, Linux on a logical partition}

If no primary partition is available for Linux, but at least one logical
partition of an extended partition on the first hard disk contains a
Linux file system, the \LILO\ boot sector should be stored in the partition
sector of the extended partition and it should be booted by the original
master boot record or by a program like \name{BOOTACTV}.

%%beginskip
$$
  \begin{tabular}{r|c|c|c|}
    \cline{2-4}
    & \multicolumn{3}{|l|}{MBR\hbox to 1.3in{\hfill\tt /dev/hda~}} \\
    \cline{3-4}
    & & \multicolumn{2}{|l|}{MS-DOS\hfill\tt /dev/hda1} \\
    \cline{3-4}
    $\rightarrow$ & & \multicolumn{2}{|l|}{Extended\hfill\tt /dev/hda2} \\
    \cline{4-4}
    & & & Linux\hfill\tt /dev/hda5 \\
    \cline{4-4}
    & & & $\ldots$\hfill\tt /dev/hda6 \\
    \cline{2-4}
  \end{tabular}
$$
%%endskip
%:\begin{verbatim}
%;    +--------------------------+
%;    | MBR            /dev/hda  |
%;    | +------------------------|
%;    | | MS-DOS       /dev/hda1 |
%;    | |------------------------|
%;--> | | Extended     /dev/hda2 |
%;    | | +----------------------|
%;    | | | Linux      /dev/hda5 |
%;    | | |----------------------|
%;    | | | ...        /dev/hda6 |
%;    +--------------------------+
%:\end{verbatim}

Because many disk partitioning programs refuse to make an extended
partition (in our example \path{/dev/hda2}) active, you might have to
use \name{activate}, which comes with the \LILO\ distribution.

OS/2 BootManager should be able to boot \LILO\ boot sectors from logical
partitions. The installation on the extended partition itself is not
necessary in this case.


\subsubsection{Two disks, Linux (at least partially) on the first disk}

This case is equivalent to the configurations where only one disk
is in the system. The Linux boot sector resides on the first hard
disk and the second disk is used later in the boot process.

Only the location of the boot sector matters -- everything
else (\path{/boot/boot.b},
\path{/boot/map}, the root file system, a swap partition, other
Linux file systems, etc.) can be located anywhere on the second disk,
provided that the constraints described in section \ref{broken} are met.


\subsubsection{Two disks, Linux on second disk, first disk has an extended
  partition}

If there is no Linux partition on the first disk, but there is an
extended partition, the \LILO\ boot sector can be stored in the partition
sector of the extended partition and it should be booted by the original
master boot record or by a program like \name{BOOTACTV}.

%%beginskip
$$
  \begin{tabular}{r|c|c|c|c|c|c|}
    \multicolumn{1}{r}{}
    & \multicolumn{3}{c}{\bf First disk} &
      \multicolumn{1}{r}{\qquad}
      & \multicolumn{2}{c}{\bf Second disk} \\
    \cline{2-4}\cline{6-7}
    & \multicolumn{3}{|l|}{MBR\hbox to 1.3in{\hfill\tt /dev/hda~}} &
      & \multicolumn{2}{|l|}{MBR\hbox to 1.3in{\hfill\tt /dev/hdb~}} \\
    \cline{3-4}\cline{7-7}
    & & \multicolumn{2}{|l|}{MS-DOS\hfill\tt /dev/hda1} &
      & & Linux\hfill\tt /dev/hdb1 \\
    \cline{3-4}\cline{7-7}
    $\rightarrow$ & & \multicolumn{2}{|l|}{Extended\hfill\tt /dev/hda2} &
      & & $\ldots$\hfill\tt /dev/hdb2 \\
    \cline{4-4}
    & & & $\ldots$\hfill\tt /dev/hda5 & & & \\
    \cline{4-4}
    & & & $\ldots$\hfill\tt /dev/hda6 & & & \\
    \cline{2-4}\cline{6-7}
  \end{tabular}
$$
%%endskip
%:\begin{verbatim}
%4             FIRST DISK                     SECOND DISK
%4    +--------------------------+    +--------------------------+
%4    | MBR            /dev/hda  |    | MBR            /dev/hdb  |
%4    | +------------------------|    | +------------------------|
%4    | | MS-DOS       /dev/hda1 |    | | Linux        /dev/hdb1 |
%4    | |------------------------|    | |------------------------|
%4--> | | Extended     /dev/hda2 |    | | ...          /dev/hdb2 |
%4    | | +----------------------|    | |                        |
%4    | | | ...        /dev/hda5 |    | |                        |
%4    | | |----------------------|    | |                        |
%4    | | | ...        /dev/hda6 |    | |                        |
%4    +--------------------------+    +--------------------------+
%:\end{verbatim}

The program \name{activate}, that accompanies \LILO, may have to be used to
set the active marker on an extended partition, because MS-DOS' \name{FDISK}
and some older version of Linux \name{fdisk} refuse to do that. (Which is
generally a good idea.)


\subsubsection{Two disks, Linux on second disk, first disk has no
  extended partition}

If there is neither a Linux partition nor an extended partition on the first
disk, then there's only one place left, where a \LILO\ boot sector could be
stored: the master boot record.

In this configuration, \LILO\ is responsible for booting all other operating
systems too.

%%beginskip
$$
  \begin{tabular}{r|c|c|c|c|c|}
    \multicolumn{1}{r}{}
    & \multicolumn{2}{c}{\bf First disk} &
      \multicolumn{1}{r}{\qquad}
      & \multicolumn{2}{c}{\bf Second disk} \\
    \cline{2-3}\cline{5-6}
    $\rightarrow$ & \multicolumn{2}{|l|}{MBR\hbox to 1.3in{
      \hfill\tt /dev/hda~}} &
      & \multicolumn{2}{|l|}{MBR\hbox to 1.3in{\hfill\tt /dev/hdb~}} \\
    \cline{3-3}\cline{6-6}
    & & MS-DOS\hfill\tt /dev/hda1 &
      & & Linux\hfill\tt /dev/hdb1 \\
    \cline{3-3}\cline{6-6}
    & & $\ldots$\hfill\tt /dev/hda2 &
      & & $\ldots$\hfill\tt /dev/hdb2 \\
    \cline{2-3}\cline{5-6}
  \end{tabular}
$$
%%endskip
%:\begin{verbatim}
%4             FIRST DISK                     SECOND DISK
%4    +--------------------------+    +--------------------------+
%4--> | MBR            /dev/hda  |    | MBR            /dev/hdb  |
%4    | +------------------------|    | +------------------------|
%4    | | MS-DOS       /dev/hda1 |    | | Linux        /dev/hdb1 |
%4    | |------------------------|    | |------------------------|
%4    | | ...          /dev/hda2 |    | | ...          /dev/hdb2 |
%4    +--------------------------+    +--------------------------+
%:\end{verbatim}

You should back up your old MBR before installing \LILO\ and verify that
\LILO\ is able to boot your other operating system(s) before relying on
this approach.

The line \verb"boot = /dev/hda2" in \path{/etc/lilo.conf} would have to be
changed to \verb"boot = /dev/hda" in this example.


\subsubsection{More than two disks}

On systems with more than two disks, typically only the first two can
be accessed. The configuration choices are therefore the same as with
two disks.

When attempting to access one of the extra disks, \LILO\ displays a
warning message (\raw{Warning: BIOS drive 0x\meta{number} may not be
accessible}) but does not abort. This is done in order to allow
the lucky few whose BIOS (or controller-BIOS) does support more than
two drives to make use of this feature. By all others, this warning
should be considered a fatal error.

Note that the two disks restriction is only imposed by the BIOS.
Linux normally has no problems using all disks once it is booted.


\subsubsection{\path{/boot} on a DOS partition}
\label{viados}

Recent kernels support all the functions \LILO\ needs to map files also
on MS-DOS (or UMSDOS) file systems. Since DOS partitions tend to occupy
exactly the places where BIOS restrictions (see section \ref{broken})
are invisible, they're an ideal location for \path{/boot} if the native
Linux file systems can't be used because of BIOS problems.

In order to accomplish this, the DOS partition is mounted read-write,
a directory (e.g. \path{/dos/linux}) is created, all files from
\path{/boot} are moved to that directory, \path{/boot} is replaced by
a symbolic link to it, the kernels are also moved to the new directory,
their new location is recorded in \path{/etc/lilo.conf}, and finally
\path{/sbin/lilo} is run.

From then on, new kernels must always be copied into that directory on
the DOS partition before running \path{/sbin/lilo}, e.g. when recompiling
a kernel, the standard procedure changes from

\begin{verbatim}
# make zlilo
\end{verbatim}

to

\begin{verbatim}
# make zImage
# mv /dos/linux/vmlinuz /dos/linux/vmlinuz.old
# mv arch/i386/boot/zImage /dos/linux/vmlinuz
# /sbin/lilo
\end{verbatim}

\emphasize{WARNING:} De-fragmenting such a DOS partition is likely to
make Linux or even the whole system unbootable. Therefore, the DOS
partition should either not be de-fragmented, or a Linux boot disk
should be prepared (and tested) to bring up Linux and to run
\path{/sbin/lilo} after the de-fragmentation.\footnote{Setting the
``system'' attribute from DOS on the critical files (e.g. everything
in \path{C:$\backslash$LINUX}) may help to protect them from being
rearranged. However, the boot floppy should still be ready, just in case.}


\newpage
\section{The boot prompt}
\label{cmdopt}

Immediately after it's loaded, \LILO\ checks whether one of the following
is happening:

\begin{itemize}
  \item any of the \key{Shift}, \key{Control} or \key{Alt} keys is
    pressed.
  \item \key{CapsLock} or \key{ScrollLock} is set.
\end{itemize}

If this is the case, \LILO\ displays the \verb"boot:" prompt and waits for
the name of a boot image (i.e. Linux kernel or other operating system).
Otherwise, it boots the default boot image\footnote{%
The default boot image is either the first boot image, the image specified
with the \craw{default} variable, or the image that
has been selected at the boot prompt.}
or -- if a
delay has been specified -- waits for one of the listed activities
until that amount of time has passed.

At the boot prompt, the name of the image to boot can be entered. Typing
errors can be corrected with \key{BackSpace}, \key{Delete},
\key{Ctrl U} and \key{Ctrl X}. A list of known images can be obtained by
pressing \key{?} or \key{Tab}.

If \key{Enter} is pressed and no file name has been entered, the default
image is booted.


\subsection{Boot command-line options}

\LILO\ is also able to pass command-line options to the kernel.
Command-line options are words that follow the name of the boot
image and that are separated by spaces.

Example:
\begin{verbatim}
boot: linux single root=200
\end{verbatim}

This document only gives an overview of boot options. Please consult Paul
Gortmaker's BootPrompt-HOWTO for a more complete and more up to date list.
You can get it from
\path{ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/BootPrompt-HOWTO.gz}
or from one of the many mirror sites.


\subsubsection{Standard options}

Recent kernels recognize a large number of options, among them are \raw{debug},
\raw{no387}, \raw{no-hlt},
\raw{ramdisk=\meta{size}}, \raw{reserve=\meta{base},\meta{size},$\ldots$},
\raw{root=\meta{device}}, \raw{ro}, and \raw{rw}.
All current \name{init} programs also recognize the option \raw{single}.
The options \raw{lock} and \raw{vga} are processed by the boot loader itself.
Boot command-line options are always case-sensitive.

\raw{single} boots the system in single-user mode. This bypasses most
system initialization procedures and directly starts a root shell on the
console. Multi-user mode can typically be entered by exiting the single-user
shell or by rebooting.

\raw{root=\meta{device}} changes the root device. This overrides
settings that may have been made in the boot image and on the
\LILO\ command line. \meta{device} is either the hexadecimal device number
%%beginskip
\footnote{%
This is a list of device numbers of some frequently used devices: \\
\begin{tabular}{lllllll}
\qquad
& {\tt /dev/fd0} & 200\qquad & \tt /dev/hda1 & 301\qquad & /dev/sda1 & 801 \\
& {\tt /dev/fd1} & 201 & \tt /dev/hda2 & 302 & /dev/sda2 & 802 \\
& \multicolumn{2}{c}{$\cdots$} & \multicolumn{2}{c}{$\cdots$} &
\multicolumn{2}{c}{$\cdots$} \\
& & & \tt /dev/hdb1 & 341 & /dev/sdb1 & 811 \\
& & & \tt /dev/hdb2 & 342 & /dev/sdb2 & 812 \\
& \multicolumn{2}{c}{} & \multicolumn{2}{c}{$\cdots$} &
\multicolumn{2}{c}{$\cdots$} \\
\end{tabular}}
%%endskip
or the full path name of the device, e.g. \verb"/dev/hda3".%
\footnote{The device names are hard-coded in the kernel. Therefore, only
the ``standard'' names are supported and some less common devices may not
be recognized. In those cases, only numbers can be used.}

\raw{reserve=\meta{base},\meta{size},$\ldots$} reserves IO port regions.
This can be used to prevent device drivers from auto-probing addresses
where other devices are located, which get confused by the probing.

\raw{ro} instructs the kernel to mount the root file system read-only.
\raw{rw} mounts it read-write. If neither \raw{ro} nor \raw{rw} is
specified, the setting from the boot image is used.

\raw{no-hlt} avoids executing a \raw{HLT} instructions whenever the system
is idle. \raw{HLT} normally significantly reduces power consumption and
therefore also heat
dissipation of the CPU, but may not work properly with some clone CPUs.
\raw{no387} disables using the hardware FPU even if one is present.

\raw{debug} enables more verbose console logging.

Recent kernels also accept the options \raw{init=\meta{name}} and
\raw{noinitrd}. \raw{init} specifies the name of the \name{init} program
to execute. Therefore, if single mode cannot be entered because \name{init}
is mis-configured, one may still be able to reach a shell using
\verb"init=/bin/sh". \raw{noinitrd} disables automatic loading of the initial
RAM disk. Instead, its content is then available on \path{/dev/initrd}.

\raw{vga=\meta{mode}} alters the VGA mode set at startup. The values
\raw{normal}, \raw{extended}, \raw{ask} or a decimal number are
recognized. (See also page \pageref{vga}.)

\raw{kbd=\meta{code},$\ldots$} preloads a sequence of keystrokes in the
BIOS keyboard buffer. The keystrokes have to be entered as 16 bit hexadecimal
numbers, with the upper byte containing the scan code and the lower byte
containing the ASCII code. Note that most programs only use the ASCII
code, so the scan code can frequently be omitted. Scan code tables can be
found in many books on PC hardware. Note that scan codes depend on the
keyboard layout.

Finally, \raw{lock} stores the current command-line as the default
command-line, so that \LILO\ boots the same image with the same options
(including \raw{lock}) when invoked the next time.


\subsubsection{Device-specific options}

There is also a plethora of options to specify certain characteristics
(e.g. IO and memory addresses) of devices. Some common ones are
\raw{ether}, \raw{floppy}, \raw{hd}, \raw{bmouse}, and \raw{sound}.
The usage of these options is \raw{\meta{option}=\meta{number},$\ldots$}.
Please consult the corresponding FAQs and HOWTOs for details. For an overview
of all available options, consult the file \path{init/main.c} in the kernel
source tree.


\subsubsection{Other options}

Options of the type \raw{\meta{variable}=\meta{value}} which are neither
standard options nor device-specific options,
cause the respective variables to be set in the environment passed to
\name{init}. The case of the variable name is preserved, i.e. it isn't
automatically converted to upper case.

Note that environment variables passed to \name{init} are typically
available in system initialization scripts (e.g. \path{/etc/rc.local}),
but they're not visible from ordinary login sessions, because the \name{login}
program removes them from the user's environment.


\subsubsection{Repeating options}

The effect of repeating boot command-line options depends on the options.%
\footnote{Options are frequently repeated when a string defined with
\craw{append} or \craw{literal} is prepended to the parameters typed in by
the user. Also, \LILO\ implicitly prepends the options \raw{ramdisk},
\raw{ro}, \raw{root}, or \raw{rw} when \craw{ramdisk}, \craw{read-only},
\craw{read-write}, or \craw{root}, respectively, are set in the configuration
file.
(\raw{lock} and \raw{vga} are handled by a different internal mechanism.)}
There are three possible behaviours:

Options that only enable or disable a certain functionality can be repeated
any number of times. \raw{debug}, \raw{lock}, \raw{no-hlt}, and \raw{no387}
fall into this category.

Other options change a global setting whenever they appear, so only the
value or presence of the last option matters. The antagonists \raw{ro} and
\raw{rw} are such options. Also, \raw{ramdisk}, \raw{root}, and \raw{vga}
work this way. Example: \raw{ro rw} would mount the root file system
read-write.

Finally, when \raw{reserve} and many device-specific options are repeated,
each occurrence has its own meaning, e.g. \raw{hd=$\ldots$ hd=$\ldots$} would
configure two hard disks, and \raw{reserve=0x300,8 reserve=0x5f0,16} would
reserve the ranges 0x300 to 0x307 and 0x5f0 to 0x5ff (which is equivalent to
writing \raw{reserve=0x300,8,0x5f0,16}).


\subsubsection{Implicit options}

\LILO\ always passes the string \raw{BOOT\_IMAGE=\meta{name}} to the
kernel, where \meta{name} is the name by which the kernel is identified
(e.g. the label). This variable can be used in \path{/etc/rc} to select
a different behaviour, depending on the kernel.

When booting automatically, i.e. without human intervention, the word
\raw{auto} is also passed on
the command line. This can be used by \name{init} to suppress interactive
prompts in the boot phase.


\subsection{Boot image selection}
\label{bootsel}

The details of selecting the boot image are somewhat complicated. The
following tables illustrate them. First, if neither \craw{prompt} is
set nor a shift key is being pressed:

$$
\begin{tabular}{cc|cl}
  Externally & Command  & Auto- & Booted image \\
  provided   & line in  & matic & \\
  cmd. line\footnotemark
  & map file\footnotemark
  & boot\footnotemark
  & \\
  \hline
  No  & No  & Yes & Default image \\
  Yes & --- & Yes & Specified by external \\
      &     &     & command line \\
  No  & Yes & Yes & Specified by command line \\
      &     &     & in map file \\
\end{tabular}
\addtocounter{footnote}{-2}
\footnotetext{Externally provided command lines could be used to
  add front-ends to \LILO. They would pass the respective command
  string to LILO, which would then interpret it like keyboard input. This
  feature is currently not used.}
\addtocounter{footnote}{1}
\footnotetext{This command line is set by invoking the map installer
    with the \raw{-R} option, by using the boot command-line option
    \raw{lock}, or if a fallback command line is set (with \craw{fallback}).}
\addtocounter{footnote}{1}
\footnotetext{I.e. the keyword \raw{auto} is added.}
$$

If \craw{prompt} is not set and a shift key is being pressed:
$$
\begin{tabular}{cccc|cl}
  Input   & Empty  & Extern. & Cmd.l.  & Auto- & Booted image \\
  timeout & cmd.l. & cmd.l.  & in map  & matic & \\
          &        &         & file    & boot  & \\
  \hline
  No  & No  & --- & --- & No  & Specified by the user \\
  No  & Yes & --- & --- & No  & Default image \\
  Yes & n/a & --- & --- & Yes & Default image \\
\end{tabular}
$$

Finally, if the configuration variable \craw{prompt} is set:
$$
\begin{tabular}{cccc|cl}
  Input   & Empty  & Extern. & Cmd.l.  & Auto- & Booted image \\
  timeout & cmd.l. & cmd.l.  & in map  & matic & \\
          &        &         & file    & boot  & \\
  \hline
  No  & No  & No  & No  & No  & Specified by the user \\
  No  & Yes & No  & No  & No  & Default image \\
  Yes & n/a & No  & No  & Yes & Default image \\
  n/a & n/a & Yes & --- & Yes & Specified by external \\
      &     &     &     &     & command line \\
  n/a & n/a & No  & Yes & Yes & Specified by command \\
      &     &     &     &     & line in map file \\
\end{tabular}
$$

Note that \LILO\ pauses for the amount of time specified in \craw{delay}
when at the end of a default command line. The automatic boot can then
be interrupted by pressing a modifier key (\key{Shift}, \key{Ctrl}, etc.).

The default image is the first image in the map file or the image specified
with the \craw{default} variable. However,
after an unsuccessful boot attempt, the respective image becomes the
default image.


\newpage
\section{Map installer}

The map installer program \path{/sbin/lilo} updates the boot sector
and creates the map file. If the map installer detects an error, it terminates
immediately and does not touch the boot sector and the map file.

Whenever the map installer updates a boot sector, the original boot
sector is copied
to \path{/boot/boot.\meta{number}}, where \meta{number} is the
hexadecimal device number. If such a file already exists, no backup
copy is made. Similarly, a file \raw{/boot/part.\meta{number}} is
created if \LILO\ modifies the partition table. (See page \pageref{fix-table}.)


\subsection{Command-line options}

The \LILO\ map installer can be invoked in the following ways:


%%beginskip
\def\seealso{See also sections \ref{corropt} and \ref{cfgglo}.}
%%def\\seealso=See also sections \\ref{corropt} and \\ref{cfgglo}.
%%endskip

\subsubsection{Show current installation}
\label{invshow}

The currently mapped files are listed. With \raw{-v}, also many parameters
are shown.

\begin{command}
  /sbin/lilo
    \unit{\[ -C \meta{config\_file} \]}
    \unit{-q}
    \unit{\[ -m \meta{map\_file} \]}
    \unit{\[ -v $\ldots$ \]}
\end{command}

\begin{description}
  \item[\raw{-C \meta{config\_file}}]~\\
    Specifies the configuration file that is used by the map
    installer (see section \ref{config}). If \raw{-C} is omitted,
    \path{/etc/lilo.conf} is used.
  \item[\raw{-m \meta{map\_file}}]~\\
    Specifies an alternate map file. \seealso
  \item[\raw{-q}]~ \\
    Lists the currently mapped files.
  \item[\raw{-v $\ldots$}]~\\
    Increase verbosity. \seealso
\end{description}


\subsubsection{Create or update map}
\label{creupd}

A new map is created for the images described in the configuration file
\path{/etc/lilo.conf} and they are registered in the boot sector.

\begin{command}
  /sbin/lilo
    \unit{\[ -C \meta{config\_file} \]}
    \unit{\[ -b \meta{boot\_device} \]}
    \unit{\[ -c \]}
    \unit{\[ -l \]}
    \unit{\[ -i \meta{boot\_sector} \]}
    \unit{\[ -f \meta{disk\_tab} \]}
    \unit{\[ -m \meta{map\_file} \]}
    \unit{\[ -d \meta{delay\/} \]}
    \unit{\[ -v $\ldots$ \]}
    \unit{\[ -t \]}
    \unit{\[ -s \meta{save\_file} \|}
    \unit{-S \meta{save\_file} \]}
    \unit{\[ -P fix \|}
    \unit{-P ignore \]}
    \unit{\[ -r \meta{root\_dir} \]}
\end{command}

\begin{description}
  \item[\raw{-b \meta{boot\_device}}]~\\
    Specifies the boot device. \seealso
  \item[\raw{-c}]~\\
    Enables map compaction. \seealso
  \item[\raw{-C \meta{config\_file}}]~\\
    Specifies an alternate configuration file. See also section \ref{invshow}.
  \item[\raw{-d \meta{delay}}]~\\
    Sets the delay before \LILO\ boots the default image. Note that the
    delay is specified in \emphasize{tenths} of a second. \seealso
  \item[\raw{-D \meta{name}}]~\\
    Specifies the default image. \seealso
  \item[\raw{-f \meta{disk\_tab}}]~\\
    Specifies a disk parameter table file. \seealso
  \item[\raw{-i \meta{boot\_sector}}]~\\
    Specifies an alternate boot file. \seealso
  \item[\raw{-l}]~\\
    Enables linear sector addresses. \seealso
  \item[\raw{-m \meta{map\_file}}]~\\
    Specifies an alternate map file. \seealso
  \item[\raw{-P \meta{mode}}]~\\
    Specifies how invalid partition table entries should be handled. \seealso
  \item[\raw{-r \meta{root\_directory}}]~ \\
    Chroots to the specified directory before doing anything else. This is
    useful when running the map installer while the normal root file system
    is mounted somewhere else, e.g. when recovering from an installation
    failure with a recovery disk. The \raw{-r} option is implied if
    the environment variable \raw{ROOT} is set.\footnote{E.g. if your root
      partition is mounted on \path{/mnt}, you can update the map by simply
      running \raw{ROOT=/mnt /mnt/sbin/lilo}}
    The current directory is changed to the new root directory, so using
    relative paths may not work.
  \item[\raw{-s \meta{save\_file}}]~\\
    Specifies an alternate boot sector save file. \seealso
  \item[\raw{-S \meta{save\_file}}]~\\
    Like \raw{-s}, but overwrites old save files.
  \item[\raw{-t}]~ \\
    Test only. This performs the entire installation procedure except
    replacing the map file, writing the modified boot sector and fixing
    partition tables. This
    can be used in conjunction with the \raw{-v} option to verify that
    \LILO\ will use sane values.
  \item[\raw{-v $\ldots$}]~\\
    Increase verbosity. \seealso
\end{description}


\subsubsection{Change default command line}
\label{invcmd}

Changes \LILO's default command line. See also section \ref{bootsel}.

\begin{command}
  /sbin/lilo
    \unit{\[ -C \meta{config\_file} \]}
    \unit{\[ -m \meta{map\_file} \]}
    \unit{-R \[ \meta{word} $\ldots$ \]}
\end{command}

\begin{description}
  \item[\raw{-C \meta{config\_file}}]~\\
    Specifies an alternate configuration file. See also section \ref{invshow}.
  \item[\raw{-m \meta{map\_file}}]~\\
    Specifies an alternate map file. \seealso
  \item[\raw{-R \meta{word $\ldots$}}]~ \\
    Stores the specified words in the map file. The boot loader uses those
    words as the default command line when booting the next time. That command
    line is removed from the map file by the boot loader by overwriting the
    sector immediately after reading it. The first word has
    to be the name of a boot image. If \raw{-R} is not followed by any words,
    the current default command line in the map file is erased.\footnote{%
      \raw{-R} is typically used in reboot scripts, e.g. \\
%%beginskip
\tt
%%endskip
\#!/bin/sh \\
cd / \\
/sbin/lilo -R "\$*" \&\& reboot}
    If the command line isn't valid, the map installer issues an error
    message and returns a non-zero exit code.
\end{description}


\subsubsection{Kernel name translation}

Determines the path of the kernel.

\begin{command}
  /sbin/lilo
    \unit{\[ -C \meta{config\_file} \]}
    \unit{-I \meta{name}}
    \unit{\[ \meta{options} \]}
\end{command}

\begin{description}
  \item[\raw{-C \meta{config\_file}}]~\\
    Specifies an alternate configuration file. See also section \ref{invshow}.
  \item[\raw{-I \meta{name} {$[$} \meta{options} {$]$}}]~ \\
    Translates the specified label name to the path of the corresponding kernel
    image and prints that path on standard output. This can be used to
    synchronize
    files that depend on the kernel (e.g. the \name{ps} database). The image
    name can be obtained from the environment variable \raw{BOOT\_IMAGE}. An
    error message is issued and a non-zero exit code is returned if no
    matching label name can be found. The existence of the image file is
    verified if the option character \raw{v} is added.
\end{description}


\subsubsection{De-installation}

Restores the boot sector that was used before the installation of \LILO.
Note that this option only works properly if \LILO's directories (e.g.
\path{/boot}) have not been touched since the first installation. See also
section \ref{deinst}.

\begin{command}
  /sbin/lilo
    \unit{\[ -C \meta{config\_file} \]}
    \unit{\[ -s \meta{save\_file} \]}
    \unit{-u \| -U}
    \unit{\[ \meta{boot\_device} \]}
\end{command}

\begin{description}
  \item[\raw{-C \meta{config\_file}}]~\\
    Specifies an alternate configuration file. See also section \ref{invshow}.
  \item[\raw{-s \meta{save\_file}}]~\\
    Specifies an alternate boot sector save file. \seealso
  \item[\raw{-u {$[$} \meta{device\_name} {$]$}}]~ \\
    Restores the backup copy of the specified boot sector. If no device is
    specified, the value of the \verb"boot" variable is used. If this one
    is also unavailable, \LILO\ uses the current root device. The name of
    the backup copy is derived from the device name. The \verb"-s" option
    or the \verb"backup" variable can be used to override this.
    \LILO\ validates the backup copy by checking a time stamp.
  \item[\raw{-U {$[$} \meta{device\_name} {$]$}}]~ \\
    Like \verb"-u", but does not check the time stamp.
\end{description}


\subsubsection{Print version number}

\begin{command}
  /sbin/lilo -V
\end{command}

\begin{description}
  \item[\raw{-V}]~ \\
    Print the version number and exit.
\end{description}


\subsubsection{Options corresponding to configuration variables}
\label{corropt}

There are also many command-line options that correspond to configuration
variables. See section \ref{cfgglo} for a description.

$$
\begin{tabular}{l|l}
  Command-line option		& Configuration variable \\
  \hline
  \raw{-b \meta{boot\_device}}	& \raw{boot=\meta{boot\_device}} \\
  \raw{-c}			& \raw{compact} \\
  \raw{-d \meta{tsecs}}		& \raw{delay=\meta{tsecs}} \\
  \raw{-D \meta{name}}		& \raw{default=\meta{name}} \\
  \raw{-i \meta{boot\_sector}}	& \raw{install=\meta{boot\_sector}} \\
  \raw{-l}			& \raw{linear} \\
  \raw{-m \meta{map\_file}}	& \raw{map=\meta{map\_file}} \\
  \raw{-P fix}			& \raw{fix-table} \\
  \raw{-P ignore}		& \raw{ignore-table} \\
  \raw{-s \meta{backup\_file}}	& \raw{backup=\meta{backup\_file}} \\
  \raw{-S \meta{backup\_file}}	& \raw{force-backup=\meta{backup\_file}} \\
  \raw{-v $\ldots$}		& \raw{verbose=\meta{level}} \\
\end{tabular}
$$


\subsection{Configuration}
\label{config}

The configuration information is stored in the file \path{/etc/lilo.conf}
and consists of variable assignments.


\subsubsection{Syntax}
\label{syntax}

The following syntax rules apply:

\begin{itemize}
  \item flag variables consist of a single word and are followed by
    whitespace or the end of the file.
  \item string variables consist of the variable name, optional whitespace,
    an equal sign, optional whitespace, the value and required whitespace,
    or the end of the file.
  \item a non-empty sequence of blanks, tabs, newlines and comments counts
    as whitespace.
  \item variable names are case-insensitive. Values are usually case-sensitive,
    but there are a few exceptions. (See below.)
  \item tabs and newlines are special characters and may not be part of a
    variable name or a value. The use of other control characters and
    non-ASCII characters is discouraged.
  \item blanks and equal signs may only be part of a variable name or a
    value if they are escaped by a backslash or if the value is embedded in
    double quotes. An equal sign may not be the only character in a name or
    value.
  \item an escaped tab is converted to an escaped blank. An escaped newline
    is removed from the input stream. An escaped backslash (i.e. two
    backslashes) is converted to a backslash. Inside quoted strings, only
    double quotes, backslashes, dollar signs, and newlines can be escaped.
  \item quoted strings can be continued over several lines by ending each
    incomplete line with a backslash. A single space is inserted in the
    string for the line end and all spaces or tabs that follow immediately
    on the next line.
  \item environment variables can be used by specifying them in the form
    \verb"$"\meta{name} or \verb"${"\meta{name}\verb"}". Dollar signs can
    be escaped.
  \item comments begin with a number sign and end with the next newline.
    All characters (including backslashes) until the newline are ignored.
\end{itemize}

Example:
\begin{verbatim}
boot = $FD
install = $MNT/boot.b
map = $MNT/map
compact
read-only
append = "nfsroot=/home/linux-install/root \
  nfsaddrs=128.178.156.28:128.178.156.24::255.255.255.0:lrcinst"
image = $MNT/zImage
\end{verbatim}


\subsubsection{Global options}
\label{cfgglo}

\path{/etc/lilo.conf} begins with a possibly empty global options section.
Many global options can also be set from the command line, but storing
permanent options in the configuration file is more convenient.

The following global options are recognized:

\begin{description}
  \item[\craw{backup=}\meta{backup\_file}] Copy the original boot sector to
    \meta{backup\_file} (which may also be a device, e.g. \path{/dev/null})
    instead of \path{/boot/boot.\meta{number}}
  \item[\craw{boot=}\meta{boot\_device}] Sets the name of the device (e.g.
    a hard disk partition) that contains
    the boot sector. If \craw{boot} is omitted, the boot sector is read from
    (and possibly written to) the device that is currently mounted as root.
  \item[\craw{change-rules}] Defines partition type numbers. See section
    \ref{ptcr} for details.
  \item[\craw{compact}] Tries to merge read requests for adjacent sectors into
    a single read request. This drastically reduces load time and keeps the
    map smaller. Using \craw{compact} is especially recommended when booting
    from a floppy disk.
    \craw{compact} may conflict with \craw{linear}, see section \ref{othpro}.
  \item[\craw{default=}\meta{name}] Uses the specified image as the default
    boot image. If \craw{default} is omitted, the image appearing first in the
    configuration file is used.
  \item[\craw{delay=}\meta{tsecs}] Specifies the number of \emphasize{tenths}
    of a second
    \LILO\ should wait before booting the first image. This is useful on
    systems that immediately boot from the hard disk after enabling the
    keyboard. \LILO\ doesn't wait if \craw{delay} is omitted or if \craw{delay}
    is set to zero.
  \item[\craw{disk=}\meta{device\_name}] Defines non-standard parameters
    for the specified disk. See section \ref{diskgeo} for details.
  \item[\craw{fix-table}]\label{fix-table}Allows \LILO\ to adjust 3D addresses
    in partition
    tables. Each partition entry contains a 3D (sector/head/cylinder) and a
    linear address of the first and the last sector of the partition. If a
    partition is not track-aligned and if certain other operating systems
    (e.g. PC/MS-DOS or OS/2) are using the same disk, they may change the 3D
    address. \LILO\ can store its boot sector only on partitions where both
    address types correspond. \LILO\ re-adjusts incorrect 3D start addresses
    if \craw{fix-table} is set.

    \emphasize{WARNING:} This does not guarantee that other operating systems
    may not attempt to reset the address later. It is also possible that this
    change has other, unexpected side-effects. The correct fix is to
    re-partition the drive with a program that does align partitions to tracks.
    Also, with some disks (e.g. some large EIDE disks with address
    translation enabled), under some circumstances, it may even be unavoidable
    to have conflicting partition table entries.
  \item[\craw{force-backup=}\meta{backup\_file}] Like \craw{backup}, but
    overwrite an old backup copy if it exists.
    \craw{backup=}\meta{backup\_file}
    is ignored if \craw{force-backup} appears in the same configuration file.
  \item[\craw{ignore-table}] Tells LILO to ignore corrupt partition tables and
    to put the boot sector even on partitions that appear to be unsuitable for
    that.
  \item[\craw{install=}\meta{boot\_sector}] Install the specified file as the
    new boot sector. If \craw{install} is omitted, \path{/boot/boot.b} is used
    as the default.
  \item[\craw{keytable=}\meta{table\_file}] Re-map the keyboard as specified
    in this file. See section \ref{keytab} for details.
  \item[\craw{linear}] Generate linear sector addresses instead of
    sector/head/cylinder addresses. Linear addresses are translated at run
    time and do not depend on disk geometry. Note that boot disks
    may not be portable if \craw{linear} is used,
    because the BIOS service to
    determine the disk geometry does not work reliably for floppy disks.
    When using \craw{linear} with large disks, \path{/sbin/lilo} may
    generate references to inaccessible disk areas (see section \ref{broken}),
    because 3D sector addresses are not known before boot time.
    \craw{linear} may conflict with \craw{compact}, see section \ref{othpro}.
  \item[\craw{map=}\meta{map\_file}] Specifies the location of the map file.
    If \craw{map} is omitted, a file \path{/boot/map} is used.
  \item[\craw{message=}\meta{message\_file}] Specifies a file containing a
    message that is displayed before the boot prompt. No message is displayed
    while waiting for a modifier key (\key{Shift}, etc.) after printing
    ``LILO ''. In the message, the \raw{FF}
    character (\hbox{\key{Ctrl L}}) clears the local screen. The size of the
    message file is limited to 65535 bytes. The map file has to be rebuilt
    if the message file is changed or moved.
  \item[\craw{nowarn}] Disables warnings about possible future dangers.
  \item[\craw{prompt}] Forces entering the boot prompt without expecting any
    prior key-presses. Unattended reboots are impossible if \craw{prompt} is
    set and \craw{timeout} isn't.
  \item[\craw{serial=}\meta{parameters}] Enables control from a serial line.
    The specified serial port is initialized and \LILO\ is accepting input from
    it and from the PC's keyboard. Sending a break on the serial line
    corresponds to pressing a shift key on the console in order to get
    \LILO's attention. All boot images should be password-protected if the
    serial access is less secure than access to the console, e.g. if the
    line is connected to a modem. The parameter string has the following
    syntax: \\
    \raw{\meta{port},\meta{bps}\,\meta{parity}\,\meta{bits}} \\
    The components \meta{bps}, \meta{parity} and \meta{bits} can be
    omitted. If a component is omitted, all following components have to
    be omitted too. Additionally, the comma has to be omitted if only the
    port number is specified.
    \begin{description}
      \item[\meta{port}] the number of the serial port, zero-based. 0
	corresponds to \path{COM1} alias \path{/dev/ttyS0}, etc. All four
	ports can be used (if present).
      \item[\meta{bps}] the baud rate of the serial port. The following
	baud rates are supported: 110, 300, 1200, 2400, 4800, 9600, 19200, and
        38400 bps. Default is 2400 bps.
      \item[\meta{parity}] the parity used on the serial line. \LILO\ ignores
	input parity and strips the 8th bit. The following (upper or lower
	case) characters are used to describe the parity: \raw{n} for no
	parity, \raw{e} for even parity and \raw{o} for odd parity.
      \item[\meta{bits}] the number of bits in a character. Only 7 and 8
	bits are supported. Default is 8 if parity is ``none'', 7 if parity
	is ``even'' or ``odd''.
    \end{description}
    If \craw{serial} is set, the value of \craw{delay} is automatically raised
    to 20.

    Example: \verb"serial=0,2400n8" initializes \path{COM1} with the
    default parameters.
  \item[\craw{timeout=}\meta{tsecs}] Sets a timeout (in tenths of a second) for
    keyboard input. If no key is pressed for the specified time, the first
    image is automatically booted. Similarly, password input is aborted if
    the user is idle for too long. The default timeout is infinite.
  \item[\craw{verbose=}\meta{level}] Turns on lots of progress reporting.
    Higher numbers give more verbose output. If \raw{-v} is additionally
    specified on the command line, \meta{level} is increased accordingly.
    The following verbosity levels exist:
    \begin{description}
      \item[$<$0] only warnings and errors are shown
      \item[0] prints one line for each added or skipped image
      \item[1] mentions names of important files and devices and why they
	are accessed. Also displays informational messages for exceptional
	but harmless conditions and prints the version number.
      \item[2] displays statistics and processing of temporary files and
        devices
      \item[3] displays disk geometry information and partition table change
	rules
      \item[4] lists sector mappings as they are written into the map file
	(i.e. after compaction, in a format suitable to pass it to the BIOS)
      \item[5] lists the mapping of each sector (i.e. before compaction, raw)
    \end{description}
    When using the \raw{-q} option, the levels have a slightly different
    meaning:
    \begin{description}
      \item[0] displays only image names
      \item[1] also displays all global and per-image settings
      \item[2] displays the address of the first map sector
    \end{description}
\end{description}

Additionally, the kernel configuration parameters \craw{append}, \craw{initrd},
\craw{ramdisk}, \craw{read-only}, \craw{read-write}, \craw{root} and
\craw{vga}, and the general per-image options \craw{fallback}, \craw{lock},
\craw{optional}, \craw{password}, \craw{restricted}, and
\craw{single-key} can be set in
the global options section. They are used as defaults if they aren't specified
in the configuration sections of the respective images. See below for a
description.

The plethora of options may be intimidating at first, but in ``normal''
configurations, hardly any options but \craw{boot}, \craw{compact},
\craw{delay}, \craw{root}, and \craw{vga} are used.


\subsubsection{General per-image options}
\label{cfggen}

The following options can be specified for all images, independent of their
type:
\begin{description}
  \item[\craw{alias=}\meta{name}] Specifies a second name for the current
    entry.
  \item[\craw{fallback=}\meta{command\_line}] Specifies a string that is stored
    as the default command line if the current image is booted. This is useful
    when experimenting with kernels which may crash before allowing
    interaction with the system. If using the \craw{fallback} option, the
    next reboot (e.g. triggered by a manual reset or by a watchdog timer)
    will load a different (supposedly stable) kernel. The command line by the
    fallback mechanism is
    cleared by removing or changing the default command line with the \raw{-R}
    option, see \ref{invcmd}.
  \item[\craw{label=}\meta{name}] By default, \LILO\ uses the main file name
    (without its
    path) of each image specification to identify that image. A different name
    can be used by setting the variable \craw{label}.
  \item[\craw{lock}] Enables automatic recording of boot command lines as the
    defaults for the following boots. This way, \LILO\ ``locks'' on a
    choice until it is manually overridden.
  \item[\craw{optional}] Omit this image if its main file is not available at
    map creation time. This is useful to specify test kernels that are not
    always present.
  \item[\craw{password=}\meta{password}] Ask the user for a password when
    trying to load this image. Because the configuration file contains
    unencrypted passwords when using this option, it should only be readable
    for the super-user. Passwords are always case-sensitive.
  \item[\craw{restricted}] Relaxes the password protection by requiring a
    password only if parameters are specified on the command line
    (e.g. \verb"single"). \craw{restricted} can only be used together with
    \craw{password}.
  \item[\craw{single-key}] Enables booting the image by hitting a
    single key, without the need to press \key{Enter} afterwards.
    \craw{single-key} requires that either the image's label or its
    alias (or both) is a single character. Furthermore, no other image label
    or alias may start with that character, e.g. an entry specifying a
    label \raw{linux} and an alias \raw{l} is not allowed with
    \craw{single-key}. Note that you can't specify command-line parameters for
    an entry for which only \craw{single-key}ed names exist.
\end{description}

All general per-image options, with the exception of \craw{label} and
\craw{alias}, can also be set in the global options section as defaults
for all images.

Example:
\begin{verbatim}
password = Geheim
single-key
image = /vmlinuz
  label = linux
  alias = 1
  restricted
other = /dev/hda1
  label = dos
  alias = 2
\end{verbatim}


\subsubsection{Per-image options for kernels}
\label{cfgkern}

Each (kernel or non-kernel)
image description begins with a special variable (see section \ref{bootimg})
which is followed by optional
variables.
The following variables can be used for all image descriptions
that describe a Linux kernel:

\begin{description}
  \item[\craw{append=}\meta{string}] Appends the options specified in
    {\meta{string}} to the parameter line passed to the kernel. This is
    typically used to specify parameters of hardware that can't be entirely
    auto-detected, e.g.\\
    \verb'append = "hd=64,32,202"'
  \item[\craw{initrd=}\meta{name}] Specifies the file that will be loaded at
    boot time as the initial RAM disk. 
  \item[\craw{literal=}\meta{string}] like \craw{append}, but removes all other
    options (e.g. setting of the root device). Because vital options can be
    removed unintentionally with \craw{literal}, this option cannot be set in
    the global options section.
  \item[\craw{ramdisk=}\meta{size}] Specifies the size of the optional RAM disk.
    A value of zero indicates that no RAM disk should be created. If this
    variable is omitted, the RAM disk size configured into the boot
    image is used.
  \item[\craw{read-only}] Specifies that the root file system should be
    mounted read-only. Typically, the system startup procedure re-mounts
    the root file system read-write later (e.g. after fsck'ing it).
  \item[\craw{read-write}] specifies that the root file system should be
    mounted read-write.
  \item[\craw{root=}\meta{root\_device}] Specifies the device that should be
    mounted as root. If the special name \craw{current} is used, the root
    device is set to the device on which the root file system is currently
    mounted. If the root has been changed with \raw{-r}, the respective
    device is used. If the variable \craw{root} is omitted, the root device
    setting contained in the kernel image is used. It can be changed
    with the \name{rdev} program.
  \item[\craw{vga=}\meta{mode}]\label{vga} Specifies the VGA text mode that
    should be selected when booting. The following values are recognized
    (case is ignored):
    \begin{description}
      \item[\craw{normal}] select normal 80x25 text mode.
      \item[\craw{extended}] select 80x50 text mode. The word \craw{extended}
	can be abbreviated to \craw{ext}.
      \item[\craw{ask}] stop and ask for user input (at boot time).
      \item[\meta{number}] use the corresponding text mode. A list of available
	modes can be obtained by booting with \raw{vga=ask} and pressing
	\key{Enter}.
    \end{description}
    If this variable is omitted, the VGA mode setting contained in the kernel
    image is used. \name{rdev} supports manipulation of the VGA text mode
    setting in the kernel image.
\end{description}

All kernel per-image options but \craw{literal} can also be set in the global
options section as defaults for all kernels.

If one of \craw{ramdisk}, \craw{read-only}, \craw{read-write}, \craw{root},
or \craw{vga} is omitted in the configuration file and the
corresponding value in the kernel image is changed, \LILO\ or the kernel
will use the new value.

It is perfectly valid to use different settings for the same
image, because \LILO\ stores them in the image descriptors and not in the
images themselves.

Example:
\begin{verbatim}
image = /vmlinuz
  label = lin-hd
  root = /dev/hda2
image = /vmlinuz
  label = lin-fd
  root = /dev/fd0
\end{verbatim}


\subsection{Boot image types}
\label{bootimg}

\LILO\ can boot the following types of images:
\begin{itemize}
  \item kernel images from a file.
  \item kernel images from a block device. (E.g. a floppy disk.)
  \item the boot sector of some other operating system.
\end{itemize}

The image type is determined by the name of the initial
variable of the configuration section.

The image files can reside on any media that is accessible at boot time.
There's no need to put them on the root device, although this certainly
doesn't hurt.


\subsubsection{Booting kernel images from a file}

The image is specified as follows: \craw{image=}\meta{name}

Example:
\begin{verbatim}
image = /linux
\end{verbatim}

See sections \ref{cfggen} and \ref{cfgkern} for the options that can be
added in a kernel image section.


\subsubsection{Booting kernel images from a device}

The range of sectors
that should be mapped has to be specified. Either a range
(\raw{\meta{start}-\meta{end}}) or a start and a distance
(\raw{\meta{start}+\meta{number}}) have to be specified. \meta{start}
and \meta{end} are zero-based. If only
the start is specified, only that sector is mapped.

The image is specified as follows: \craw{image=}\meta{device\_name}\quad
Additionally, the \craw{range} variable must be set.

Example:
\begin{verbatim}
image = /dev/fd0
  range = 1+512
\end{verbatim}

All kernel options can also be used when booting the kernel from a device.


\subsubsection{Booting a foreign operating system}
\label{bootfor}

\LILO\ can even boot other operating systems, i.e. MS-DOS.
To boot an other operating
system, the name of a loader program, the device or file that contains the boot
sector and the device that contains the partition table have to be
specified.

The boot sector is merged with the partition table and stored in the map file.

Currently, the loaders \path{chain.b} and \path{os2\_d.b} exist.
\path{chain.b} simply starts the specified boot sector.\footnote{The boot
sector is loaded by \LILO's secondary boot loader before control is passed
to the code of \path{chain.b}.} \path{os2\_d.b} it a variant of \path{chain.b}
that can boot OS/2 from the second hard disk.
The \craw{map-drive} option has to be used with \path{os2\_d.b} to
actually swap the drives.

The image is specified as follows: \craw{other=}\meta{device\_name} or
\craw{other=}\meta{file\_name}

In addition to the options listen in section \ref{cfggen}, the following
variables are recognized:
\begin{description}
  \item[\craw{change}] Change the partition table according to the rules
    specified in this \craw{change} section. This option is intended for
    booting systems which find their partitions by examining the
    partition table. See section \ref{ptch} for details.
  \item[\craw{loader=}\meta{chain\_loader}] Specifies the chain loader that
    should be used. If it is omitted, \path{/boot/chain.b} is used.
  \item[\craw{map-drive=}\meta{bios\_device\_code}] Instructs \path{chain.b}
    to installs a resident driver that re-maps the floppy
    or hard disk drives. This way, one can boot any operating system from a
    hard disk different from the first one, as long as that operating system
    uses \emphasize{only} the BIOS to access that hard disk.\footnote{So you
should be very suspicious if the
operating system requires any specific configuration or even drivers to use
the disk it is booted from. Since there is a general trend to use optimized
drivers to fully exploit the hardware capabilities (e.g. non-blocking disk
access), booting systems from the second disk may become increasingly
difficult.} This is known to work for PC/MS-DOS.

    \craw{map-drive} is followed by the variable
    \craw{to=}\meta{bios\_device\_code} which specifies the drive that should
    effectively be accessed instead of the original one.
    The list of mappings is only searched until the first match is found.
    It is therefore possible to ``swap'' drives, see the second example below.
  \item[\craw{table=}\meta{device}] Specifies the device that contains the
    partition
    table. \LILO\ does not pass partition information to the booted operating
    system if this variable is omitted. (Some operating systems have other
    means to determine from which partition they have been booted. E.g. MS-DOS
    usually stores the geometry of the boot disk or partition in its boot
    sector.) Note that \path{/sbin/lilo} must be re-run if a partition table
    mapped referenced with \craw{table} is modified.
  \item[\craw{unsafe}] Do not access the boot sector at map creation time. This
    disables some sanity checks, including a partition table check. If the boot
    sector is on a fixed-format floppy disk device, using \craw{unsafe} avoids
    the need to put a readable disk into the drive when running the map
    installer. \craw{unsafe} and \craw{table} are mutually incompatible.
\end{description}

None of these options can be set in the global options section.

Examples:
\begin{verbatim}
other = /dev/hda2
  label = dos
  table = /dev/hda
\end{verbatim}

\begin{verbatim}
other = /dev/hdb2
  label = os2
  loader = /boot/os2_d.b
  map-drive = 0x80
    to = 0x81
  map-drive = 0x81
    to = 0x80
\end{verbatim}


\subsection{Disk geometry}
\label{diskgeo}

For floppies and most hard disks, \LILO\ can obtain the
disk geometry information from the kernel. Unfortunately, there are some
exotic disks or adapters which may either not supply this information or
which may even return incorrect information.

If no geometry information is available, \LILO\ reports either the error \\
\raw{geo\_query\_dev HDIO\_GETGEO (dev 0x\meta{number})} \\
or \\
\raw{Device 0x\meta{number}: Got bad geometry \meta{sec}/\meta{hd}/%
\meta{cyl}}

If incorrect information is returned, booting may fail in several ways,
typically with a partial ``LILO'' banner message. In this document, that
is called a ``geometry mismatch''.

The next step should be to attempt setting the \craw{linear} configuration
variable or the \raw{-l} command-line option. If
this doesn't help, the entire disk geometry has to be specified explicitly.
Note that \craw{linear} doesn't always work with floppy disks.

Another common use of disk sections is if an (E)IDE and a SCSI drive are
used in the same system and the BIOS is configured to use the SCSI drive
as the first drive. (Normally, the (E)IDE drive would be the first drive
and the SCSI drive would be the second one.) Since \LILO\ doesn't know
how the BIOS is configured, it needs to be told explicitly about this
arrangement. (See the second example below.)


\subsubsection{Obtaining the geometry}

The disk geometry parameters can be obtained by booting MS-DOS and
running the program \path{DPARAM.COM} with the hexadecimal BIOS code of
the drive as its argument, e.g. \verb"dparam 0x80" for the first hard
disk. It displays the number of sectors per
track, the number of heads per cylinder and the number of cylinders.
All three numbers are one-based.

Alternatively, the geometry may also be determined by reading the information
presented by the ``setup'' section of the ROM-BIOS or by using certain disk
utilities under operating systems accessing the disk through the BIOS.


\subsubsection{Specifying the geometry}
\label{diskspec}

Disk geometry parameters are specified in the options section of the
configuration file. Each disk parameter section begins with
\craw{disk=}\meta{disk\_device}, similar to the way how boot images are
specified.
It is suggested to group disk parameter sections together, preferably
at the beginning or the end of the options section.

For each disk, the following variables can be specified:
\begin{description}
  \item[\craw{bios=}\meta{bios\_device\_code}] Is the number the BIOS uses
    to refer to that device. Normally, it's \raw{0x80} for the first hard
    disk and \raw{0x81} for the second hard disk. Note that hexadecimal
    numbers have to begin with ``0x''. If \craw{bios} is omitted,
    \LILO\ tries to ``guess'' that number.
  \item[\craw{sectors=}\meta{sectors}] and
  \item[\craw{heads=}\meta{heads}] specify the number of sectors per
    track and the number of heads, i.e. the number of tracks per
    cylinder. Both parameters have to be either specified together or
    they have to be entirely omitted. If omitted, \LILO\ tries to obtain
    that geometry information from the kernel.
  \item[\craw{cylinders=}\meta{cylinders}] Specifies the number of cylinders.
    This value is only used for sanity checks. If \craw{cylinders} is omitted,
    \LILO\ uses the information obtained from the kernel if geometry
    information had to be requested in order to determine some other
    parameter. Otherwise,\footnote{I.e. if the BIOS device code, the number
    of sectors, the number of heads and the partition start are specified.
    Note that the number of cylinders may appear to vary if \craw{cylinders}
    is absent and only some of the partition starts are specified.} it just
    assumes the number of cylinders to be 1024, which is the cylinder limit
    imposed by the BIOS.
  \item[\craw{inaccessible}] Marks the device as inaccessible (for the BIOS).
    This is useful if some disks on the system can't be read by the BIOS,
    although \LILO\ ``thinks'' they can. If one accidentally tries to use
    files located on such disks for booting, the map installer won't notice
    and the system becomes unbootable. The most likely use of
    \craw{inaccessible} is to prevent repetition after experiencing such a
    situation once. No other variables may be specified if a device is
    configured as \craw{inaccessible}.
\end{description}

Additionally, partition subsections can be added with
\craw{partition=}\meta{partition\_device}. Each partition section can
contain only one variable:
\begin{description}
  \item[\craw{start=}\meta{partition\_offset}] Specifies the zero-based
    number of the start sector of that partition. The whole disk always
    has a partition offset of zero. The partition offset is only necessary
    when using devices for which the kernel does not provide that
    information, e.g. CD-ROMs.
\end{description}

Examples:
\begin{verbatim}
disk = /dev/sda
  bios = 0x80
  sectors = 32
  heads = 64
  cylinders = 632
  partition = /dev/sda1
    start = 2048
  partition = /dev/sda2
    start = 204800
  partition = /dev/sda3
    start = 500000
  partition = /dev/sda4
    start = 900000
\end{verbatim}

\begin{verbatim}
disk = /dev/sda
  bios = 0x80
disk = /dev/hda
  bios = 0x81
\end{verbatim}


\subsection{Partition table manipulation}
\label{ptman}

Some non-Linux operating systems obtain information about their partitions
(e.g. their equivalent of the root file system) from the partition table.
If more than one such operating system is installed on a PC, they may have
conflicting interpretations of the content of the partition table. Those
problems can be avoided by changing the partition table, depending on which
operating system is being booted.

Partition table changes are specified in a \craw{change} section in the
configuration file section describing the foreign operating system. Note
that \craw{change} sections are only accepted if the build-time option
\raw{REWRITE\_TABLE} is set.

The \craw{change} section contains subsections for each partition whose
table entry needs to be modified. Partitions are specified with
\craw{partition=}\meta{device\_name}

Changes are applied in the sequence in which they appear in the
configuration file. Configurations containing changes that are redundant
either by repeating a previous change or by changing its result further
are invalid and refused by the map installer.

Internally, all changes are expressed as rules which specify the location
(disk and offset in the partition table), the value this location must
contain before the change, and the value that has to be stored. As a
safety measure, the rule is ignored if the previous value is found to be
different.


\subsubsection{Partition activation}

This option is intended for booting systems which determine their boot
partition by examining the active flag in the partition table. The flag
is enabled with \craw{activate} and disabled with \craw{deactivate}.
Note that only the current partition is affected. \LILO\ does not
automatically change the active flags of other partitions and it also
allows more than one partition to be active at the same time.

Example:

\begin{verbatim}
other = /dev/sda4
  label = sco
  change
    partition = /dev/sda4
      activate
    partition = /dev/sda3
      deactivate
\end{verbatim}


\subsubsection{Partition type change rules}
\label{ptcr}

Partition type changes are normally a transition between two possible values,
e.g. a typical convention is to set the lowest bit in the upper nibble of the
partition type (i.e. 0x10) in order to
``hide'', and to clear it to ``unhide'' a partition. \LILO\ performs these
changes based on a set of rules. Each rule defines the name of a partition
type, its normal value, and the value when hidden. Those rules are defined
in the options section of the configuration file. The section defining
them begins with \craw{change-rules}.

The following options and variables can appear in the section:
\begin{description}
  \item[\craw{reset}] Removes all previously defined rules. This is needed
    if a user doesn't wish to use the pre-defined rules (see below).
  \item[\craw{type=}\meta{name}] Adds a rule for the type with the specified
    name. Type names are case-insensitive.
    The values are defined with \craw{normal=}\meta{byte} and
    \craw{hidden=}\meta{byte}. Values can be specified as decimal or as
    hexadecimal numbers with a leading \raw{0x}. If only one of the values
    is present, the other value is assumed to be the same number,
    but with the most significant bit inverted.
\end{description}

\LILO\ pre-defines rules for the three partition types of DOS partitions.
The following example removes the pre-defined rules and creates them again:

\begin{verbatim}
change-rules
  reset
  type = DOS12
    normal = 0x01
    hidden = 0x11
  type = DOS16_small
    normal = 4 # hidden is 0x14
  type = DOS16_big
    hidden = 0x16
\end{verbatim}


\subsubsection{Partition type changes}
\label{ptch}

Partition type changes are specified in the partition section as
\craw{set=}\meta{name}\craw{\_}\meta{state}, where \meta{name} is the
name of the partition type, and \meta{state} is its state, i.e.
\craw{normal} or \craw{hidden}.

Example:

\begin{verbatim}
other = /dev/sda3
  label = dos
  change
    partition = /dev/sda2
      set = dos16_big_normal
    partition = /dev/sda3
      activate
      set = DOS16_big_normal
\end{verbatim}

Only one \craw{set} variable is allowed per partition section. In the
rare event that more than one \craw{set} variable is needed, further
partition sections can be used.


\subsection{Keyboard translation}
\label{keytab}

The PC keyboard emits so-called scan codes, which are basically key
numbers. The BIOS then translates those scan codes to the character codes
of the characters printed on the key-caps. By default, the BIOS normally
assumes that the keyboard has a US layout. Once an operating system is
loaded, this operating system can use a different mapping.

At boot time, \LILO\ only has access to the basic services provided
by the BIOS and therefore receives the character codes for an US keyboard.
It provides a simple mechanism to re-map the character codes to what is
appropriate for the actual layout.\footnote{The current mechanism isn't
perfect, because it sits on top of the scan code to character code
translation performed by the BIOS. This means that key combinations that
don't produce any useful character on the US keyboard will be ignored by
\LILO. The advantage of this approach is its simplicity.}


\subsubsection{Compiling keyboard translation tables}

\LILO\ obtains layout information from the keyboard translation tables
Linux uses for the text console. They are usually stored in
\path{/usr/lib/kbd/keytables}. \LILO\ comes with a program
\name{keytab-lilo.pl} that reads those tables and generates a table
suitable for use by the map installer. \name{keytab-lilo.pl} invokes
the program \name{loadkeys} to print the tables in a format that is
easy to parse.\footnote{On some systems, only root can execute
\name{loadkeys}. It is then necessary to run \name{keytab-lilo.pl} as
root too.}

\name{keytab-lilo.pl} is used as follows:

\begin{command}
  keytab-lilo.pl
    \unit{\[ -p \meta{old\_code}=\meta{new\_code} \] $\ldots$}
    \unit{\[\meta{path}\]\meta{default\_layout}\[.\meta{extension}\] \]} \\
    \unit{\[\meta{path}\]\meta{kbd\_layout}\[.\meta{extension}\] \]}
\end{command}

\begin{description}
  \item[\raw{-p \meta{old\_code}=\meta{new\_code}}]~\\
    Specifies corrections (``patches'') to the mapping obtained from the
    translation table files. E.g. if pressing the upper case ``A'' should
    yield an at sign, \verb"-p 65=64" would be used. The \raw{-p} option can
    be repeated any number of times. The codes can also be given as
    hexadecimal or as octal numbers if they are prefixed with \verb"0x" or
    \verb"0", respectively.
  \item[\meta{path}] The directory in which the file resides. The default
    path is \path{/usr/lib/kbd/keytables}.
  \item[\meta{extension}] Usually the trailing \path{.map}, which is
    automatically added if the file name doesn't contain dots.
  \item[\meta{default\_layout}] Is the layout which specifies the
    translation by the BIOS. If none is specified, \path{us} is assumed.
  \item[\meta{kbd\_layout}] Is the actual layout of the keyboard.
\end{description}

\name{keytab-lilo.pl} writes the resulting translation table as a binary
string to standard output. Such tables can be stored anywhere with any name,
but the suggested naming convention is \path{/boot/\meta{kbd}.ktl}
(``\underline{K}eyboard \underline{T}able for \underline{L}ilo''), where
\meta{kbd} is the name of the keyboard layout.

Example:
\begin{verbatim}
keytab-lilo.pl de >/boot/de.ktl
\end{verbatim}


\subsubsection{Using keyboard translation tables}

The keyboard translation table file is specified with the global configuration
option \raw{keytable=\meta{table\_file}}. The complete name of the file has
to be given.

Example:
\begin{verbatim}
keytable = /boot/de.klt
\end{verbatim}


\newpage
\section{Installation and updates}


\subsection{Installation}

This section describes the installation of \LILO. See section \ref{deinst}
for how to uninstall \LILO.


\subsubsection{Compatibility}

The kernel header files have to be in
\path{/usr/include/linux} and the kernel usually has to be configured by
running \raw{make config} before \LILO\ can be compiled.

\path{/bin/sh} has to be a real Bourne shell. \name{bash} is sufficiently
compatible, but some \name{ksh} clones may cause problems.

A file named \path{INCOMPAT} is included in the distribution. It describes
incompatibilities to older versions of \LILO\ and may also contain further
compatibility notes.


\subsubsection{Quick installation}
\label{quickinst}

If you want to install \LILO\ on your hard disk and if you don't want
to use all its features, you can use the quick installation script.
Read \path{QuickInst} for details.

\name{QuickInst} can only be used for first-time installations or to
entirely replace an existing installation, \emphasize{not}
to update or modify an existing installation of \LILO. Be sure you've
extracted \LILO\ into a directory that doesn't contain any files of
other \LILO\ installations.


\subsubsection{Files}

Some of the files contained in \path{lilo-21.tar.gz}:

\begin{description}
  \item[\path{lilo/README}]~\\
    This documentation in plain ASCII format. Some sections containing
    complex tables are only included in the \LaTeX\ version in
    \path{doc/user.tex}
  \item[\path{lilo/INCOMPAT}]~\\
    List of incompatibilities to previous versions of \LILO.
  \item[\path{lilo/CHANGES}]~\\
    Change history.
  \item[\path{lilo/VERSION}]~\\
    The version number of the respective release.
  \item[\path{lilo/QuickInst}]~\\
    Quick installation script.
  \item[\path{lilo/lilo-\meta{version}.lsm}]~\\
    The LSM (``\underline{L}inux \underline{S}oftware \underline{M}ap'') entry
    of the respective \LILO\ release.
  \item[\path{lilo/Makefile}]~\\
    Makefile to generate everything else.
  \item[\path{lilo/*.c}, \path{lilo/*.h}]~\\
    LILO map installer C source and common header files.
  \item[\path{lilo/*.S}]~\\
    LILO boot loader assembler source.
  \item[\path{lilo/activate.c}]~\\
    C source of a simple boot partition setter.
  \item[\path{lilo/dparam.s}]~\\
    Assembler source of a disk parameter dumper.
  \item[\path{lilo/mkdist}]~\\
    Shell script used to create the current \LILO\ distribution.
  \item[\path{lilo/keytab-lilo.pl}]~\\
    Perl script to generate keyboard translation tables.
  \item[\path{lilo/doc/README}]~\\
    Description of how to generate the documentation.
  \item[\path{lilo/doc/Makefile}]~\\
    Makefile used to convert the \LaTeX\ source into either DVI output or
    the plain ASCII README file.
  \item[\path{lilo/doc/user.tex}]~\\
    \LaTeX\ source of \LILO's user's guide (this document).
  \item[\path{lilo/doc/tech.tex}]~\\
    \LaTeX\ source of \LILO's technical overview.
  \item[\path{lilo/doc/*.fig}]~\\
    Various \name{xfig} pictures used in the technical overview.
  \item[\path{lilo/doc/fullpage.sty}]~\\
    Style file to save a few square miles of forest.
  \item[\path{lilo/doc/rlatex}]~\\
    Shell script that invokes \LaTeX\ repeatedly until all references have
    settled.
  \item[\path{lilo/doc/t2a.pl}]~\\
    \name{Perl} script to convert the \LaTeX\ source of the user's guide to
    plain ASCII.
\end{description}

Files created after \raw{make} in \path{lilo/} (among others):

\begin{description}
  \item[\path{lilo/boot.b}]~\\
    Combined boot sector. \raw{make install} puts this file into \path{/boot}
  \item[\path{lilo/chain.b}]~\\
    Generic chain loader. \raw{make install} puts this file into \path{/boot}
  \item[\path{lilo/os2\_d.b}]~\\
    Chain loader to load \name{OS/2} from the second hard disk.
    \raw{make install} puts this file into \path{/boot}
  \item[\path{lilo/lilo}]~\\
    \LILO\ (map) installer. \raw{make install} puts this file into \path{/sbin}
  \item[\path{lilo/activate}]~\\
    Simple boot partition setter.
  \item[\path{lilo/dparam.com}]~\\
    MS-DOS executable of the disk parameter dumper.
\end{description}


\subsubsection{Normal first-time installation}
\label{install}

First, you have to install the \LILO\ files:

\begin{itemize}
  \item extract all files from \path{lilo-\meta{version}.tar.gz} in a new
    directory.\footnote{E.g. \path{/usr/src/lilo}}
  \item configure the \path{Makefile} (see section \ref{cfgmf})
  \item run\quad\raw{make}\quad to compile and assemble all parts.
  \item run\quad\raw{make install}\quad to copy all \LILO\ files to
     the directories where they're installed. \path{/sbin} should now
     contain the file \path{lilo},  \path{/usr/sbin} should contain
     \path{keytab-lilo.pl}, and
     \path{/boot} should contain \path{boot.b}, \path{chain.b}, and
     \path{os2\_d.b}.
\end{itemize}

If you want to use \LILO\ on a non-standard disk, you might have to determine
the parameters of your disk(s) and specify them in the configuration file.
See section \ref{diskgeo} for details.
If you're using such a non-standard system, the next step is to test
\LILO\ with the boot sector on a floppy disk:

\begin{itemize}
  \item insert a blank (but low-level formatted) floppy disk into
    \path{/dev/fd0}.
  \item run \raw{echo image=\meta{kernel\_image}}\verb" |"\\
    \raw{/sbin/lilo -C - -b /dev/fd0 -v -v -v} \\
    If you've already installed \LILO\ on your system, you might not want
    to overwrite your old map file.
    Use the \raw{-m} option to specify an alternate map file name.
  \item reboot. \LILO\ should now load its boot loaders from the floppy disk
    and then continue loading the kernel from the hard disk.
\end{itemize}

Now, you have to decide, which boot concept you want to use. Let's assume
you have a Linux partition on \path{/dev/hda2} and you want to install your
\LILO\ boot sector there. The DOS-MBR loads the \LILO\ boot sector.

\begin{itemize}
  \item get a working boot disk, e.g. an install or recovery disk. Verify that
    you can boot
    with this setup and that you can mount your Linux partition(s) with it.
  \item if the boot sector you want to overwrite with \LILO\ is of any value
    (e.g. it's the MBR or if it contains a boot loader you might want to use
    if you encounter problems with \LILO), you should mount your boot disk
    and make a backup copy of your boot sector to a file on that floppy,
    e.g. \verb"dd if=/dev/hda of=/fd/boot_sector bs=512 count=1"
  \item create the configuration file \path{/etc/lilo.conf}, e.g. \\
\meta{global settings} \\
\meta{image specification} \\
\verb"  "\meta{per-image options} \\
$\ldots$ \\
    Be sure to use absolute paths for all files. Relative paths may cause
    unexpected behaviour when using the \raw{-r} option.
  \item now, you can check what \LILO\ would do if you were about to install
    it on your hard disk: \\
\verb"/sbin/lilo -v -v -v -t"
  \item if you need some additional boot utility (i.e. \name{BOOTACTV}), you
    should install that now
  \item run \path{/sbin/lilo} to install \LILO\ on your hard disk
  \item if you have to change the active partition, use \name{fdisk} or
    \name{activate} to do that
  \item reboot
\end{itemize}


\subsubsection{Build-time configuration}
\label{cfgmf}

Certain build-time parameters can be configured.
They can either be edited in the top-level \path{Makefile} or they can be
stored in a file \path{/etc/lilo.defines}. Settings in the \path{Makefile}
are ignored if that file exists.

The following items can be configured:
\begin{description}
  \item[\raw{BEEP}] Enables beeping after displaying ``LILO''. This is
    useful on machines which don't beep at the right time when booting
    and when working over a serial
    console. This option is disabled by default.
  \item[\raw{IGNORECASE}] Makes image name matching case-insensitive, i.e.
    ``linux'' and ``Linux'' are identical. This option is enabled by
    default. Note that password matching is always case-sensitive.
  \item[\raw{LARGE\_EDBA}] Loads \LILO\ at a lower address in order to
    leave more space for the EBDA (Extended BIOS Data Area). This is
    necessary on some recent MP systems. Note that enabling \raw{LARGE\_EDBA}
    reduces the maximum size of ``small'' images (e.g. ``Image'' or
    ``zImage'').
  \item[\raw{NO1STDIAG}] Do not generate diagnostics on read errors in the
    first stage boot loader. This avoids possibly irritating error codes
    if the disk controller has transient read problems. This option is
    disabled by default.
  \item[\raw{NODRAIN}] The boot loader empties the keyboard buffer
    when starting, because it may contain garbage on some systems. Draining
    the keyboard buffer can be disabled by setting the \raw{NODRAIN} option.
    \raw{NODRAIN} is disabled by default.
  \item[\raw{NOINSTDEF}] If the option \craw{install} is omitted, don't install
    a new boot sector, but try to modify the old boot sector instead. This
    option is disabled by default.
  \item[\raw{ONE\_SHOT}] Disables the command-line timeout (configuration
    variable \craw{timeout}) if any key is pressed. This way, very short
    timeouts can be used if \craw{prompt} is set. \raw{ONE\_SHOT} is disabled
    by default.
  \item[\raw{READONLY}] Disallows overwriting the default command line sector
    of the map file. This way, command lines set with \raw{-R} stay in effect
    until they are explicitly removed. \raw{READONLY} also disables
    \craw{lock}, \craw{fallback}, and everything enabled by
    \raw{REWRITE\_TABLE}. This option is disabled by default.
  \item[\raw{REWRITE\_TABLE}] Enables rewriting the partition table at boot
    time. This may be necessary to boot certain operating systems who
    expect the active flag to be set on their partition or who need changes
    in partition types. See also section
    \ref{ptman}. This option is \emphasize{dangerous} and it is disabled by
    default.
  \item[\raw{USE\_TMPDIR}] Use the directory indicated in the \raw{TMPDIR}
    environment variable when creating temporary device files. If \raw{TMPDIR}
    is not set or if \LILO\ is compiled without \raw{USE\_TMPDIR}, temporary
    device files are created in \path{/tmp}.\footnote{Note that, while honoring
    \raw{TMPDIR} is the ``right'' thing to do, the fact that \LILO\ has to
    create temporary device files at all may indicate that the operating
    environment is not completely set up, so \raw{TMPDIR} may point to an
    invalid location.} This option is disabled by default.
  \item[\raw{VARSETUP}] Enables the use of variable-size setup segments.
    This option is enabled by default and is only provided to fall back to
    fixed-size setup segments in the unlikely case of problems when using
    prehistoric kernels.
  \item[\raw{XL\_SECS=\meta{sectors}}] Enable support for extra large
    (non-standard) floppy disks. The number of sectors is set in the BIOS
    disk parameter table to the specified value. Note that this hack may
    yield incorrect behaviour on some systems. This option is disabled by
    default.
\end{description}

\path{/etc/lilo.defines} should be used if one wishes to make
permanent configuration changes. The usual installation procedures don't
touch that file. Example:

\begin{verbatim}
-DIGNORECASE -DONE_SHOT
\end{verbatim}

After changing the build-time configuration, \LILO\ has to be recompiled
with the following commands:

\begin{verbatim}
make spotless
make
\end{verbatim}


\subsubsection{Floppy disk installation}

In some cases\footnote{E.g. if no hard disk is accessible through the BIOS.},
it may be desirable to install \LILO\ on a floppy disk in a way that it can
boot a kernel without accessing the hard disk.

The basic procedure is quite straightforward (see also section \ref{broken}):
\begin{itemize}
  \item a file system has to be created on the file system
  \item the kernel and \path{boot.b} have to be copied to the floppy disk
  \item \path{/sbin/lilo} has to be run to create the map file
\end{itemize}

This can be as easy as
\begin{verbatim}
/sbin/mke2fs /dev/fd0
[ -d /fd ] || mkdir /fd
mount /dev/fd0 /fd
cp /boot/boot.b /fd
cp /zImage /fd
echo image=/fd/zImage label=linux |
  /sbin/lilo -C - -b /dev/fd0 -i /fd/boot.b -c -m /fd/map
umount /fd
\end{verbatim}

The command line of \path{/sbin/lilo} is a little tricky. \raw{-C -} takes
the configuration from standard input (naturally, one could also write the
configuration into a file), \raw{-b /dev/fd0} specifies that the boot sector
is written to the floppy disk, \raw{-i /fd/boot.b} takes the first and second
stage loaders from the floppy, \raw{-c} speeds up the load process, and
\raw{-m /fd/map} puts the map file on the floppy too.


\subsection{Updates}

\LILO\ is affected by updates of kernels, the whole system and (trivially)
of \LILO\ itself. Typically, only \path{/sbin/lilo} has to be run after
any of those updates and everything will be well again (at least as far
as \LILO\ is concerned).


\subsubsection{\LILO\ update}
\label{liloupd}

Before updating to a new version of \LILO, you should read at least the 
file \path{INCOMPAT} which describes incompatibilities with previous
releases.

After that, the initial steps are the same as
for a first time installation: extract all files, configure the \path{Makefile},
run \raw{make} to build
the executables and run \raw{make install} to install the files.

The old versions of \path{boot.b}, \path{chain.b}, etc. are automatically
renamed to \path{boot.old}, \path{chain.old}, etc. This is done to ensure
that you can boot even if the installation procedure does not finish.
\path{boot.old}, \path{chain.old}, etc. can be deleted after the map file
is rebuilt.

Because the locations of \path{boot.b}, \path{chain.b}, etc. have changed
and because the map file format may be different too, you have to update
the boot sector and the map file. Run \path{/sbin/lilo} to do this.


\subsubsection{Kernel update}
\label{kernupd}

Whenever any of the kernel files that are accessed by \LILO\ is moved or
overwritten, the map has to be re-built.\footnote{It is advisable to
keep a second, stable, kernel image that can be booted if you forget
to update the map after a change to your usual kernel image.} Run
\path{/sbin/lilo} to do this.

The kernel has a make target ``zlilo'' that copies the kernel
to \path{/vmlinuz} and runs \path{/sbin/lilo}.


\subsubsection{System upgrade}

Normally, system upgrades (i.e. installation or removal of packages, possibly
replacement of a large part of the installed binaries) do not affect \LILO.
Of course, if a new kernel is installed in the process, the normal kernel
update procedure has to be followed (see section \ref{kernupd}). Also, if
kernels are removed or added, it may be necessary to update the configuration
file.

If \LILO\ is updated by this system upgrade, \path{/sbin/lilo} should be
run before booting the upgraded system. It is generally a good idea not to
rely on the upgrade procedure to perform this essential step automatically.

However, system upgrades which involve removal and re-creation of entire
partitions (e.g. \path{/}, \path{/usr}, etc.) are different. First, they
should be avoided, because they bear a high risk of losing other critical
files, e.g. the \path{/etc/XF86Config} you've spent the last week fiddling
with. If an upgrade really has to be performed in such a brute-force way,
this is equal with total removal of \LILO, followed by a new installation.
Therefore, the procedures described in the sections \ref{deinst} and
\ref{liloupd} have to be performed. If you've forgotten to make a backup
copy of \path{/etc/lilo.conf} before the destructive upgrade, you might
also have to go through section \ref{install} again.


\subsection{\LILO\ de-installation}
\label{deinst}

In order to stop \LILO\ from being invoked when the system boots, its
boot sector has to be either removed or disabled. All other files belonging
to \LILO\ can be deleted \emphasize{after} removing the boot sector,
if desired.%
\footnote{Backup copies of old boot sectors may be needed when removing
the boot sector. They are stored in \path{/boot}.}

Again, \emphasize{when removing Linux, \LILO\ must be de-installed before (!)
its files (\path{/boot}, etc.) are deleted.} This is
especially important if \LILO\ is operating as the MBR.

LILO 14 (and newer) can be de-installed with \verb"lilo -u". If LILO 14
or newer is currently installed, but the first version of LILO installed was
older than 14, \verb"lilo -U" may work. When using \verb"-U", the warning
at the end of this section applies.

If \LILO's boot sector has been installed on a primary partition and is
booted by the ``standard'' MBR or some partition switcher program, it can be
disabled by making a different partition active. MS-DOS' FDISK, Linux
\name{fdisk} or \LILO's \name{activate} can do that.

If \LILO's boot sector is the master boot record (MBR) of a disk, it has
to be replaced with a different MBR, typically MS-DOS' ``standard'' MBR.
When using MS-DOS 5.0 or above, the MS-DOS MBR can be restored with
\verb"FDISK /MBR". This only alters the boot loader code, not the
partition table.

\LILO\ automatically makes backup copies when it overwrites boot sectors.
They are named \path{/boot/boot.\meta{nnnn}}, with \meta{nnnn}
corresponding to the device number, e.g. \raw{0300} is \path{/dev/hda},
\raw{0800} is \path{/dev/sda}, etc. Those backups can be used to restore
the old MBR if no easier method is available. The commands are \\
\raw{dd if=/boot/boot.0300 of=/dev/hda bs=446 count=1} or \\
\raw{dd if=/boot/boot.0800 of=/dev/sda bs=446 count=1} \\
respectively.

\emphasize{WARNING:} Some Linux distributions install \path{boot.\meta{nnnn}}
files
from the system where the distribution was created. Using
those files may yield unpredictable results. Therefore, the file creation
date should be carefully checked.


\subsection{Installation of other operating systems}
\label{instoth}

Some other operating systems (e.g. MS-DOS 6.0) appear to modify the MBR in
their install procedures. It is therefore possible that \LILO\ will stop
to work after such an installation and Linux has to be booted from floppy
disk. The original state can be restored by either re-running
\path{/sbin/lilo } (if \LILO\ is installed as the MBR) or by making
\LILO's partition active (if it's installed on a primary partition).

It is generally a good idea to install \LILO\ after the other operating
systems have been installed. E.g. OS/2 is said to cause trouble when
attempting to add it to an existing Linux system. (However, booting
from floppy and running \path{/sbin/lilo} should get around most
interferences.)

Typically, the new operating system then has to be added to \LILO's
configuration (and \path{/sbin/lilo} has to be re-run) in order to boot
it.

See also section \ref{othpro} for a list of known problems with some
other operating systems.


\newpage
\section{Troubleshooting}

All parts of \LILO\ display some messages that can be used to diagnose
problems. 


\subsection{Map installer warnings and errors}

Most messages of the map installer (\path{/sbin/lilo}) should be
self-explanatory. Some messages that indicate common errors are
listed below. They are grouped
into fatal errors and warnings (non-fatal errors).


\subsubsection{Fatal errors}

\begin{description}
  \item[\raw{Boot sector of \meta{device\_name} doesn't have a boot %
    signature}]
  \item[\raw{Boot sector of \meta{device\_name} doesn't have a LILO %
    signature}]~\\
    The sector from which \LILO\ should be uninstalled doesn't appear to be a
    \LILO\ boot sector.
  \item[\raw{Can't put the boot sector on logical partition \meta{number}}]~\\
    An attempt has been made to put \LILO's boot sector on the current
    root file system partition which is on a logical partition. This usually
    doesn't have the desired effect, because common MBRs can only boot
    primary partitions. This check can be bypassed by explicitly
    specifying the boot partition with the \raw{-b} option or by setting
    the configuration variable \craw{boot}.
  \item[\raw{Checksum error}]~\\
    The descriptor table of the map file has an invalid checksum. Refresh
    the map file \emphasize{immediately} !
  \item[\raw{Device 0x\meta{number}: Configured as inaccessible.}]~\\
     There is a \craw{disk} section entry indicating that the device is
     inaccessible
     from the BIOS. You should check carefully that all files \LILO\ tries to
     access when booting are on the right device.
  \item[\raw{Device 0x\meta{number}: Got bad geometry \meta{sec}/\meta{hd}/%
\meta{cyl}}]~\\
    The device driver for your SCSI controller does not support geometry
    detection. You have to specify the geometry explicitly (see section
    \ref{diskgeo}).
  \item[\raw{Device 0x\meta{number}: Invalid partition table, entry %
    \meta{number}}]~\\
    The 3D and linear addresses of the first sector of the specified partition
    don't correspond. This is typically caused by partitioning a disk with
    a program that doesn't align partitions to tracks and later using
    PC/MS-DOS or OS/2 on that disk. \LILO\ can attempt to correct the problem,
    see page \pageref{fix-table}.
  \item[\raw{Device 0x\meta{number}: Partition type 0x\meta{number} does not
    seem suitable for a LILO boot sector}]~\\
    The location where the \LILO\ boot sector should be placed does not seem
    to be suitable for that. (See also also section \ref{diskorg}). You should
    either adjust the partition type to reflect the actual use or put the
    boot sector on a different partition. This consistency check only yields
    a warning (i.e. \LILO\ continues) if the option \craw{ignore-table} is
    set.
  \item[\raw{\meta{device\_name} is not a valid partition device}]~\\
    The specified device is either not a device at all, a whole disk, or
    a partition on a different disk than the one in whose section its
    entry appears.
  \item[\raw{\meta{device\_name} is not a whole disk device}]~\\
    Only the geometry of whole disks (e.g. \path{/dev/hda}, \path{/dev/sdb},
    etc.) can be redefined when using \craw{disk} sections.
  \item[\raw{DISKTAB and DISK are mutually exclusive}]~\\
    You cannot use a \path{disktab} file and disk geometry definitions in the
    configuration file at the same time. Maybe \path{/etc/disktab} was
    accidentally used, because that's the default for backward-compatibility.
    You should delete \path{/etc/disktab} after completing the transition to
    \craw{disk} sections.
  \item[\raw{Duplicate entry in partition table}]~\\
    A partition table entry appears twice. The partition table has to be
    fixed with \name{fdisk}.
  \item[\raw{Duplicate geometry definition for \meta{device\_name}}]~\\
    A disk or partition geometry definition entry for the same device appears
    twice in the configuration file. Note that you mustn't write a partition
    section for the whole disk --- its start sector is always the first
    sector of the disk.
  \item[\raw{First sector of \meta{device} doesn't have a valid boot %
    signature}]~\\
    The first sector of the specified device does not appear to be a valid
    boot sector. You might have confused the device name.\footnote{Because
    different partition programs may display the partitions in a different
    order, it is possible that what you think is your first partition isn't
    \path{/dev/hda1}, etc. A good method to verify the content of a partition
    is to try to mount it.}
  \item[\raw{geo\_comp\_addr: Cylinder \meta{number} beyond end of media %
    (\meta{number})}]~\\
    A file block appears to be located beyond the last cylinder of the disk.
    This probably indicates an error in the disk geometry specification (see
    section \ref{diskgeo}) or a file system corruption.
  \item[\raw{geo\_comp\_addr: Cylinder number is too big (\meta{number} $>$
   1023)}]~\\
    Blocks of a file are located beyond the 1024th cylinder of a hard disk.
    \LILO\ can't access such files, because the BIOS limits cylinder numbers to
    the range 0$\ldots$1023. Try moving the file to a different place,
    preferably a
    partition that is entirely within the first 1024 cylinders of the disk.
  \item[\raw{Hole found in map file (\meta{location})}]~\\
    The map installer is
    confused about the disk organization. Please report this error.
  \item[\raw{\meta{item} doesn't have a valid LILO signature}]~\\
    The specified item has been located, but is not part of \LILO.
  \item[\raw{\meta{item} has an invalid stage code (\meta{number})}]~\\
    The specified item has probably been corrupted. Try re-building
    \LILO.
  \item[\raw{\meta{item} is version \meta{number}. Expecting version%
      \meta{number}.}]~\\
    The specified entity is either too old or too new. Make sure all parts
    of \LILO\ (map installer, boot loaders and chain loaders) are from the
    same distribution. \footnote{The expected version number may be different
    from the version number of the \LILO\ package, because file version
    numbers are only increased when the file formats change.}
  \item[\raw{Kernel \meta{name} is too big}]~\\
    The kernel image (without the setup
    code) is bigger than 512 kbytes (or 448 kbytes, if built with
    \raw{LARGE\_EDBA}). \LILO\ would overwrite itself when trying
    to load such a kernel. This limitation only applies to old kernels which
    are loaded below 0x10000 (e.g. ``Image'' or ``zImage''). Try building the
    kernel with ``bzImage''. If this is undesirable for some reason, try
    removing some unused drivers and compiling the kernel again.
    This error may also occur if the kernel image is damaged or if it
    contains trailing ``junk'', e.g. as the result of copying an entire boot
    floppy to the hard disk.
  \item[\raw{LOCK and FALLBACK are mutually exclusive}]~\\
    Since \craw{lock} and \craw{fallback} both change the default command line,
    they can't be reasonably used together.
  \item[\raw{Map \meta{path} is not a regular file.}]~\\
    This is probably the result of an attempt to omit writing a map file, e.g.
    with \raw{-m /dev/null}. The \raw{-t} option should be used to accomplish
    this.
  \item[\raw{Must specify SECTORS and HEADS together}]~\\
    It is assumed that disks with a ``strange'' number of sectors will also
    have a ``strange'' number of heads. Therefore, it's all or nothing.
  \item[\raw{No geometry variables allowed if INACCESSIBLE}]~\\
    If a device is configured as \craw{inaccessible} (see section
    \ref{diskspec}),
    its \craw{disk} section must not contain any geometry variables.
  \item[\raw{No image \meta{image} is defined}]~\\
    The command line specified either with the \raw{-R} option or with
    \craw{fallback} does not contain the name of a valid image. Note that
    optional images which have not been included in the map file are not
    considered as valid.
  \item[\raw{Partition entry not found}]~\\
    The partition from which an other
    operating system should be booted isn't listed in the specified
    partition table. This either means that an incorrect partition
    table has been specified or that you're trying to boot from a
    logical partition. The latter usually doesn't work. You can bypass
    this check by omitting the partition table specification (e.g.
    omitting the variable \craw{table}).
  \item[\raw{Single-key clash: "\meta{name}" vs. "\meta{name}"}]~\\
    The specified image labels or aliases conflict because one
    of them is a single character and has the \craw{single-key} option set,
    and the other name begins with that character.
  \item[\raw{Sorry, don't know how to handle device \meta{number}}]~\\
    \LILO\ uses files that are located on a device for which
    there is no easy way to determine the disk geometry. Such devices have
    to be explicitly described, see section \ref{diskgeo}.
  \item[\raw{This LILO is compiled READONLY and doesn't support $\ldots$}]~\\
    If \LILO\ is not allowed to write to the disk at boot time (see section
    \ref{cfgmf}), options like \craw{lock} and \craw{fallback} are unavailable.
  \item[\raw{This LILO is compiled without REWRITE\_TABLE and doesn't support
    $\ldots$}]~\\
    If \LILO\ is not allowed to rewrite partition tables at boot time (see
    section \ref{ptman}), options like \craw{activate} and \craw{set} (in a
    \craw{change} section) are unavailable. You may also get this error if
    \LILO\ is compiled with \raw{READONLY} enabled.
  \item[\raw{Timestamp in boot sector of \meta{device} differs from date of %
    \meta{file}}]~\\
    The backup copy of the boot sector does not appear to be an ancestor of
    the current boot sector. If you are absolutely sure that the boot sector
    is indeed correct, you can bypass this check by using \raw{-U} instead
    of \raw{-u}.
  \item[\raw{Trying to map files from unnamed device 0x\meta{number}
    (NFS ?)}]~\\
    This is probably the same problem as described below, only with the
    root file system residing on NFS.
  \item[\raw{Trying to map files from your RAM disk.
    Please check -r option or ROOT environment variable.}]~\\
    Most likely, you or some installation script is trying to invoke
    \LILO\ in a way that some of the files is has to access reside on the
    RAM disk. Normally, the \raw{ROOT} environment variable should be set
    to the mount point of the effective root device if installing
    \LILO\ with a different root directory. See also sections \ref{creupd}
    and \ref{install}.
  \item[\raw{VGA mode presetting is not supported by your kernel.}]~\\
    Your kernel sources appear to be very old ('93 ?). \LILO\ may work on
    your system if you remove the \craw{vga} option.
  \item[\raw{write \meta{item}: \meta{error\_reason}}]~\\
    The disk is probably full or mounted read-only.
\end{description}


\subsubsection{Warnings}
\label{warnings}

Messages labeled with ``Warning'' can be turned off with the \craw{nowarn}
option.

\begin{description}
  \item[\raw{FIGETBSZ \meta{file\_name}: \meta{ error\_reason}}]~\\
    The map installer is unable to determine the block size of a file system.
    It assumes a block size of two sectors (1kB).
  \item[\raw{Ignoring entry '\meta{variable\_name}'}]~\\
    The command-line option corresponding to the specified variable is set.
    Therefore, the configuration file entry is ignored.
  \item[\raw{Setting DELAY to 20 (2 seconds)}]~\\
    Because accidentally booting the wrong kernel or operating system may
    be very inconvenient on systems that are not run from a local display,
    the minimum delay is two seconds if the \craw{serial} variable is set.
  \item[\raw{(temp) \meta{item}: \meta{error\_reason}}]~\\
    Deleting a temporary file has failed for the specified reason.
  \item[\raw{Warning: BIOS drive 0x\meta{number} may not be accessible}]~\\
    Because most BIOS versions only support two floppies and two hard disks,
    files located on additional disks may be inaccessible. This warning
    indicates that some kernels or even the whole system may be unbootable.
  \item[\raw{Warning: COMPACT may conflict with LINEAR on some systems}]~\\
    Please see section \ref{othpro} for a description of this problem.
  \item[\raw{Warning: \meta{config\_file} should be owned by root}]~\\
    In order to prevent users from compromising system integrity, the
    configuration file should be owned by root and write access for all other
    users should be disabled.
  \item[\raw{Warning: \meta{config\_file} should be readable only for root if
    using PASSWORD}]~\\
    Users should not be allowed to read the configuration file when using the
    \craw{password} option, because then, it contains unencrypted passwords.
  \item[\raw{Warning: \meta{config\_file} should be writable only for root}]~\\
    See ``\raw{Warning: \meta{config\_file} should be owned by root}''.
  \item[\raw{Warning: device 0x\meta{number} exceeds 1024 cylinder limit}]~\\
    A disk or partition exceeds the 1024 cylinder limit imposed by the BIOS.
    This may result in a fatal error in the current installation run or in
    later installation runs. See ``\raw{geo\_comp\_addr:
    Cylinder number is too big (\meta{number} $>$ 1023)}'' for details.
  \item[\raw{Warning: \meta{device} is not on the first disk}]~\\
    The specified partition is probably not on the first disk. \LILO's boot
    sector can only be booted from the first disk unless some special boot
    manager is used.
  \item[\raw{WARNING: The system is unbootable !}]~\\
    One of the last installation steps has failed. This warning is typically
    followed by a fatal error describing the problem.
\end{description}


\subsection{Boot loader messages}

The boot loader generates three types of messages: progress and error messages
while it is loading, messages indicating disk access errors, and error
messages in response to invalid command-line input. Since messages of the
latter type are usually self-explanatory, only the two other categories
are explained.


\subsubsection{\LILO\ start message}

When \LILO\ loads itself, it displays the word ``LILO''. Each letter is
printed before or after performing some specific action. If \LILO\ fails
at some point, the letters printed so far can be used to identify the
problem. This is described in more detail in the technical overview.

Note that some hex digits may be inserted after the first ``L'' if a
transient disk problem occurs. Unless LILO stops at that point, generating
an endless stream of error codes, such hex digits do not indicate a
severe problem.

\begin{description}
  \item[\rm (\meta{nothing})] No part of \LILO\ has been loaded.
    \LILO\ either isn't installed or the partition on which its boot
    sector is located isn't active.
  \item[\raw{L \meta{error} $\ldots$}] The first stage boot loader has been
    loaded and started, but it can't load the second stage boot loader.
    The two-digit error codes indicate the type of problem. (See also section
    \ref{bioserr}.) This condition usually indicates a media failure or a
    geometry mismatch (e.g. bad disk parameters, see section \ref{diskgeo}).
  \item[\raw{LI}] The first stage boot loader was able to load the second
    stage boot loader, but has failed to execute it. This can either be
    caused by a geometry mismatch or by moving \path{/boot/boot.b} without
    running the map installer.
  \item[\raw{LIL}] The second stage boot loader has been started, but it
    can't load the descriptor table from the map file. This is typically
    caused by a media failure or by a geometry mismatch.
  \item[\raw{LIL?}] The second stage boot loader has been loaded at an
    incorrect address. This is typically caused by a subtle geometry
    mismatch or by moving \path{/boot/boot.b} without running the map
    installer.
  \item[\raw{LIL-}] The descriptor table is corrupt. This can either be caused
    by a geometry mismatch or by moving \path{/boot/map} without running
    the map installer.
  \item[\raw{LILO}] All parts of \LILO\ have been successfully loaded.
\end{description}


\subsubsection{Disk error codes}
\label{bioserr}

If the BIOS signals an error when \LILO\ is trying to load a boot
image, the respective error code is displayed. The following BIOS
error codes are known:

\begin{description}
  \item[\raw{0x00}] ``Internal error''. This code is generated by
    the sector read routine of the \LILO\ boot loader whenever an
    internal inconsistency is detected. This might be caused by corrupt
    files. Try re-building the map file. Another possible cause for this
    error are attempts to access cylinders beyond 1024 while using the
    \craw{linear} option. See section \ref{broken} for more details and
    for how to solve the problem.
  \item[\raw{0x01}] ``Illegal command''. This shouldn't happen, but if it
    does, it may indicate an attempt to access a disk which is not supported
    by the BIOS. See also ``Warning: BIOS drive 0x\meta{number} may not be
    accessible'' in section \ref{warnings}.
  \item[\raw{0x02}] ``Address mark not found''. This usually indicates
    a media problem. Try again several times.
  \item[\raw{0x03}] ``Write-protected disk''. This should only occur on
    write operations.
  \item[\raw{0x04}] ``Sector not found''. This typically indicates a
    geometry mismatch. If you're booting a raw-written disk image, verify
    whether it was created for disks with the same geometry as the one
    you're using. If you're booting from a SCSI disk or a large IDE disk,
    you should check,
    whether \LILO\ has obtained correct geometry data from the kernel or
    whether the geometry definition corresponds
    to the real disk geometry. (See section \ref{diskgeo}.) Removing
    \craw{compact} may help too. So may adding \craw{linear}.
  \item[\raw{0x06}] ``Change line active''. This should be a transient
    error. Try booting a second time.
  \item[\raw{0x07}] ``Invalid initialization''. The BIOS failed to properly
    initialize the disk controller. You should control the BIOS setup
    parameters. A warm boot might help too.
  \item[\raw{0x08}] ``DMA overrun''. This shouldn't happen. Try booting
    again.
  \item[\raw{0x09}] ``DMA attempt across 64k boundary''. This shouldn't
    happen. Try omitting the \craw{compact} option.
  \item[\raw{0x0C}] ``Invalid media''. This shouldn't happen and might
    be caused by a media error. Try booting again.
  \item[\raw{0x10}] ``CRC error''. A media error has been detected. Try
    booting several times,
    running the map installer a second time (to put the map file at some
    other physical location or to write ``good data'' over
    the bad spot), mapping out the bad sectors/tracks and, if all else
    fails, replacing the media.
  \item[\raw{0x11}] ``ECC correction successful''. A read error occurred,
    but was corrected. \LILO\ does not recognize this condition and
    aborts the load process anyway. A second load attempt should
    succeed.
  \item[\raw{0x20}] ``Controller error''. This shouldn't happen.
  \item[\raw{0x40}] ``Seek failure''. This might be a media problem. Try
    booting again.
  \item[\raw{0x80}] ``Disk timeout''. The disk or the drive isn't ready.
    Either the media is bad or the disk isn't spinning. If you're booting
    from a floppy, you might not have closed the drive door. Otherwise,
    trying to boot again might help.
  \item[\raw{0xBB}] ``BIOS error''. This shouldn't happen. Try booting
    again. If the problem persists, removing the \craw{compact} option or
    adding/removing \craw{linear} might help.
\end{description}

If the error occurred during a write operation, the error code (two hex
digits) is prefixed with a ``W''. Although write errors don't affect the
boot process, they might indicate a severe problem, because they usually
imply that \LILO\ has tried to write to an invalid location.
If spurious write errors occur on a system, it might be a good idea
to configure \LILO\ to run read-only (see section \ref{cfgmf}).

Generally, invalid geometry and attempts to use more than two disks without a
very modern BIOS may yield misleading error codes. Please check carefully
if \path{/sbin/lilo} doesn't emit any warnings. Then try using the
\craw{linear} option (see section \ref{cfgglo}).


\subsection{Other problems}
\label{othpro}

This section contains a collection of less common problems that have been
observed. See also section \ref{instoth} for general remarks on using
\LILO\ with other operating systems. Some of the problems are obscure and
so are the work-arounds.

\begin{itemize}
  \item If \LILO\ doesn't go away even if you erase its files, format your
    Linux partition, etc., you've probably installed \LILO\ as your MBR and
    you've forgotten to deinstall it before deleting its files. See section
    \ref{deinst} for what you can do now.
  \item For yet unknown reasons, \LILO\ may fail on some systems with
    AMI BIOS if the ``Hard Disk Type 47 RAM area'' is set to ``0:300''
    instead of ``DOS 1K''.
  \item Some disk controller BIOSes perform disk geometry/address translations
    that
    are incompatible with the way the device's geometry is seen from Linux,
    i.e. without going through the BIOS. Particularly, large IDE disks and
    some PCI SCSI
    controllers appear to have this problem. In such cases, either the
    translated geometry has to be specified in a \craw{disk} section or the
    sector address translation can be deferred by using the \craw{linear}
    option. In a setup where floppies are not normally used for booting,
    the \craw{linear} approach should be preferred, because this avoids
    the risk of specifying incorrect numbers.
  \item OS/2 is said to be bootable from a logical partition with
    \LILO\ acting as the primary boot selector if \LILO\ is installed on
    the MBR, the OS/2 BootManager is on an active primary partition and
    \LILO\ boots BootManager. Putting \LILO\ on an extended partition
    instead is said to crash the OS/2 FDISK in this scenario.

    Note that booting \LILO\ from BootManager (so BootManager is the
    primary selector) or booting OS/2 directly from a primary partition
    (without BootManager) should generally work. See also section
    \ref{instoth}.
  \item Windows NT is reported to be bootable with \LILO\ when \LILO\ acts as
    the MBR and the Windows NT boot loader is on the DOS partition. However,
    NT's disk manager complains about LILO's MBR when trying to edit the
    partition table.
  \item Some PC UNIX systems (SCO and Unixware have been reported to exhibit
    this problem) depend on their partition being active. See section
    \ref{ptman} for how this can be accomplished.
  \item Future Domain TMC-1680 adapters with the BIOS versions 3.4 and 3.5
    assign BIOS device numbers in the wrong order, e.g. on a two-disk system,
    \path{/dev/sda} becomes \raw{0x81} and \path{/dev/sdb} becomes
    \raw{0x80}. This can be fixed with the following \craw{disk} section:\\
    \verb"disk=/dev/sda bios=0x81 disk=/dev/sdb bios=0x80"\\
    Note that this is only valid for a two-disk system. In three-disk
    systems, \path{/dev/sdc} would become \raw{0x80}, etc. Also, single-disk
    systems don't have this problem (and the ``fix'' would break them).
  \item Some BIOSes don't properly recognize disks with an unusual partition
    table (e.g. without any partition marked active) and refuse to boot from
    them. This can also affect the second hard disk and the problem may
    only occur if the system is booted in a particular way (e.g. only after a
    cold boot).
  \item On some systems, using \craw{linear} and \craw{compact} together
    leads to a boot failure. The exact circumstances under which this
    happens are still unknown.
  \item If the kernel crashes after booting on a multi-processor system,
    \LILO\ may have overwritten data structures set up by the BIOS. Try
    the option \raw{LARGE\_EBDA} in this case.
\end{itemize}

%%beginskip
\end{document}
%%endskip