The Linux+FreeBSD mini-HOWTO <author>Niels Kristian Bech Jensen <tt/nkbj@image.dk/ <date>v1.11, 30 March 2000 <trans>The Linux JF Project, <tt/JF@linux.or.jp/ <tdate>v1.11j, 30 March 2000 <abstract> <nidx>dual booting!Linux, FreeBSD (see FreeBSD dualboot)</nidx> <nidx>Linux!FreeBSD dualboot with (see FreeBSD dualboot)</nidx> <nidx>FreeBSD!Linux dualboot with (see FreeBSD dualboot)</nidx> <!-- This document describes how to use Linux and FreeBSD on the same system. It introduces FreeBSD and discusses how the two operating systems can cooperate, e.g. by sharing swap space. You should probably have some experience with Linux or FreeBSD and hard drive partitioning (<tt/fdisk/) before you read this document. The tips herein are tested using FreeBSD 2.2.2, but they should be valid for newer versions as well. Do not hesitate to mail me if you have comments, questions or suggestions about this document. I would also like to hear from people who have experience using Linux together with NetBSD or OpenBSD. --> 本文書では Linux と FreeBSD を一つのシステム上で利用する方法を述べます. まずFreeBSDを紹介し,それから2つの OS をどうやって共存させるか(例えば, スワップの共有)を述べます.本文書を理解するためには,Linux およびディス クのパーティション分割(<tt/fdisk/)に関する経験が多少必要になるでしょう. ここで挙げる方法は FreeBSD 2.2.2 でテストしていますが,新しいバージョ ンのものでも大丈夫だと思います.本文書についてのコメント,疑問や提案が あれば,気軽に電子メールを送ってください.また,NetBSD や OpenBSD を Linux と一緒に使った経験がある方々は是非話をお聞かせください. </abstract> <toc> <sect>FreeBSD について <!-- What is FreeBSD? --> <p> <nidx>FreeBSD dualboot!Freebsd overview</nidx> <!-- <url url="http://www.freebsd.org/" name="FreeBSD"> is a free Unix-like operating system much like Linux. The main difference is that, while the Linux kernel has been written from scratch, FreeBSD is based on the freely redistributable parts of 4.4BSD (Berkeley Software Distribution) known as 4.4BSD-lite. This fact might lead some people to suggest that FreeBSD is closer to being ``real'' UNIX® than Linux. FreeBSD runs only on the Intel PC platform (i386 and higher); ports to the DEC Alpha and Sun Sparc platforms are being worked on at the moment. <url url="http://www.netbsd.org/" name="NetBSD"> and <url url="http://www.openbsd.org/" name="OpenBSD"> are similar to FreeBSD, and both run on several platforms. Hardware requirements for all these *BSD systems are similar to those for Linux. --> <url url="http://www.freebsd.org/" name="FreeBSD"> はLinux と良く似た フリーの UNIX ライクな OS です.両者の主な違いは,Linux のカーネルが一 から書かれたのに対し,FreeBSD は 4.4BSD-lite として知られている, 4.4BSD(Berkeley Software Distribution) の自由に再配布できる部分を元に して作られたことです.このため,Linux よりも FreeBSD の方が「真」の UNIX(登録商標としての)に近いという人もいます.FreeBSD は Intel ベース の PC(i386以降)上でしか動作しません.しかし,DEC Alpha や Sun Sparc へ の移植作業が現在行われています.) <url url="http://www.netbsd.org/" name="NetBSD"> と <url url="http://www.openbsd.org/" name="OpenBSD"> は FreeBSD に似てい ますが,どちらも複数のプラットフォームで動作します.これらの *BSD システムが要求するハードウェア性能は Linux と同じくらいです. <!-- The development of FreeBSD is managed in a different way than the Linux development. A core team of developers serve as arbitrators and provide leadership for the project. Big changes are discussed in advance on the mailing lists. The FreeBSD project has two development trees (just like Linux): <bf/``-CURRENT''/ and <bf/``-STABLE''/. The ``-CURRENT'' development tree is where the development of new features happens. Development to the ``-STABLE'' tree are restricted to bug fixes and some thoroughly tested new features. --> FreeBSD の開発は Linux の開発とは異なる形態で行われています.開発者の 中心チームは調整役として働き,プロジェクトのリーダーシップを執ります. 大きな変更は前もってメーリングリストで議論されます.FreeBSDプロジェク トには(Linux と同じく)二つの開発ツリー(<em/「-CURRENT(最新)」/ と<em/ 「-STABLE(安定)」/)があります.「-CURRENT」の開発ツリーでは新しい機能 の開発が行われています.「-STABLE」のツリーでの開発は主にバグ修正と十 分テストされた新機能に限定されています. <!-- FreeBSD can be used and (re-)distributed freely just as Linux. Most parts of the system are released under the BSD copyright; the rest is under the GNU GPL or other <url url="http://www.opensource.org/" name="open-source"> licences. --> FreeBSD は Linux と同様,自由に利用および配布(再配布)できます.システム のほとんどの部分は BSD copyright に基づいてリリースされています.GPL や他の <url url="http://www.opensource.org/" name="open-source"> ライセンスに 従う部分もあります. <!-- You can find more information about FreeBSD (and download the whole system) at <url url="http://www.freebsd.org/" name="The FreeBSD Project Homepage">. The newest ``-STABLE'' releases and snapshots of the ``-CURRENT'' development code are sold on CDROMs by <url url="http://www.cdrom.com/" name="Walnut Creek CDROM"> (their web- and ftp-servers are running FreeBSD.) --> FreeBSD についての詳しい情報は <url url="http://www.freebsd.org/" name="FreeBSD プロジェクトのホームページ"> にあります.(全システムも入 手できます.) 最新の「-STABLE」リリースと「-CURRENT」開発コードのスナッ プショットは <url url="http://www.cdrom.com/" name="Walnut Creek CDROM"> が CD-ROM で販売しています.(ここのウェブサーバと ftp サーバは FreeBSD です.) <sect>FreeBSD のハードディスクのラベル付け <!-- The FreeBSD way of labelling hard drives --> <p> <nidx>FreeBSD dualboot!disk drive labelling</nidx> <!-- Linux and FreeBSD label hard drives and partitions after two differents schemes. This section explains the main differences between the two schemes. In fact the FreeBSD labelling scheme is an adaption of the traditional BSD labelling style ported to live within the PC's fdisk partitions. Thus it is very similar to other BSD-based Unix systems such as NetBSD, OpenBSD, Ultrix, Digital Unix, SunOS, and Solaris. --> Linux と FreeBSD はハードディスクやパーティションにそれぞれ異なる方法 でラベルを付けます.この章では,両者の主な違いを解説します. FreeBSD のラベル付けは,今まで使われてきた BSD のラベル付けのスタイル を PC の fdisk によるパーティションに当てはまるよう移植したものです. 従って,この方法は NetBSD, OpenBSD, Ultrix, Digital Unix, SunOS, Solaris 等,他の BSD ベースの UNIX システムとよく似ています. <sect1>FreeBSD の「スライス」と「パーティション」 <!-- FreeBSD ``slices'' and ``partitions'' --> <p> <nidx>FreeBSD dualboot!disk drive partitions</nidx> <nidx>FreeBSD dualboot!disk drive slices</nidx> <!-- FreeBSD needs one of the four entries in the partition table on your PC's hard drive. This primary partition is called a <bf/``slice''/ in FreeBSD terminology. It then uses the <tt/disklabel/ program to make up to eight partitions in this primary partition. These logical partitions are called <bf/``partitions''/ in FreeBSD terminology. This concept is similar to the way Linux (and DOS) handles logical partitions in an extended partition. You cannot install FreeBSD in an extended partition made by Linux (or DOS). Note that the Linux <tt/fdisk/ program doesn't display the BSD partitions in a FreeBSD slice from the main menu, but it can display BSD disklabel information if you give the command `b'. The output is something like this (<tt>/dev/hda4</tt> is the FreeBSD slice): --> FreeBSD はPCハードディスクのパーティションテーブルの4つのエントリーの うち1つのエントリーを用います.FreeBSD の用語では,この基本パーティショ ンを<em/「スライス」/と呼びます.そして,<tt/disklabel/というプログラ ムを使って,この基本パーティション内に8つの論理パーティションを作成し ます.FreeBSD の用語では,この論理パーティションを<bf/「パーティション」 /と呼びます.この概念は,Linux (や DOS) が拡張パーティション内で論理パー ティションを扱うことと似ています.Linux (や DOS) で作成した拡張パーティ ション内には,FreeBSD をインストールすることはできません.Linux の <tt/fdisk/ プログラムは,メインメニューではFreeBSD のスライス内の BSD パーティションを表示しませんが,`b'コマンドを与えると BSD のディスクラ ベル情報を表示します.<tt/fdisk/ の出力は以下のようになります (<tt>/dev/hda4</tt>が FreeBSD のスライスです). <verb> bash# fdisk /dev/hda Command (m for help): p Disk /dev/hda: 64 heads, 63 sectors, 621 cylinders Units = cylinders of 4032 * 512 bytes Device Boot Begin Start End Blocks Id System /dev/hda1 * 1 1 27 54400+ 83 Linux native /dev/hda2 28 28 55 56448 83 Linux native /dev/hda3 56 56 403 701568 83 Linux native /dev/hda4 404 404 621 439488 a5 BSD/386 Command (m for help): b Reading disklabel of /dev/hda4 at sector 1624897. BSD disklabel command (m for help): p 8 partitions: # size offset fstype [fsize bsize cpg] a: 64512 1624896 4.2BSD 0 0 0 # (Cyl. 404 - 419) b: 104832 1689408 swap # (Cyl. 420 - 445) c: 878976 1624896 unused 0 0 # (Cyl. 404 - 621) e: 64512 1794240 4.2BSD 0 0 0 # (Cyl. 446 - 461) f: 645120 1858752 4.2BSD 0 0 0 # (Cyl. 462 - 621) BSD disklabel command (m for help): q bash# </verb> <!-- The letters `a'...`f' in the first column are the same labels as shown below in the example for a FreeBSD slice. There are three special partitions in BSD parlace. The letter `a' designates the root partition, `b' designates the swap partition, while `c' designates the whole slice. See the FreeBSD documentation for more information on the ``standard'' way of assigning these letters to different partition types. --> 以下の例で示すように,最初の列の`a'から`f'までの文字は,1つの FreeBSD スライスでは同じラベルになります.BSD の用語では3つの特別なパーティショ ンがあります.`a' はルートパーティションを示し,`b'はスワップパーティ ションを示し,`c'はスライス全体を示します.これらの文字を異なる型のパー ティションに割り当てる「標準の」方法については FreeBSD のドキュメント を参照してください. <sect1>Linux と FreeBSD におけるドライブとパーティションのラベル付け <!-- Drive and partition labelling in Linux and FreeBSD --> <p> <nidx>FreeBSD dualboot!disk drive labelling!compared with Linux</nidx> <nidx>FreeBSD dualboot!disk drive partitions!compared with Linux</nidx> <!-- The hard drives are labelled in the following way in Linux and FreeBSD: --> Linux と FreeBSD では,ハードディスクのラベルはそれぞれ以下のように付 けられます. <verb> Linux FreeBSD 最初の IDE ドライブ /dev/hda /dev/wd0 2番目の IDE ドライブ /dev/hdb /dev/wd1 最初の SCSI ドライブ /dev/sda /dev/sd0 2番目の SCSI ドライブ /dev/sdb /dev/sd1 </verb> <!-- The partitions (FreeBSD slices) on an IDE drive are labelled in the following way (<tt>/dev/hda</tt> is used as an example): --> IDE のディスク上では,パーティション(FreeBSD のスライス)は以下のように ラベルが付けがされます(<tt>/dev/hda</tt>を例にしています). <verb> Linux FreeBSD 最初の基本パーティション /dev/hda1 /dev/wd0s1 2番目の基本パーティション /dev/hda2 /dev/wd0s2 3番目の基本パーティション /dev/hda3 /dev/wd0s3 4番目の基本パーティション /dev/hda4 /dev/wd0s4 </verb> <!-- The partitions in my FreeBSD slice is labelled in the following way. It is the labelling you get by default. It is possible to change the labelling if you do a custom installation of FreeBSD (<tt>/dev/hda4</tt> is the FreeBSD slice in the example): --> 筆者の FreeBSD のスライス内のパーティションは以下のようにラベル付けさ れています.これはデフォルトの設定です.FreeBSD をカスタマイズしてイン ストールした場合には,ラベルの付き方は変わるかもしれません.(例では <tt>/dev/hda4</tt>が FreeBSD のスライスです.) <verb> Linux のラベル FreeBSDのラベル FreeBSD のマウントポイント /dev/hda5 /dev/wd0s4a / /dev/hda6 /dev/wd0s4b swap /dev/hda7 /dev/wd0s4e /var /dev/hda8 /dev/wd0s4f /usr </verb> <!-- If you run <tt/dmesg/ in Linux you will see this as (The linux kernel must be build with <bf/UFS filesystem support/ for this to work. See section <ref id="installlinux" name="Installing and preparing Linux">): --> もし Linux で <tt/dmesg/ を実行すると以下のような結果になります. (Linux のカーネルは <bf/UFS ファイルシステム/ サポートを有効にして構築 しておく必要があります.詳しくは<ref id="installlinux" name="Linux の インストール">の章を見てください.) <verb> Partition check: hda: hda1 hda2 hda3 hda4 < hda5 hda6 hda7 hda8 > </verb> <!-- If you have installed FreeBSD in the <tt>/dev/sd1s3</tt> slice (<tt>/dev/sdb3</tt> in Linux parlace), and <tt>/dev/sdb2</tt> is a Linux extended partition containing two logical partitions (<tt>/dev/sdb5</tt> and <tt>/dev/sdb6</tt>), the previous example would look like this: --> FreeBSD が<tt>/dev/sd1s3</tt> スライス(Linux 用語では <tt>/dev/sdb2</tt>)にインストールされていて,<tt>/dev/sdb2</tt> が 2つ の論理パーティション(<tt>/dev/sdb5</tt> と<tt>/dev/sdb6</tt>)を含む拡 張パーティションである場合には,先程の例は次のようになります. <verb> Linux のラベル FreeBSDのラベル FreeBSD のマウントポイント /dev/sdb7 /dev/sd1s3a / /dev/sdb8 /dev/sd1s3b swap /dev/sdb9 /dev/sd1s3e /var /dev/sdb10 /dev/sd1s3f /usr </verb> <!-- This will be shown as --> この場合には <tt/dmesg/ の出力は次のようになります. <verb> Partition check: sdb: sdb1 sdb2 < sdb5 sdb6 > sdb3 < sdb7 sdb8 sdb9 sdb10 > </verb> <!-- in the output from <tt/dmesg/. --> <!-- If you have a Linux extended partition <em/after/ your FreeBSD slice you're in for trouble, because most Linux kernels installation floppies are build without UFS support, they will not recognise the FreeBSD partitions inside the slice. What should have have been seen as (<tt>/dev/hda3</tt> is the FreeBSD slice and <tt>/dev/hda4</tt> is the Linux extended partition) --> FreeBSD のパーティションの<em/後/に Linux の拡張パーティションを置いて いるとトラブルの元となります.Linux インストール用ブートフロッピーに入っ ているほとんどのカーネルは UFS のサポートが有効になっていないため, スライス内の FreeBSD パーティションを認識しません.例えば <tt>/dev/hda3</tt> を FreeBSD のスライス,<tt>/dev/hda4</tt> を Linux の拡張パーティションとした場合 <verb> Partition check: hda: hda1 hda2 hda3 < hda5 hda6 hda7 hda8 > hda4 < hda9 hda10 > </verb> <!-- is seen as: --> のように見えるべきものが <verb> Partition check: hda: hda1 hda2 hda3 hda4 < hda5 hda6 > </verb> のように見えてしまいます. <!-- This can give you the wrong device assignment and cause the loss of data. My advice is to <em/always put your FreeBSD slice after any Linux extended partitions, and do not change any logical partitions in your Linux extended partitions after installing FreeBSD!/ --> このようなことが起こるとデバイスの割り当てが狂ってしまい,データを壊す こともあり得ます.ですから <em/FreeBSD スライスは必ず Linux 拡張パーティ ションよりも後に置き,FreeBSD をインストールした後は Linux 拡張パーティ ション内の論理パーティションの構成は絶対に変えない/ことをお勧めします. <sect>Linux と FreeBSD でのスワップ共有 <!-- Sharing swap space between Linux and FreeBSD --> <p> <nidx>FreeBSD dualboot!swap space, sharing</nidx> <!-- This section describes how I got Linux and FreeBSD to share a swap partition. There may be other ways to get the same result. You can install FreeBSD before Linux if you want to, just pay attention to the order of the partitions in the FreeBSD slice. --> この章では Linux と FreeBSD でスワップパーティションを共有する方法を述 べます.同様のことを実現する他の方法もあるかもしれません.FreeBSD を Linux の前にインストールすることもできますが,FreeBSD スライスのパーティ ションの順序には注意してください. <sect1>Linux のインストール<label id="installlinux"> <!-- Installing and preparing Linux --> <p> <nidx>FreeBSD dualboot!Linux, installing</nidx> <!-- The first step is to install Linux as normal. You have to leave space for the FreeBSD slice at your hard drive. You don't have to make a Linux swap partition, but if you want one, put it in the space you want to allocate for FreeBSD. That way you can delete the Linux swap partition later and use the space for FreeBSD. --> 最初に,Linux を普通にインストールします.ハードディスクには FreeBSD のスライスに割り当てる分は残しておかなければなりません.Linux のスワッ プパーティションは作る必要はありませんが,もし必要ならば,FreeBSD に 割り当てる予定のパーティションを指定しておます.こうしておけば,後で Linux のスワップパーティションを削除して, FreeBSD で用いることができ ます. <!-- When you have installed Linux you have to build a new kernel. Read <bf/The Linux Kernel HOWTO/ if this is new to you. You <em/have/ to include both <bf/UFS filesystem support (read only)/ and <bf/BSD disklabel (FreeBSD partition tables) support/: --> Linux のインストールが終ったら,次はカーネルを再構築します.カーネル再 構築が初めてならば,<bf/The Linux Kernel HOWTO/を読むといいでしょう. カーネルは,<bf/UFS ファイルシステム(読み出しのみ)/ と <bf/BSD ディス クラベル(FreeBSD のパーティションテーブル)/を両方ともサポートするよう に<em/しておかなければなりません/. <verb> UFS filesystem support (read only) (CONFIG_UFS_FS) [N/y/m/?] y BSD disklabel (FreeBSD partition tables) support (CONFIG_BSD_DISKLABEL) [N/y/?] (NEW) y </verb> <!-- Install the new kernel and reboot. Remove any line including the word <em/swap/ from your <tt>/etc/fstab</tt> file if you have made a Linux swap partition. <em/Make sure you have a working Linux boot floppy with the new kernel./ Now you are ready to install FreeBSD. --> 新しいカーネルをインストールして,コンピュータを再起動します.Linux ス ワップパーティションを作った場合には,<tt>/etc/fstab</tt>ファイルから <em/swap/を含む行を削除します.<em/新しいカーネルが入っていて Linux の ブートフロッピーディスクがあることを確認してください./以上で FreeBSD をインストールする準備ができました. <sect1>FreeBSD のインストール <!-- Installing FreeBSD --> <p> <nidx>FreeBSD dualboot!FreeBSD, installing</nidx> <!-- Install FreeBSD as described in the FreeBSD documentation. Remove the Linux swap partition if you have made one (you can use the FreeBSD <tt/fdisk/ program.) Pay attention to the order of the partitions in the FreeBSD slice. If you use the default labelling the second partition will be the swap partition. Complete the installation of FreeBSD and reboot into Linux <em/using the new Linux boot floppy/. --> FreeBSD の文書に従って,FreeBSD をインストールします.Linux のスワップ パーティションを作った場合には,これを消去します(FreeBSD の<tt/fdisk/ を使って構いません).FreeBSD スライスでの,パーティションの順番には 注意してください.デフォルトのラベル指定を行った場合には,2番目のパー ティションがスワップになります.FreeBSD を全てインストールし, <em/Linux のブートフロッピーディスクを使って/Linux をブートします. <sect1>Linux で FreeBSD のスワップパーティションを使う設定をする <!-- Setting up the FreeBSD swap partition in Linux --> <p> <nidx>FreeBSD dualboot!FreeBSD swap partition configuration</nidx> <!-- Run <tt/dmesg/ when you have booted into Linux. In the output you should see something like this: --> Linux が起動したら<tt/dmesg/を実行します.出力は次のようになります. <verb> Partition check: hda: hda1 hda2 hda3 hda4 < hda5 hda6 hda7 hda8 > </verb> <!-- This means that <tt>/dev/hda4</tt> is your FreeBSD slice, while <tt>/dev/hda5</tt>, <tt>/dev/hda6</tt>, <tt>/dev/hda7</tt> and <tt>/dev/hda8</tt> are the FreeBSD partitions. If your swap partition is the second partition in the slice, it will be <tt>/dev/hda6</tt>. --> この出力は <tt>/dev/hda4</tt> がFreeBSDのスライスであり, <tt>/dev/hda5</tt>, <tt>/dev/hda6</tt>, <tt>/dev/hda7</tt>, <tt>/dev/hda8</tt> が FreeBSD のパーティションであることを表しています. スワップがスライス内の2番目のパーティションであれば, <tt>/dev/hda6</tt>がスワップということになります. <!-- You have to put the following line into your Linux <tt>/etc/fstab</tt> file to enable the swap partition: --> スワップパーティションを有効にするため,Linux の <tt>/etc/fstab</tt>に 次の行を追加します. <verb> /dev/hda6 none swap sw 0 0 </verb> <!-- While FreeBSD can use any type of partition as swap space, Linux needs a special signature in the swap partition. This signature is made by <tt/mkswap/. FreeBSD ruins this signature when it uses the shared swap partition, so you will have to run <tt/mkswap/ each time you boot into Linux. To do this automagically you have to find the script that runs <tt/swapon/ at boot time. In Red Hat Linux it is <tt>/etc/rc.d/rc.sysinit</tt>. Put the following line into that file just <em/before/ <tt/swapon -a/: --> FreeBSD ではどんなパーティションでもスワップとして使うことができますが, Linux のスワップパーティションには特別な印(signature)が書かれていなけ ればなりません.この印は<tt/mkswap/が作成します.スワップパーティショ ンを共有すると,FreeBSD がこの印を壊してしまいますから,Linux を起動す るたびに毎回<tt/mkswap/を実行しなければなりません.これを自動的に行う ために,起動時に<tt/swapon/を実行するスクリプトを見つけて変更します. Red Hat Linux の場合には<tt>/etc/rc.d/rc.sysinit</tt>です.以下の行を <tt/swapon -a/ の<em/前/に挿入します. <verb> awk -- '/swap/ && ($1 !~ /#/) { system("mkswap "$1"") }' /etc/fstab </verb> <!-- This will run <tt/mkswap/ on any swap partitions in <tt>/etc/fstab</tt> every time you boot except if they are commented out (having ``#'' as the first character in the line.) --> これによって,起動時に毎回<tt>/etc/fstab</tt>に記述されている全てのス ワップパーティションに対して,<tt/mkswap/が実行されるようになります. これはコメントアウトされている(行の先頭の文字が``#''である)場合に は実行されません. <!-- Run <tt/free/ to check out the size of the swap space when you have rebooted into Linux. You should also reboot into FreeBSD to make sure everything works as expected. If it does not, you have probably used the wrong partition as swap partition. The only solution to that problem is to reinstall FreeBSD and try again. Experience is a great teacher. :-) --> Linux を再起動した後,<tt/free/コマンドでスワップの大きさを確認します. また,FreeBSD を起動して,きちんと動作しているかどうかを確認します.う まく動作しない場合には,たぶん間違ったパーティションをスワップとして使っ ていると思われます.こうなってしまった場合には,FreeBSD を再インストー ルするしか方法はありません.経験は偉大な教師です. :-) <sect>LILO を使って FreeBSD を起動する <!-- Booting FreeBSD using LILO --> <p> <nidx>FreeBSD dualboot!FreeBSD, booting with LILO</nidx> <!-- You can easily boot FreeBSD with LILO. Do not install the FreeBSD boot selector (<tt/Booteasy/) if you want to use LILO. Append the following lines to your <tt>/etc/lilo.conf</tt> file and run <tt/lilo/ (assuming the FreeBSD slice is <tt>/dev/hda4</tt>): --> LILO を使って FreeBSD を起動するのは簡単です.LILOを使うのならば, FreeBSD のブートセレクタ(<tt/Booteasy/)をインストールしてはいけません. 以下の記述を<tt>/etc/lilo.conf</tt>に加え,<tt/lilo/を実行します(ここ では<tt>/dev/hda4</tt>がFreeBSDのスライスであるものとします). <verb> other=/dev/hda4 table=/dev/hda label=FreeBSD </verb> <!-- If you have installed FreeBSD on the second SCSI drive, use something like this (the FreeBSD slice being <tt>/dev/sdb2</tt>): --> FreeBSD が2番目の SCSI ディスクにインストールされている場合には,以下 のような記述になります(FreeBSD の主パーティションは<tt>/dev/sdb2</tt> と仮定します). <verb> other=/dev/sdb2 table=/dev/sdb loader=/boot/chain.b label=FreeBSD </verb> <sect>ファイルシステムのマウント <!-- Mounting filesystems --> <sect1>Linux で UFS ファイルシステムをマウントする <!-- Mounting UFS filesystems under Linux --> <p> <nidx>FreeBSD dualboot!filesystems, mounting</nidx> <nidx>FreeBSD dualboot!mounting filesystems</nidx> <nidx>FreeBSD dualboot!mounting filesystems!UFS, in Linux</nidx> <!-- Unfortunately the UFS driver in the Linux 2.0.xx kernels do not include support for FreeBSD. When you try to mount a FreeBSD filesystem, you just get some error messages (the filesystem actually gets mounted, but you cannot do anything with it.) This problem has been solved in the newer Linux kernels (version 2.1.87 and higher.) --> 残念ながら,Linux 2.0.xx カーネルの UFS ドライバは FreeBSD をサポートし ていません.FreeBSD の ファイルシステムをマウントしようとしてもエラー メッセージだけが出力されます(実際にはファイルシステムはマウントされて いますが,何もすることができない状態です.)この問題は 新しい Linux カー ネルでは解決されています(バージョン 2.1.87 以降). <!-- There is another version of the UFS driver for Linux 2.0.xx kernels (xx <= 30) on <url url="ftp://metalab.unc.edu/pub/Linux/ALPHA/ufs/" name="metalab.unc.edu (the former sunsite.unc.edu)">. It is called <bf/U2FS/ and the current version is <tt/u2fs-0.4.3.tar.gz/. A version of U2FS (<tt/ufs-0.4.4.tar.gz/) for Linux 2.0.31 and higher (2.0.xx; not 2.1.xx) can be found at <url url="http://www.mathi.uni-heidelberg.de/~flight/projects/u2fs/" name="this site"> along with further information about U2FS (and UFS.) --> Linux 2.0.xx カーネル(xx <= 30)用の別バージョンのドライバを <url url="ftp://metalab.unc.edu/pub/Linux/ALPHA/ufs/" name="metalab.unc.edu (かつての sunsite.unc.edu です)"> で入手することができます.これは <bf/U2FS/ と呼ばれるもので,最新バー ジョンは <tt/u2fs-0.4.3.tar.gz/ です.2.0.31 より新しいバージョン用 (2.1.xx 用ではなく 2.0.xx 用です)の<bf/U2FS/(<tt/ufs-0.4.4.tar.gz/)は <url url="http://www.mathi.uni-heidelberg.de/~flight/projects/u2fs/" name="このサイト">で入手できます.このサイトには他にも U2FS(と UFS)に 関する情報があります. <!-- Now you have to build a new kernel with support for the U2FS filesystem and BSD disklabels. See section <ref id="installlinux" name="Installing and preparing Linux"> for more information on this. You can leave out <bf/UFS filesystem support/ from the kernel when you use U2FS. --> それから,U2FS ファイルシステムとBSD ディスクラベルのサポートを有効に して,新しいカーネルを作成します.詳しくは<ref id="installlinux" name="Linux のインストール">の章を参照してください. <bf/U2FSファイルシステム/ を使う場合には,<bf/UFS ファイルシステムのサ ポート/はカーネルから外しても構いません. <!-- When you have installed the new kernel, you can mount your UFS filesystems (all the partitions in the FreeBSD slice except the swap partition) with a command like this: --> 新しいカーネルをインストールすれば,以下のコマンドで UFS パーティショ ン(スワップパーティションを除く,FreeBSD の全てのパーティション)をマウ ントすることができるようになります. <verb> mount -t u2fs /dev/hda8 /mnt </verb> <!-- You should use a command like --> バージョン 2.1.87 以降の Linux カーネルを使っている場合には, <verb> mount -t ufs /dev/hda8 /mnt </verb> <!-- if you use a Linux kernel version 2.1.87 or higher. From Linux kernel version 2.1.112 you must add <tt/-o ufstype=44bsd/ to the command like this: --> というコマンドを使います.バージョン 2.1.112 以降の Linux カーネルでは 以下に示すように <tt/-o ufstype=44bsd/ をコマンドに追加しなければなり ません: <verb> mount -t ufs -o ufstype=44bsd /dev/hda8 /mnt </verb> <!-- The UFS (and U2FS) driver is read-only. That is; you can read from the UFS filesystems but you cannot write to them. An experimental read-write UFS driver has replaced the read-only driver in Linux kernels version 2.1.112 and higher; writing to FreeBSD partitions is supported from version 2.1.127. --> UFS (および U2FS)ドライバは読み込み専用です.つまり,UFS ファイルシステ ムを読むことはできますが,ここに書き込みはできません.Linux カーネルの バージョン 2.1.112 以降では実験的な読み書き可能なドライバが読み込み専 用ドライバに置き換わっています.バージョン 2.1.127 から FreeBSD パーティ ションへの書き込みがサポートされました. <sect1>FreeBSD で ext2fs ファイルシステムをマウントする<label id="ext2fs"> <!-- Mounting ext2fs filesystems under FreeBSD --> <p> <nidx>FreeBSD dualboot!mounting filesystems!ext2fs, in FreeBSD</nidx> <!-- To mount ext2fs filesystems under FreeBSD, you first have to build a new kernel with ext2fs support. Read <url url="http://www.freebsd.org/handbook/" name="the FreeBSD handbook"> to learn how to do that. Put the line --> FreeBSD で ext2fs ファイルシステムをマウントするには,ext2fs をサポー トしたカーネルを構築しなければなりません.どうやってカーネル再構築を行 うかについては,<url url="http://www.freebsd.org/handbook/" name="FreeBSD ハンドブック"> を参照してください.ext2fs をサポートする には,以下の行を新しいカーネルのカーネルコンフィギュレーションファイル に追加します. <verb> options "EXT2FS" </verb> <!-- in your kernel configuration file for the new kernel. --> <!-- When you have booted with the new kernel, you can mount an ext2fs filesystem by giving a command like: --> 新しいカーネルで起動した後,次のコマンドで ext2fs ファイルシステムをマ ウントすることができます. <verb> mount -t ext2fs /dev/wd0s3 /mnt </verb> <!-- Due to a bug in FreeBSD 2.2.8 and earlier you will have to unmount all ext2fs filesystems <em/before/ you shut down FreeBSD if you are using these any of these versions. If you shut down FreeBSD with an ext2fs filesystem mounted, FreeBSD cannot sync the UFS filesystems. This results in <tt/fsck/ being run the next time FreeBSD is booted. You can work around this bug by putting the line: <verb> umount -a -t ext2fs </verb> in the <tt>/etc/rc.shutdown</tt> file. The bug has been fixed in FreeBSD 3.x. --> 2.2.8 以前の FreeBSD にはバグがあるので,これに該当するバージョンを使ってい る場合には,FreeBSD を<em/シャットダウンする前に/全ての ext2fs ファイ ルシステムをアンマウントしなければなりません.ext2fs ファイルシステム をマウントしたままで FreeBSD をシャットダウンすると,FreeBSD は UFS ファ イルシステムの sync を行うことができません.その結果,次回の FreeBSD の起動時に<tt/fsck/が実行されることになります.このバグは <verb> umount -a -t ext2fs </verb> という行を <tt>/etc/rc.shutdown</tt> ファイルに追加すれば回避できます. このバグは FreeBSD-3.x では直っています. <sect>別 OS のバイナリを実行する <!-- Running foreign binaries --> <sect1>FreeBSD のバイナリを Linux で実行する <!-- Running FreeBSD binaries under Linux --> <p> <nidx>FreeBSD dualboot!foreign binaries</nidx> <nidx>FreeBSD dualboot!foreign binaries!FreeBSD in Linux</nidx> <!-- The <tt/iBCS/ package has support for running FreeBSD binaries under Linux; but it's old and unmaintained. I cannot get it to work. Please let me know if you have had better luck with this. --> <tt/iBCS/ パッケージが Linux 上での FreeBSD バイナリの実行をサポートし ています.しかし,これは古い上にメンテナンスもされていません.筆者は実 行することができませんでした.もし,うまく動かすことができた方がいらっ しゃればぜひ教えてください. <sect1>Linux のバイナリを FreeBSD で実行する <!-- Running Linux binaries under FreeBSD --> <p> <nidx>FreeBSD dualboot!foreign binaries!Linux in FreeBSD</nidx> <!-- FreeBSD has the ability to run Linux binaries, both in a.out and ELF formats. To do this you have to take the following three steps: --> FreeBSD では Linux のバイナリ(a.out, ELF 形式の両方)を実行することがで きます.これを行うためには,以下の3つの手順を行う必要があります. <enum> <item>Linux 互換を有効にします.これを行うには(FreeBSD 2.2.2の場合 --- 他のバージョンでは細かい部分が異なるかもしれません) <tt>/etc/rc.conf</tt>を編集し, <verb> linux_enable="NO" </verb> の部分を <verb> linux_enable="YES" </verb> としてシステムを再起動します.Linux のバイナリサポートを呼び出す別の方 法として,<tt>/usr/bin/linux</tt>コマンドを実行する方法があります.こ ちらの方法なら再起動する必要はありませんし,常に Linux バイナリサポー トをロードしておく必要はありません(つまりメモリを節約できます). 新しい FreeBSD カーネルを構築するならば,FreeBSD のカーネル設定ファイ ルに <verb> options COMPAT_LINUX </verb> という行を追加するのを忘れないでください. <item>Linux バイナリにライブラリがダイナミックリンクされている場合には, Linux の共有ライブラリをインストールする必要があります.これは, FreeBSD 2.2.{2, 5, 6} では<tt/linux_lib-2.4.tgz/パッ ケージとして入っています(新しいバージョンが入手可能かもしれません).パッ ケージをインストールするには,次のコマンドを実行します. <verb> pkg_add <path_to_package>/linux_lib-2.4.tgz </verb> <path_to_package> はパッケージが置かれているディレ クトリです. <verb> pkg_add ftp://ftp.freebsd.org/pub/FreeBSD/packages-stable/All/linux_lib-2.4.tgz </verb> を実行するか <tt>/stand/sysinstall</tt> を再実行することでネットワーク からインストールすることもできます.``Configure'', ``Packages'' を入力 して,メニューを使います.スタティックリンクされた Linux のバイナリを 実行する場合には,以下のコマンドで実行します. <verb> brandelf -t Linux <スタティックリンクされたLinuxのバイナリの名前> </verb> <item>実行したい Linux のプログラムをインストールします.インストール 先は ext2fs ファイルシステムでも UFS ファイルシステムでも構いません. FreeBSD での ext2fs ファイルシステムの利用については,<ref id="ext2fs" name="FreeBSD で ext2fs ファイルシステムをマウントする">の章を参照して ください. </enum> <!-- I have successfully run the Linux versions of Applixware 4.3 and Netscape 3.01 (both ELF format) under FreeBSD 2.2.2 using this method (yes, I know there is a native FreeBSD version of Netscape 4.) The Linux versions of acroread and StarOffice 3 and 4 also work well under FreeBSD. StarOffice 5 depends on native Linux threads and currently do not work under FreeBSD. Read the FreeBSD documentation for more information on this topic. --> 筆者はこの方法で Linux 版の Applixware 4.3 と Netscape 3.01 (どちらも ELF 形式)を FreeBSD 2.2.2 上で実行させることに成功しました.(もちろん, FreeBSD 用の Netscape 4 があることは知っています.) Linux 用の acroread と StarOffice 3, 4 も FreeBSD 上で動作しました.StarOffice 5 は Linux のネイティブスレッドに依存しており,現在は FreeBSD 上では動作 しません.この話題についての詳細な情報については,FreeBSD の関連ドキュ メントを参照してください. <sect>情報源 <!-- Information resources --> <p> <nidx>FreeBSD dualboot!information resources</nidx> <!-- The latest version of this mini-HOWTO can be downloaded from <url url="http://www.image.dk/~nkbj/" name="this site"> in several formats (including SGML and PostScript.) The document has been translated into Japanese by Mr. Teruyoshi Fujiwara as part of <url url="ftp://jf.linux.or.jp/pub/JF/other-formats/" name="the JF project">. --> この mini-HOWTO 文書の最新版(SGML や PostScript 形式を含みます)は<url url="http://www.image.dk/~nkbj/" name="このサイト">にあります.また, 本文書は <url url="http://www.linux.or.jp/JF/" name="JF プロジェクト"> の一環として,藤原輝嘉が日本語に翻訳しています. <!-- You can find some articles about the difference between Linux and FreeBSD <url url="http://www.futuresouth.com/~fullermd/freebsd/bsdvlin.html" name="here">. --> <url url="http://www.futuresouth.com/~fullermd/freebsd/bsdvlin.html" name="こちら">には,Linux と FreeBSD の違いに関する記事がいくつかあり ます. <!-- You can find more informations about FreeBSD (and download the whole system) at <url url="http://www.freebsd.org/" name="this site">. You can also buy the system on CDROMs from <url url="http://www.cdrom.com" name="Walnut Creek CDROM"> (their servers are running FreeBSD.) --> FreeBSD に関する詳しい情報は <url url="http://www.freebsd.org/" name="このサイト">で入手することが できます(FreeBSD のシステム全部を入手することもできます).また, <url url="http://www.cdrom.com" name="Walnut Creek CDROM">からシステム の CD-ROM を購入することもできます(ここのサーバは FreeBSD で稼働してい ます). <!-- The Linux Kernel HOWTO (and this mini-HOWTO) is released as part of <url url="http://www.linuxdoc.org/" name="The Linux Documentation Project">. --> The Linux Kernel HOWTO (およびこの mini-HOWTO)は <url url="http://www.linuxdoc.org/" name="The Linux Documentation Project"> の一環としてリリースされています. <sect>クレジットと法的事項 <!-- Credits and legal stuff --> <p> <nidx>FreeBSD dualboot!credits and legal stuff</nidx> <!-- Thanks to the members of the <url url="http://www.bsd-dk.dk/" name="*BSD user group in Denmark"> for answering the questions of a FreeBSD newbie, to Mr. Takeshi Okazaki for bringing the existence of U2FS to my attention, and to Mr. David O'Brien for valuable suggestions. --> 新米 FreeBSD ユーザの質問に答えてくださった <url url="http://www.bsd-dk.dk/" name="デンマーク *BSD ユーザーグループ"> の皆さんと,U2FS があることを教えてくださった Takeshi Okazaki 氏,貴重 な提案をしてくださった David O'Brien 氏に感謝します. <sect1>法的事項 <!-- Legal stuff --> <p> <em/訳注/: 著作権表示については,訳も一応挙げておきますがあくまで参考です. 正式には原文のライセンスに従ってください. <p> Trademarks are owned by their owners. Although the information given in this document is believed to be correct, the author will accept no liability for the content of this document. Use the tips and examples given herein at your own risk. <p> (登録商標はそれぞれの権利者が所有しています. 本文書に記載された情報は正しいものであると考えていますが,著者は本文書 の内容に関する責任は一切負いません.ここで述べているテクニックや例は読 者自身の責任において使用してください.) Copyright © 1997-2000 by Niels Kristian Bech Jensen. This document may be distributed only subject to the terms and conditions set forth in the LDP License at <url url="http://www.linuxdoc.org/COPYRIGHT.html" name="http://www.linuxdoc.org/COPYRIGHT.html">. <p> (本文書は <url url="http://www.linuxdoc.org/COPYRIGHT.html" name="http://www.linuxdoc.org/COPYRIGHT.html"> の条項および条件に基づいてのみ配布することができます.) <sect>日本語訳について <p> 日本語訳は Linux Japanese FAQ Project が行いました. 翻訳に関するご意見は JF プロジェクト <JF@linux.or.jp> 宛に連絡してください. 改訂履歴を以下に示します. <descrip> <tag>v1.0, 5 September 1997 - v1.10, 15 January 1999</tag> 翻訳: 藤原輝嘉 <fujiwara@linux.or.jp> 訳語統一: 長谷川靖 <yaz-hase@qb3.so-net.ne.jp> <tag>v1.11, 30 March 2000</tag> 翻訳: 藤原輝嘉 <fujiwara@linux.or.jp> </descrip> </article>