Lilo mini-Howto <author>Cameron Spitzer (<tt/cls@truffula.sj.ca.us/), Alessandro Rubini (<tt/rubini@linux.it/). <date>v2.02, 16 August 1998 <trans>中谷千絵 (<tt/jeanne@mbox.kyoto-inet.or.jp/), 早川仁 (<tt/cz8cb01@linux.or.jp/). <tdate>v2.02j, 1999年 9月12日 <abstract> <!-- LILO is the most used <bf/Li/nux <bf/Lo/ader for the x86 flavour of Linux; I'll call it Lilo rather than LILO here because I don't appreciate uppercase. This file describes some typical Lilo installations. It's intended as a supplement to the Lilo User's Guide. I think examples are informative even if your setup isn't much like mine. I hope this saves you trouble. Since Lilo's own documentation is very good, who's interested in the details is referred to /usr/doc/lilo* --> LILO とは、x86 アーキテクチャの Linux で最も良く使われている <bf/Li/nux <bf/Lo/ader の事です。私(原文の著者)は大文字表記があまり好みではないため、 ここでは LILO ではなく Lilo と呼ぶことにします。このドキュメントでは いくつかの典型的な Lilo インストレーションについて説明しており、Lilo ユーザーズガイドの補足となることを意図しています。読者の(設定)が多少 違うものだとしても、サンプルは参考になると思いますし、またよけいな手間を 省ける事でしょう。Lilo 自体のドキュメントは非常に良いものですから、 詳細を知りたい方は /usr/doc/lilo* を参照してください。 </abstract> <!-- Table of contents --> <toc> <!-- Begin the document --> <sect>イントロダクション <!-- Introduction --> <p> <!-- Although the documentation found in Lilo's sources (the one installed in <tt>/usr/doc/lilo</tt>-version) is very comprehensive, most Linux users experience some trouble in building their own <tt>/etc/lilo.conf</tt> file. This document is meant to support them by giving the minimal information and by showing five sample installations: --> Lilo ソース内のドキュメント(<tt>/usr/doc/lilo</tt>-バージョン)は非常に 詳しいものですが、多くの Linux ユーザーは自分自身の <tt>/etc/lilo.conf</tt> ファイルを作成する際にいくつかのトラブルを経験し ています。このドキュメントは、Lilo をうまく使いこなすためのコツを短時間 で得られるようにサンプルとして 5 種類のパターンを示し、それぞれについて 必要最小限の解説を加えるという方針で書かれています。 <itemize> <!-- <item>The first example is the classical ``Linux and other'' installation. --> <item>最初の例は、古典的な ``Linux と他の OS'' のインストールです。 <!-- <item>The next one shows how to install Lilo on a hard drive connected as <tt>/dev/hdc</tt> that will boot as <tt>/dev/hda</tt>. This is usually needed when you install a new Linux drive from your own running system. This also tells how to boot from SCSI disks when your BIOS is modern enough. --> <item>次の例は、どのようにして Lilo を <tt>/dev/hdc</tt>として接続されて いるハードディスクにインストールし、<tt>/dev/hda</tt> としてブートさせる かについてです。これは普通、現在稼働中のシステムに新しく Linux 用のドラ イブを追加する時に必要となります。また(使用している BIOS が新しい物であ る場合)どうやってSCSI ドライブからブートするかについても説明しています。 <!-- <item>The third example shows how to boot a Linux system whose root partition can't be accessed by the BIOS. --> <item>3 番目の例では、BIOS からアクセスできないルートパーティションから Linux システムを起動する方法について説明しています。 <!-- <item>The next sample file is used to access huge disks, that neither the BIOS nor DOS can access easily (this one is somehow outdated). --> <item>その次の例は、BIOS や DOS から簡単にアクセスできない 大容量ディスクへのアクセスについてです(この例は多少内容が古いです)。 <!-- <item>The last example shows how to restore a damaged disk, if the damage resulted from installing another operating system). --> <item>最後の例では、他の OS をインストールすることによって損傷を受けたディ スクの復旧方法について説明しています(訳注:つまり Windows95などの OS を インストールすることによって HDD 先頭の MBR やパーティション先頭のブート セクタを壊してしまった場合です)。 </itemize> <p> <!-- The last three examples are by Cameron, <tt/cls@truffula.sj.ca.us/, who wrote the original document. Alessandro (tt/rubini@linux.it/, the current maintainer doesn't run anything but Linux, so he can't check nor update them by himself. Needless to say, any feedback is welcome. --> 最後の 3 つの例はこのドキュメントのオリジナルの著者である Cameron(<tt/cls@truffula.sj.ca.us/) により書かれたものです。 ドキュメントの現在のメンテナンス者である Alessandro(<tt/rubini@linux.it/) は Linux 以外の OS を使用していないため、それらの例の内容のチェックや更新を する事ができません。言うまでもありませんが、 どのようなフィードバックも歓迎します。 <sect>予備知識と一般的なインストール方法 <!-- Background Information and Standard Installation --> <p> <!-- When Lilo boots the system, it uses BIOS calls to load the Linux kernel off the disk (IDE drive, floppy or whatever). Therefore, the kernel must live in some place that can be accessed by the bios. --> Lilo がシステムを起動する場合 BIOS コールを使用してディスク(IDEドライブ、 フロッピー、その他)から Linux カーネルを読み込みます。つまりカーネルは BIOS からアクセスできる場所に存在している必要があります。 <p> <!-- At boot time, Lilo is not able to read filesystem data, and any pathname you put in <tt>/etc/lilo.conf</tt> is resolved at installation time (when you invoke <em>/sbin/lilo</em>). Installation time is when the program builds the tables that list which sectors are used by the files used to load the operating system. As a consequence, all of these files must live in a partition that can be accessed by the BIOS (the files are usually located in the <tt>/boot</tt> directory, this means that only the root partition of your Linux system needs to be accessed via the BIOS). --> Lilo はブート時にファイルシステム上のデータを読み込むことはできませんか ら、<tt>/etc/lilo.conf</tt> に記述したパス名はインストール時 (<em>/sbin/lilo</em> を実行する時)に解読され、各ファイルがディスク上の どのセクタを占めているのかという情報に変換されます。「インストール時」に は、カーネルを読み込む際に必要となるファイルがディスク上でそれぞれどのセ クタに存在しているのかを示すテーブルがプログラム (訳注: <em>/sbin/lilo</em>) によって構築されます。ですから、これらのファイルす べてが BIOSからアクセスできるパーティションに存在している必要があります (ファイルは通常 <tt>/boot</tt> ディレクトリに置かれます。つまり BIOS か らアクセスできる必要があるのは、Linuxシステムのルートパーティションだけ です)。 <p> <!-- Another consequence of being BIOS-based is that you must reinstall the loader (i.e., you must reinvoke <em>/sbin/lilo</em>) any time you modify the Lilo setup. Whenever you recompile your kernel and overwrite your old image you must reinstall Lilo. --> BIOS に関するもう一つの注意点としては Lilo の設定を変更する度に(訳注: <tt>/etc/lilo.conf</tt> を変更した時)、<em>/sbin/lilo</em> を実行して再 インストールする必要があります。またカーネルを再コンパイルして古いカーネ ルイメージを上書きした場合は常にLilo を再インストールしなければなりませ ん。 (訳注:再インストールしなかった場合、マシンを再起動すると Linuxが起動せ ずにフリーズするかもしれません。Lilo が OS 起動時に使用する情報は <em>/sbin/lilo</em>コマンド実行時に設定されますが、カーネルを上書きした 場合にはこの情報が違う物になってしまうからです) <sect1>Lilo はどこにインストールするべきでしょうか? <!-- Where Should I Install Lilo? --> <p> <!-- The <tt/boot=/ directive in <tt>/etc/lilo.conf</tt> tells Lilo where it should place its primary boot loader. In general, you can either specify the master boot record (<tt>/dev/hda</tt>) or the root partition of your Linux installation (is usually is <tt>/dev/hda1</tt> or <tt>/dev/hda2</tt>). --> <tt>/etc/lilo.conf</tt> の <tt/boot=/ パラメーターは、プライマリーブート ローダーをどこに置くべきかを Liloに指定するものです。通常はマスターブー トレコード(MBR)(<tt>/dev/hda</tt>)か Linux のルートパーティション(通 常は<tt>/dev/hda1</tt> か <tt>/dev/hda2</tt>)のどちらでも指定できます。 (訳注:Linux のルートパーティションを指定する場合は、MBR に Lilo以外の ブートローダー(OS/2、Windows NT、extipl やシステムコマンダーなど)がイ ンストールされている必要があります。つまり、MBRのローダーからルートパー ティションのローダー(Lilo)をブートし、そこから Linux が起動されます) <p> <!-- If you have another operating system installed in your hard drive, you'd better install Lilo to the root partition instead of the MBR. In this case, you must mark the partition as ``bootable'' using the ``a'' command of <em>fdisk</em> or the ``b'' command of <em>cfdisk</em>. If you don't overwrite the master boot sector you'll find it easier to uninstall Linux and Lilo if needed. --> 他の OS がハードディスクにインストールされている場合、MBRではなくルート パーティションに Lilo を入れた方が良いでしょう。その場合そのパーティショ ンに、<em>fdisk</em> の``a''コマンドか<em>cfdisk</em> の``b'' コマンドを 使用して``bootable''(起動可能)マークを付ける必要があります。マスターブー トセクタを上書きしないほうが、もし必要になった場合、より簡単に Linux と Lilo をアンインストールできることでしょう。 <sect1>IDE ハードディスクをどのように設定すべきでしょうか? <!-- How Should I Configure my IDE Hard Drives? --> <p> <!-- I personally don't use LBA or LARGE settings in the BIOS (but I only run Linux); they are horrible kludges forced on by design deficiencies in the PC world. This requires that the kernel lives in the first 1024 cylinders, but this is not a problem as long as you partition your hard drives and keep root small (as you should do anyways). --> 私自身は BIOS の LBA や LARGE の設定はしていません(Linuxしか走らせてい ませんから)。これらは PCの世界での設計の欠陥を取り繕うためのみっともな いその場しのぎです。この理由により、カーネルは 1024 シリンダ以内に存在す る必要がありますが、パーティションを分割してルートパーティションを小さい 物にする限りこれは問題にはなりません(どちらにせよ読者はそうするはずでしょ うが)。 <p> <!-- If your hard disk already carries another operating system, you won't be able to modify the BIOS settings, or the old system won't work any more. All recent Lilo distribution are able to deal with LBA and LARGE disk settings. --> すでにハードディスクに他の OS がインストールされている場合、その OS がもう起動しなくなってしまうかもしれませんから BIOS のセッティングを変えられないでしょう。最近のディストリビューション全ての Lilo は LBA と LARGE のディスク設定を取り扱うことができます。 <p> <!-- Note that the "<tt/linear/" keyword in <tt>/etc/lilo.conf</tt> can help in dealing with geometry problems. The keyword instructs Lilo to use linear sector addresses instead of sector/head/cylinder tuples. Conversion to 3D addresses is delayed to run-time, therefore making the setup more immune to geometry problems. --> <tt>/etc/lilo.conf</tt> の "<tt/linear/" キーワードはジオメトリー問題に 対処するのに役立つと言うことを覚えておいてください。これは Liloにリニア セクタアドレスをセクタ/ヘッド/シリンダ(CHS)指定の代わりに使用する ことを指示します。3Dアドレス(CHS アドレス)への変換処理は実行時に先送 りされますが、その代わりにこの設定によってジオメトリー問題に、より柔軟に 対応することができます。 (訳注:LILO ver 20 および 21 では linear を指定された場合であっても lilo は内部で CHS アドレスを使っています。指定しない場合との違いは単に起 動時にマップファイルに記録された 3D アドレスを BIOS から取得したジオメト リー情報を用いて別な 3D アドレスに変換するかどうか、のはずです。 もし linear オプションを付けることによって /sbin/lilo が /boot/map ファ イルに 32bit な linear address を記録するのなら、/boot/map ファイルのサ イズが linear オプションを付けない場合よりもかなり大きくなるはずですが (カーネルのセクタ位置情報が 24bit から 32bit に増えるため)、(試してみ ればすぐにわかりますが)実際にはすくなくとも lilo ver.21 では /sbin/lilo に -l オプションを付けても付けなくても生成される map ファイル(標準では /boot/map) のサイズは同じです。 このへんは lilo のソースにある first.S や second.S を読めばすぐにわかる と思います。map ファイルを読む処理は linear option の有無によらず、まっ たく同じですから。違いは map ファイルから読んだデータを処理する部分だけ です) <p> <!-- If you have more than one hard disk and some of them are only used by Linux and are not involved in the boot process, you can tell your BIOS that they are not installed. Your system will boot more quickly and Linux will autodetect all the disks in no time. I often switch disks in my computers, but I never touch the BIOS configuration. --> 1 つ以上のハードディスクを持っていて、それらのうちいくつかは Linuxだけで 使用していて、なおかつブートプロセスに関係がない(ブートプロセスで使用し ていない/必要がない)場合 BIOSに、それらのディスクが接続されていないと 設定することができます。これによりシステムはより早く起動します。Linux は 即座にすべてのディスクを自動認識します。私は自分のコンピューターのディス クをよく交換しますが、BIOS の設定には触れません。 <sect1>ブート時に対話的に操作するには? <!-- How Can I Interact at Boot Time? --> <p> <!-- When you see the Lilo prompt, you can hit the <Tab> key to show the list of possible choices. If Lilo is not configured to be interactive, press and hold the <Alt> or <Shift> key before the ``LILO'' message appears. --> Lilo のプロンプトが現れたときに <Tab> キーを押すことによって、 選択可能なリストを表示します。Lilo が対話的(interactive)に操作できるように 設定されていない場合、``LILO'' メッセージが表示されるまで <Alt> か <Shift> を押し続けてください。 <p> <!-- If you choose to boot a Linux kernel, you can add command-line arguments after the name of the system you choose. The kernel accepts many command-line arguments. All the arguments are listed in the ``BootPrompt-HOWTO'' by Paul Gortmaker, and I won't replicate it here. A few command line arguments, however, are particularly important and worth describing here: --> Linux カーネルのブートを選択した場合、コマンドライン引数を選択した システムの名前の後ろに追加することができます。カーネルには多くの コマンドライン引数がありますが、すべての引数は Paul Gortmaker の ``BootPrompt-HOWTO'' (訳注:日本語訳は堀江誠一氏です。 http://www.linux.or.jp/JF から入手できます)に記述されていますから それらをここで記述しようとはしませんが、 いくつかのコマンドライン引数は非常に重要なため、 ここで説明する価値があるでしょう。 <itemize> <!-- <item><tt/root=/: you can tell the Linux kernel to mount as root a different partition than the one appearing in <tt/lilo.conf/. For example, my system has a tiny partition hosting a minimal Linux installation, and I've been able to boot the system after destroying my root partition by mistake. --> <item><tt/root=/ <tt/lilo.conf/ に設定されたものとは別のパーティションを root (パーティション) としてマウントすることをカーネルに指示します。 例えば私のシステムは最小限の物のみをインストールした小さな Linux パーティションがありますから、ミスによってルートパーティションを 消してしまった後でもシステムをブートすることができます。 <!-- <item><tt/init=/: verson 1.3.43 and newer of the Linux kernel can execute another command instead of <tt>/sbin/init</tt>, as specified on the command line. If you experience bad problems during the boot process, you can access the bare system by specifying <tt>init=/bin/sh</tt> (when you are at the shell prompt you most likely will need to mount your disks: try ``<tt>mount -w -n -o remount /; mount -a</tt>'', and remember to ``<tt>umount -a</tt>'' before turning off the computer). --> <item><tt/init=/ バージョン 1.3.43 以降のLinux カーネルは、 <tt>/sbin/init</tt> の代わりにコマンドラインで指定された別のコマンドを実 行できます。ブート中に何か問題の起こった場合、<tt>init=/bin/sh</tt> を指 定することによって裸の (bare) システムにアクセスすることができます。シェ ルプロンプトが表示されたら、まずディスクをマウントする必要があるでしょう。 ``<tt>mount -w -n -o remount /; mount -a</tt>'' を試してみてください。ま た、コンピューターの電源を切る前には ``<tt>umount -a</tt>'' を忘れずに実 行してください。 <!-- <item>A number: by specifying a number on the kernel command line, you instruct <em>init</em> to enter a specific run-level (the default is usually 3 or 2, according to the distribution you chose). Refer to the <em>init</em> documentation, to <tt>/etc/inittab</tt> and to <tt>/etc/rc*.d</tt> to probe further. --> <item>数字 カーネルのコマンドラインに数字を指定することによって、 <em>init</em> にどの ラン・レベル で実行するのかを指定することができます (デフォルトは通常 3 もしくは 2 で、ディストリビューションによります)。 詳しく知りたいときは、<em>init</em>, <tt>/etc/inittab</tt> や <tt>/etc/rc*.d</tt> のドキュメントを参照してください。 </itemize> <sect1>Lilo をアンインストールするには? <!-- How Can I Uninstall Lilo? --> <p> <!-- When Lilo overwrites a boot sector, it saves a backup copy in <tt>/boot/boot.</tt><em/xxyy/, where <em/xxyy/ are the major and minor numbers of the device, in hex. You can see the major and minor numbers of your disk or partition by running ``<tt>ls -l /dev/</tt><em/device/''. For example, the first sector of <tt>/dev/hda</tt> (major 3, minor 0) will be saved in <tt>/boot/boot.0300</tt>, installing Lilo on <tt>/dev/fd0</tt> creates <tt>/boot/boot.0200</tt> and installing on <tt>/dev/sdb3</tt> (major 8, minor 19) creates <tt>/boot/boot.0813</tt>. Note that Lilo won't create the file if there is already one so you don't need to care about the backup copy whenever you reinstall Lilo (for example, after recompiling your kernel). The backup copies found in <tt>/boot/</tt> are always the snapshot of the situation before installing any Lilo. --> Lilo がブートセクタを上書きする際には、<tt>/boot/boot.</tt><em/xxyy/ と してバックアップを作成します。<em/xxyy/ はデバイスのメジャー/マイナー番 号を 16 進数で表したものです。ディスク/パーティションのメジャー/マイナー 番号は ``<tt>ls -l /dev/</tt><em/device/'' を実行することで見られます。 例えば、<tt>/dev/hda</tt> (メジャー 3 番、マイナー 0 番)の最初のセクタは <tt>/boot/boot.0300</tt> に保存され痔<tt>/dev/fd0</tt> の場合は <tt>/boot/boot.0200</tt>、<tt>/dev/sdb3</tt> (メジャー 8 番、マイナー 19 番) は <tt>/boot/boot.0813</tt> を作成します。(訳注: 16 進数ですから、 10 進数の 19 は 16 進数の 13 になります) すでにファイルが存在していた場合 Lilo はファイルを作成しようとはしません。 ですから Lilo を再インストールする際に(例えばカーネルの再コンパイル後)、 ファイルのバックアップを取ることを気にする必要はありません。 <tt>/boot/</tt> に存在するブートセクタのバックアップファイルは、常に Lilo のインストール前のスナップショットです。 <!-- あまりにも読みにくいんで、パラグラフ分割... --> <p> <!-- If you ever need to uninstall Lilo (for example, in the unfortunate case you need to uninstall Linux), you just need to restore the original boot sector. If Lilo is installed in <tt>/dev/hda</tt>, just do ``<tt>dd if=/boot/boot.0300 of=/dev/hda bs=446 count=1</tt>'' (I personally just do ``<tt>cat /boot/boot.0300 > /dev/hda</tt>'', but this is not safe, as this will restore the original partition table as well, which you might have modified in the meanwhile). This command is much easier to run than trying ``<tt>fdisk /mbr</tt>'' from a DOS shell: it allows you to cleanly remove Linux from a disk without ever booting anything but Linux. After removing Lilo remember to run Linux' <em>fdisk</em> to destroy any Linux partition (DOS' <em>fdisk</em> is unable to remove non-dos partitions). --> Lilo をアンインストールする必要がある場合(例えば不幸にも Linux をアンイ ンストールしなければならない時)、必要な作業は単にオリジナルのブートセク ターをリストアすることだけです。Lilo が <tt>/dev/hda</tt> にインストール されているなら単に``<tt>dd if=/boot/boot.0300 of=/dev/hda bs=446 count=1</tt>'' を実行するだけです。 (私自身は ``<tt>cat /boot/boot.0300 > /dev/hda</tt>'' を実行するだけです が、これは安全ではありません。オリジナルのパーティションテーブルを(その 後に変更したかもしれないのに)リストアしてしまうからです) このコマンドは DOS のコマンドプロンプトから``<tt>fdisk /mbr</tt>''を実行 することよりも簡単ですこの操作によって、Linux 以外の OS をまったく使わず に (起動さえすることなく) ディスクから Linux をきれいさっぱり消してしま うことができますLilo を取り除いたあとに Linux の <em>fdisk</em> を実行し て、すべての Linux パーティションを削除することを忘れないでください(DOS の <em>fdisk</em> は DOS 以外のパーティションを消すことはできません) 。 <p> <!-- If you installed Lilo on your root partition (e.g., <tt>/dev/hda2</tt>), nothing special needs to be done to uninstall Lilo. Just run Linux' <em>fdisk</em> to remove Linux partitions from the partition table. You must also mark the DOS partition as bootable. --> Lilo を(訳注:MBR にではなく)ルートパーティションにインストールしてい た場合(例えば <tt>/dev/hda2</tt>)は、Lilo をアンインストールするために必 要なことは特にありません。単に Linux の <em>fdisk</em> を実行し、Linux パーティションをパーティションテーブルから取り除くだけです。また DOS パー ティションをブート可能(bootable)にする必要もあるでしょう。 <sect>シンプルな設定 <!-- The Simple Configuration --> <p> <!-- Most Lilo installations use a configuration file like the following one: --> 多くの Lilo では次のような設定ファイルを使用します。 <!-- <verb> boot = /dev/hda # or your root partition delay = 10 # delay, in tenth of a second (so you can interact) vga = 0 # optional. Use "vga=1" to get 80x50 #linear # try "linear" in case of geometry problems. image = /boot/vmlinux # your zImage file root = /dev/hda1 # your root partition label = Linux # or any fancy name read-only # mount root read-only other = /dev/hda4 # your dos partition, if any table = /dev/hda # the current partition table label = dos # or any non-fancy name </verb> --> <verb> boot = /dev/hda # もしくはあなたの環境でのルートパーティション delay = 100 # ディレイ(遅延)10 秒です(これぐらい余裕があれば、引数入力などができるでしょう) vga = 0 # 省略可能。 "vga=1" を指定すると 80x50 文字表示になります #linear # ジオメトリーに問題があった場合、"linear" を試してみてください image = /boot/vmlinux # zImage ファイル root = /dev/hda1 # ルートパーティション label = Linux # 適当な名前でも構いません read-only # ルートパーティションを read-only でマウント other = /dev/hda4 # DOS パーティションがある場合 table = /dev/hda # 現在のパーティションテーブル label = dos # もしくはその他の素敵な :-) 名前 </verb> <!-- 原文の "delay = 10" だと 1 秒だから、余裕があるとは到底思えない :-) --> <p> <!-- You can have multiple ``image'' and ``other'' sections if you want. It's not uncommon to have several kernel images configured in your <em>lilo.conf</em>, at least if you keep up to date with kernel development. --> 必要に応じて、複数の``image''や``other''セクションを指定することができま す。複数のカーネルイメージを <em>lilo.conf</em> に指定することは珍しくあ りません。少なくとも開発版のカーネルを追っかけている時はそうです。 <sect1>大きなカーネルを扱うには <!-- How to Deal with Big Kernels --> <p> <!-- If you compile a ``zImage'' kernel and it is too big to fit in half a megabyte (this is commong with new 2.1 kernels), you should build a ``big zImage'' instead: ``<tt>make bzImage</tt>''. To boot a big kernel image nothing special is needed, but you need version 18 or newer of Lilo. If your installation is older, you should upgrade your Lilo package. --> カーネルを``zImage''でコンパイルした際に、サイズが 512KB 以上になってし まった場合(2.1 以降の新しいカーネルなどでは普通のことです)、代わりに ``<tt>make bzImage</tt>''を使用して``big zImage''なカーネルをビルドする 必要があります。大きな(bzImageな)カーネルイメージをブートする為に特に 必要なことはありませんが、バージョン 18 以上の Lilo が必要です。インストー ルされている物が古い場合、Lilo パッケージをアップグレードすべきです。 <sect1>その他の情報源 <!-- Other Sources of Information --> <p> <!-- In addition to the Lilo docs, there are a number of mini-howto's that can be useful for your needs. All of them are called ``Linux+<em/foobarOS/'', for some <em/foobarOS/, they deal with coexistence of Linux and other operationg system(s). Also, ``Multiboot-with-LILO'' describes how the various Windows flavours can be made to coexist with Linux. --> Lilo のドキュメントの他にも、いくつかの役立つ mini-howto があります。そ れらのうち、<em/なんちゃら OS/ 用のドキュメントは ``Linux+<em/なんちゃら OS/'' といった名前になっています。これは Linux と他の OS との同居につい て扱っています。また``Multiboot-with-LILO'' では Windows ファミリーの OS と Linux を同居させる方法について説明しています。 (訳注:例えば Windows95 との同居について説明しているドキュメントは "Linux+Win95" という名前になっています) <sect>bios= を使用して、インストールした hdc を hda としてブートさせる <!-- Installing <tt/hdc/ to Boot as <tt/hda/ and Using <tt>bios=</tt> --> <p> <!-- Lilo allows to map the kernel image from one disk and instruct the BIOS to retrieve it from another disk. For example, it's common for me to install Linux on a disk I connect to <tt/hdc/ (master disk of secondary controller) and boot it as a standalong system on the primary IDE controller of another computer. I copied the installation floppy to a tiny partition, so I can run <em>chroot</em> in a virtual console to install <tt/hdc/ while I use the system to do something else. --> Lilo を使って、あるディスクからカーネルイメージのマップを作成し、そして そのカーネルイメージを別のディスクから取得するよう BIOS に指示する、とい うことが可能です。例えば私がよくやることは Linux を <tt/hdc/ に接続した ディスク(IDE のセカンダリーコントローラーのマスター)にインストールして、 そのディスクを別なコンピュータのプライマリー IDE コントローラに接続し、 単独で動作するシステムとして起動させることです。インストール用フロッピー を小さなパーティションにコピーしたので、他の作業をするために自分のシステ ムを使いながら、<em>chroot</em> を仮想コンソールで実行して<tt/hdc/ への インストール作業を実行できます。 <p> <!-- The <em>lilo.conf</em> file I use to install Lilo looks like: --> 私が Lilo をインストールするために使用している <em>lilo.conf</em> ファイルはこのようになっています。 <!-- <verb> # This file must be used from a system running off /dev/hdc boot = /dev/hdc # overwrite MBR of hdc disk = /dev/hdc # tell how hdc will look like: bios = 0x80 # the bios will see it as first drive delay = 0 vga = 0 image = /boot/vmlinux # this is on /dev/hdc1 root = /dev/hda1 # but at boot it will be hda1 label = Linux read-only </verb> --> <verb> # このファイルを使うには /dev/hdc が存在するシステム上である必要があります。 boot = /dev/hdc # hdc の MBR を上書き disk = /dev/hdc # hdc がどのように見えるかを指定 bios = 0x80 # BIOS はこのドライブを 1 番目のドライブとして扱う delay = 0 vga = 0 image = /boot/vmlinux # これ(カーネルイメージ)は /dev/hdc1 上にありますが root = /dev/hda1 # ブート時に hda1 が root デバイスになります label = Linux read-only </verb> <p> <!-- This configuration file must be read by a Lilo running <bf>off /dev/hdc1</bf>. The Lilo maps that get written the boot sector (<tt>/dev/hdc</tt>) must refer to the files in <tt>/boot</tt> (currently installed as hdc); such files will be accessed under hda when this disk will be booted as a standalone system. --> この設定ファイルは <bf>/dev/hdc1</bf> の Lilo コマンドで読みこむ必要があ ります。Lilo は、ブートセクタ (<tt>/dev/hdc</tt>) に書き込まれる Lilo の マップ <tt>/boot</tt> 内のファイルを参照しなければなりません。それらのファ イルはこのディスクがスタンドアローンシステムとしてブートされた時には hda にあるものとしてアクセスされます。 <p> <!-- I call this configuration file <tt>/mnt/etc/lilo.conf.hdc</tt> (<tt>/mnt</tt> is where hdc is mounted during the installation. I install Lilo by invoking ``<tt>cd /mnt; chroot . sbin/lilo -C /etc/lilo.conf.hdc</tt>''. Refer to the manual page for <em>chroot</em> if this looks magic. --> 私はこの設定ファイルを <tt>/mnt/etc/lilo.conf.hdc</tt> という名前にして います。<tt>/mnt</tt> は hdc がインストール中にマウントされている場所で す。Lilo をインストールする場合には ``<tt>cd /mnt; chroot . sbin/lilo -C /etc/lilo.conf.hdc</tt>'' を実行します。これが魔法のように見えるのであれ ば、<em>chroot</em> の man page を参照してください。 <p> <!-- The ``<tt>bios=</tt>'' directive in <tt>lilo.conf</tt> is used to tell Lilo what the BIOS thinks of your devices. BIOS calls identify floppy disks and hard drives with a number: 0x00 and 0x01 select the floppy drives, 0x80 and the following numbers select hard disks (old BIOSes can only access two disks). The meaning of ``<tt>bios = 0x80</tt> in the previous sample file is therefore ``use 0x80 in your BIOS calls for <tt>/dev/hdc</tt>''. --> <tt>lilo.conf</tt> の ``<tt>bios=</tt>'' パラメーターは Lilo に、BIOS がデバイスとして何を使うのかを指定します。BIOS コールはフロッピーディス クとハードディスクを番号で識別します。0x00 と 0x01 はフロッピードライブ を、0x80 以降の番号(古い BIOS では2つのディスクのみアクセス可能)はハー ドディスクとして認識します。つまり先のサンプルの ``<tt>bios = 0x80</tt>'' は、``<tt>/dev/hdc</tt>'' には ``BIOS コールの 0x80 を使用す る''ということです。 <p> <!-- This Lilo directive can be handy in other situations, for example when your BIOS is able to boot from SCSI disks instead of IDE ones. When both IDE and SCSI devices are there, Lilo can't tell whether 0x80 will refer to one or the other because the user is able to choose it in the BIOS configuration menus, and the BIOS can't be accessed while Linux is running. --> この Lilo パラメーターは他の状況でも便利です。例えば BIOS が IDE ディス クの代わりに SCSI ディスクからブートできる場合です。IDE と SCSI デバイス の両方がある場合、Lilo は 0x80 がどちらを指しているかわからない(ユーザー が BIOS 設定メニュー内でどちらからブートするかを選択できるため)し、 Linux が動作している間には BIOS にアクセスする事はできません。 <p> <!-- By default, Lilo assumes that IDE drives are mapped first by the BIOS, but this can be overridden by using instructions like these in <tt>/etc/lilo.conf</tt>: --> デフォルトでは Lilo は、BIOS によって IDE ドライブが始めにマップされると 仮定していますが、<tt>/etc/lilo.conf</tt> に次のような指定をすることによっ て変更することができます。 <verb> disk = /dev/sda bios = 0x80 </verb> <sect>BIOS からルートパーティションが見えないときに Lilo を使用する <!-- Using Lilo When the BIOS Can't See the Root Partition --> <p> <!-- I have two IDE drives, and a SCSI drive. The SCSI drive can't be seen from BIOS. The Linux Loader, Lilo, uses BIOS calls and can only see drives that BIOS can see. My stupid AMI BIOS will only boot from "A:" or "C:" My root file system is on a partition on the SCSI drive. --> 私は 2 台の IDE ドライブと 1 台の SCSI ドライブを持っていますが、SCSI は BIOS から見えません。Lilo は BIOS コールを使用するので BIOS から認識する ドライブしか見えません。私の馬鹿 AMI BIOS は "A:" か "C:" からしかブート しようとしませんが、ルートファイルシステムは SCSI ドライブのパーティショ ン上にあります。 <!-- これ以降の例は以前のメンテナが書いたやつだから "The Linux Loader" という 記述が現れたんだろうなぁ。まぁ必要ないから省きましょ :-) --> <p> <!-- The solution consists in storing the kernel, map file, and chain loader in a Linux partition on the first IDE. Notice that it is not necessary to keep your kernel on your root partition. --> 解決策としては、カーネル、マップファイル、及びチェインローダーを 1 番目 の IDE の Linux パーティションに入れることです。カーネルをルートパーティ ションに置く必要はないことを覚えておいてください。 <p> <!-- The second partition on my first IDE (<tt>/dev/hda2</tt>, the Linux partition used to boot the system) is mounted on <tt>/u2</tt>. Here is the <tt>/etc/lilo.conf</tt> file I used. --> 1 番目の IDE の 2 番目のパーティション(<tt>/dev/hda2</tt>、システムをブー トするのに使われる Linux パーティション)は <tt>/u2</tt> にマウントされ ています。これが使用した <tt>/etc/lilo.conf</tt> です。 <!-- <verb> # Install Lilo on the Master Boot Record # on the first IDE. # boot = /dev/hda # /sbin/lilo (the installer) copies the Lilo boot record # from the following file to the MBR location. install = /u2/etc/lilo/boot.b # # I wrote a verbose boot menu. Lilo finds it here. message = /u2/etc/lilo/message # The installer will build the following file. It tells # the boot-loader where the blocks of the kernels are. map = /u2/etc/lilo/map compact prompt # Wait 10 seconds, then boot the 1.2.1 kernel by default. timeout = 100 # The kernel is stored where BIOS can see it by doing this: # cp -p /usr/src/linux/arch/i386/boot/zImage /u2/z1.2.1 image = /u2/z1.2.1 label = 1.2.1 # Lilo tells the kernel to mount the first SCSI partition # as root. BIOS does not have to be able to see it. root = /dev/sda1 # This partition will be checked and remounted by /etc/rc.d/rc.S read-only # I kept an old Slackware kernel lying around in case I built a # kernel that doesn't work. I actually needed this once. image = /u2/z1.0.9 label = 1.0.9 root = /dev/sda1 read-only # My DR-DOS 6 partition. other = /dev/hda1 loader=/u2/etc/lilo/chain.b label = dos alias = m </verb> --> <verb> # # Lilo を 1 番目の IDE の MBR にインストール boot = /dev/hda # # /sbin/lilo(インストーラー)が Lilo ブートレコードを # 次のファイルから MBR の場所へコピー install = /u2/etc/lilo/boot.b # # 詳細な(verbose) ブートメニューを書きました。Lilo はここから探します message = /u2/etc/lilo/message # # インストーラーは次のファイルを作成します。 # これはブートローダーに、カーネルのあるブロックの場所を指示します map = /u2/etc/lilo/map compact prompt # # 10 秒待ち、デフォルトとして 1.2.1 カーネルをブートします。 timeout = 100 # # cp -p /usr/src/linux/arch/i386/boot/zImage /u2/z1.2.1 を # 実行することによってカーネルは BIOS から見える場所に置かれます image = /u2/z1.2.1 label = 1.2.1 # # Lilo はカーネルに、SCSI ディスクの 1 番目のパーティションを # ルートパーティションとしてマウントするように指示します root = /dev/sda1 # # このパーティションは /etc/rc.d/rc.S スクリプトによって、 # チェックされて再マウントされます read-only # # 作成したカーネルが動作しない場合に備え、古い Slackware カーネルを # 置いておきます。実際、過去に必要になったことがあります image = /u2/z1.0.9 label = 1.0.9 root = /dev/sda1 read-only # # DR-DOS 6 パーティションです other = /dev/hda1 loader=/u2/etc/lilo/chain.b label = dos alias = m </verb> <sect>BIOS が扱えない大容量ディスクをアクセス <!-- Accessing Huge Disks When the BIOS Can't --> <p> <!-- The system in my office has a 1GB IDE drive. The BIOS can only see the first 504 MB of the IDE. (Where MB means 2**10 bytes, not 10**6 bytes.) So I have MS-DOS on a 350 MB partition <tt>/dev/hda1</tt> and my Linux root on a 120 MB partition <tt>/dev/hda2</tt>. --> 私のオフィスのシステムには 1GB の IDE ドライブがありますが、BIOS からは 最初の 504MB しか見えません。(ここでは MB = 1000 バイトではなく、1024 バイトとします)ですから、MS-DOS を 350MB パーティション <tt>/dev/hda1</tt> に、Linux のルートを 120MB パーティション <tt>/dev/hda2</tt> に置いています。 (訳注:バイト数を表現する際には、K = 1024(つまり 1KB = 1024)という決 まりがありますが、M = 1024KB という決まりはありません。ですから各 HDD メー カーは M = 1000KB として HDD の容量を表しています。ちなみに、k と小文字 で記述した場合 k = 1000 となります) <p> <!-- MS-DOS was unable to install itself correctly when the drive was fresh. Novell DOS 7 had the same problem. Luckily for me, "Options by IBM" forgot to put the "OnTrack" diskette in the box with the drive. The drive was supposed to come with a product called "OnTrack Disk Manager." If you only have MSDOS, I guess you have to use it. --> 買ってきたばかりのドライブでは、MS-DOS は自分自身を正常にインストールす ることができませんでした。Novell DOS 7 にも同じ問題がありました。さらに 幸運な事に、"IBM の選定先" は "OnTrack" ディスクをドライブのパッケージの 中に入れ忘れていました。ドライブには "OnTrack Disk Manager" という製品が 付属しているはずでした。MS-DOS しか持っていない場合、それを使う必要があ るでしょう。 (訳注:おそらくドライブが IBM 製で、IBM がパッケージングを発注している 会社/工場がマニュアルを入れ忘れたということでしょう) <p> <!-- So I made a partition table with Linux' fdisk. MSDOS-6.2 refused to install itself in <tt>/dev/hda1</tt>. It said something like ``this release of MS-DOS is for new installations. Your computer already has MS-DOS so you need to get an upgrade release from your dealer.'' Actually, the disk was brand new. --> そこで、パーティションテーブルを Linux から作りましたが、MS-DOS 6.2 は <tt>/dev/hda1</tt> にインストールする時に ``this release of MS-DOS is for new installations. Your computer already has MS-DOS so you need to get an upgrade release from your dealer.'' というメッセージが表示されま した。ですが、このディスクは新品でした。 (訳注:エラーメッセージをあえて訳すとすると、``このリリースの MS-DOS は 新規インストール用です。コンピューターにはすでに MS-DOS がインストールさ れています。アップグレード版を入手する必要があります。''でしょうか。日本 語版 MS-DOS を持っていないので、確認はできませんが。ご存じの方は翻訳者 (cz8cb01@linux.or.jp)までご一報を :-)) <p> <!-- What a crock! So I ran Linux' fdisk again and deleted partition 1 from the table. This satisfied MS-DOS 6.2 which proceeded to create the exact same partition 1 I had just deleted and installed itself. MS-DOS 6.2 wrote its Master Boot Record on the drive, but it couldn't boot. --> なんてこった。それから Linux の fdisk を再び実行して作成したパーティショ ン 1 を削除しました。これで MS-DOS 6.2 が満足したのか、いま削除したのと まったく同じパーティション 1 を作成すると、そこにインストールできました。 MS-DOS 6.2 はそのドライブの MBR に書き込みましたが、ブートすることはでき ませんでした。 <p> <!-- Luckily I had a Slackware kernel on floppy (made by the Slackware installation program "setup"), so I booted Linux and wrote Lilo over MS-DOS' broken MBR. This works. Here is the <tt>/etc/lilo.conf</tt> file I used: --> 幸い、Slackware のカーネルがフロッピー(Slackware インストールプログラム の "setup" で作られたもの)にあったので、Linux をブートして Lilo で MS-DOS の壊れた MBR を上書きしました。これはうまくいきました。これが使 用した <tt>/etc/lilo.conf</tt> です。 <!-- <verb> boot = /dev/hda map = /lilo-map delay = 100 ramdisk = 0 # Turns off ramdisk in Slackware kernel timeout = 100 prompt disk = /dev/hda # BIOS only sees first 500 MB. bios = 0x80 # specifies the first IDE. sectors = 63 # get the numbers from your drive's docs. heads = 16 cylinders = 2100 image = /vmlinuz append = "hd=2100,16,63" root = /dev/hda2 label = linux read-only vga = extended other = /dev/hda1 label = msdos table = /dev/hda loader = /boot/chain.b </verb> --> <verb> boot = /dev/hda map = /lilo-map delay = 100 ramdisk = 0 # Slackware カーネルのラムディスクをオフ timeout = 100 prompt disk = /dev/hda # BIOS は始めの 500MB のみ認識 bios = 0x80 # 1 番目の IDE を指定 sectors = 63 # ドライブのマニュアルからこの数値を調べてください heads = 16 cylinders = 2100 image = /vmlinuz append = "hd=2100,16,63" root = /dev/hda2 label = linux read-only vga = extended other = /dev/hda1 label = msdos table = /dev/hda loader = /boot/chain.b </verb> <p> <!-- After I installed these systems, I verified that the partition containing the zImage, boot.b, map, chain.b, and message files can use an msdos file system, as long as it is not "stackered" or "doublespaced." So I could have made the DOS partition on <tt>/dev/hda1</tt> 500 MB. --> これらのシステムをインストールした後、zImage, boot.b, map, chain.b およ び メッセージファイルのあるパーティションが msdos fs(ファイルシステム) を、"stackered" や "doublespaced" されていない限り、使用できることを確認 しました(訳注:"stackered" は Stacker、"doublespaced" は Double Space で圧縮されているファイルシステムの事でしょう。懐かしいですね(笑))。こ れで、DOS パーティションを <tt>/dev/hda1</tt> 500MB に作成することができ ました。 <p> <!-- I have also learned that "OnTrack" would have written a partition table starting a few dozen bytes into the drive, instead of at the beginning, and it is possible to hack the Linux IDE driver to work around this problem. But installing would have been impossible with the precompiled Slackware kernel. Eventually, IBM sent me an "OnTrack" diskette. I called OnTrack's technical support. They told me Linux is broken because Linux doesn't use BIOS. I gave their diskette away. --> 私は "OnTrack" がパーティションテーブルを先頭からではなく数十バイト先か ら書いてしまうことを知っていました。この問題は Linux の IDE ドライバをハッ クすることで対処できますが、コンパイル済みの Slackware カーネルではイン ストールすることはできませんでした。最終的に、IBM は "OnTrack" ディスク を送ってきました。OnTrack のテクニカルサポートに電話したところ、Linux は BIOS を使わないから欠陥品だと言われました。このフロッピーディスクは誰 かにあげてしまいました。 (訳注:いつから実装されたのかは知りませんが、現在では Linux の標準カー ネルに DiskManager や EZ Drive に対応するコードが含まれているはずです。 drivers/block/genhd.c を見るといいでしょう。たしか 2.0.27 あたりには既に あったはず。ソースコード中のコメントにはこのように書かれています。DM6 は Ontrack DiskManager 6 の意味だと思う) <verb> if (SYS_IND(p) == EZD_PARTITION) { /* * The remainder of the disk must be accessed using * a translated geometry that reduces the number of * apparent cylinders to less than 1024 if possible. * * ide_xlate_1024() will take care of the necessary * adjustments to fool fdisk/LILO and partition check. */ (中略) } else if (SYS_IND(p) == DM6_PARTITION) { /* * Everything on the disk is offset by 63 sectors, * including a "new" MBR with its own partition table, * and the remainder of the disk must be accessed using * a translated geometry that reduces the number of * apparent cylinders to less than 1024 if possible. * * ide_xlate_1024() will take care of the necessary * adjustments to fool fdisk/LILO and partition check. </verb> <sect>Rescue フロッピーからの起動 <!-- Booting from a Rescue Floppy --> <p> <!-- Next, I installed Windows-95 on my office system. It blew away my nice Lilo MBR, but it left my Linux partitions alone. Kernels take a long time to load from floppy, so I made a floppy with a working Lilo setup on it, which could boot my kernel from the IDE. --> 次に Windows 95 を私のオフィスのシステムにインストールしました。これは Lilo MBR をぶち壊してしまい、Linux パーティションだけを残しました。カー ネルをフロッピーから読み込むのは時間が掛かるので、Lilo が使えるような設 定をしたフロッピーを作って IDE からカーネルをブートできるようにしました。 <!-- I made the lilo floppy like so: --> Lilo フロッピーはこのようにして作りました。 <!-- <verb> fdformat /dev/fd0H1440 # lay tracks on virgin diskette mkfs -t minix /dev/fd0 1440 # make file system of type minix mount /dev/fd0 /mnt # mount in the standard tmp mount point cp -p /boot/chain.b /mnt # copy the chain loader over lilo -C /etc/lilo.flop # install Lilo and the map on the diskette. umount /mnt </verb> --> <verb> fdformat /dev/fd0H1440 # 新しいディスクにトラックを作成 mkfs -t minix /dev/fd0 1440 # minix タイプのファイルシステムを作成 mount /dev/fd0 /mnt # 標準的なマウントポイント /mnt にマウント cp -p /boot/chain.b /mnt # チェインローダーを上書き lilo -C /etc/lilo.flop # Lilo と map をディスク上にインストール umount /mnt </verb> <p> <!-- Notice that the diskette <bf>must be mounted when you run the installer</bf> so that Lilo can write its map file properly. --> Lilo が map ファイルを正しく書き込むためには、ディスクが<bf>インストーラー を実行する時にはマウントされている必要がある</bf>ということに気を付けて ください。 <P> <!-- This file is /etc/lilo.flop. It's almost the same as the last one: --> <tt>/etc/lilo.flop</tt> は次のようになっています。これは最後の <tt>/etc/lilo.conf</tt> とほとんど同じ物です。 <!-- <verb> # Makes a floppy that can boot kernels from HD. boot = /dev/fd0 map = /mnt/lilo-map delay = 100 ramdisk = 0 timeout = 100 prompt disk = /dev/hda # 1 GB IDE, BIOS only sees first 500 MB. bios=0x80 sectors = 63 heads = 16 cylinders = 2100 image = /vmlinuz append = "hd=2100,16,63" root = /dev/hda2 label = linux read-only vga = extended other = /dev/hda1 label = msdos table = /dev/hda loader = /mnt/chain.b </verb> --> <verb> # ハードディスクからカーネルをブートできるフロッピーを作成 boot = /dev/fd0 map = /mnt/lilo-map delay = 100 ramdisk = 0 timeout = 100 prompt disk = /dev/hda # 1 GB IDE では BIOS は始めの 500MB のみ認識 bios=0x80 sectors = 63 heads = 16 cylinders = 2100 image = /vmlinuz append = "hd=2100,16,63" root = /dev/hda2 label = linux read-only vga = extended other = /dev/hda1 label = msdos table = /dev/hda loader = /mnt/chain.b </verb> <p> <!-- Finally, I needed MS-DOS 6.2 on my office system, but I didn't want to touch the first drive. I added a SCSI controller and drive, made an msdos file system on it with Linux' mkdosfs, and Windows-95 sees it as "D:". But of course MSDOS will not boot off of D:. This is not a problem when you have Lilo. I added the following to the <tt>lilo.conf</tt> in Example 2. --> 最終的にオフィスのシステムで MS-DOS 6.2 が必要となりましたが、一番目のド ライブには触りたくありませんでした。SCSI コントローラーとドライブを追加 して、msdos fs(ファイルシステム)を Linux の mkdosfs で作成しました。 Windows 95 からは "D:" として見えます。当然 MSDOS は D: からブートしませ んが、Lilo があれば問題ではありません。二番目の例の <tt>lilo.conf</tt> に次の行を追加しました。 <verb> other = /dev/sda1 label = d6.2 table = /dev/sda loader = /boot/any_d.b </verb> <!-- With this modification MSDOS-6.2 runs, and it thinks it is on C: and Windows-95 is on D:. --> この修正により MS-DOS 6.2 は動き、また自分自身を C: に、Windows 95 を D: にあると認識します。 <sect>翻訳について <p> 当文書は中谷千絵さんの翻訳した 1996/08/27 版を、早川が最新版(1998/08/16) の LDP で更新したものです。 翻訳(特に訳注)の際には「夜のお菓子」で有名な佐野武俊さんに多くの助言を 頂きました。ありがとうございます。 <verb> 日本語訳:中谷千絵 <jeanne@mbox.kyoto-inet.or.jp> (1996/08/27) 日本語訳:早川 仁 <cz8cb01@linux.or.jp> (1999/09/12) </verb> </article>