.\" Copyright (c) 1993 University of Utah. .\" Copyright (c) 1980, 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" Copyright (c) 2000 .\" Poul-Henning Kamp All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the Systems Programming Group of the University of Utah Computer .\" Science Department. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)vnconfig.8 8.1 (Berkeley) 6/5/93 .\" from: src/usr.sbin/vnconfig/vnconfig.8,v 1.19 2000/12/27 15:30:29 .\" .\" %FreeBSD: src/sbin/mdconfig/mdconfig.8,v 1.29 2004/07/02 21:45:03 ru Exp % .\" .\" $FreeBSD$ .Dd March 10, 2004 .Dt MDCONFIG 8 .Os .Sh 名称 .Nm mdconfig .Nd メモリディスクの設定と有効化 .Sh 書式 .Nm .Fl a .Fl t Ar type .Op Fl n .Oo Fl o Oo Cm no Oc Ns Ar option Oc ... .Op Fl f Ar file .Op Fl s Ar size .Op Fl S Ar sectorsize .Op Fl u Ar unit .Op Fl x Ar sectors/track .Op Fl y Ar heads/cyl .Nm .Fl d .Fl u Ar unit .Nm .Fl l .Op Fl n .Op Fl u Ar unit .Sh 解説 .Nm ユーティリティは .Xr md 4 デバイスを設定して有効化します。 .Pp 以下のオプションは実行されるべき行動を示します: .Bl -tag -width indent .It Fl a メモリディスクをアタッチします。 これは与えられたパラメータでメモリディスクを設定し、 それをシステムにアタッチします。 .It Fl d メモリディスクをシステムからデタッチし、すべてのリソースを開放します。 .It Fl t Ar type メモリディスクの型を選択します。 .Bl -tag -width "preload" .It Cm malloc この型のメモリディスクの記憶領域は、 .Xr malloc 9 によって割り当てられます。 これはサイズをカーネル内での malloc の大きさ制限に制限します。 .Fl o Cm reserve オプションが設定されていなければ、 malloc に裏打ちされる大きなメモリディスクを作成して埋め尽くすことで、 いとも簡単にシステムはパニックしてしまいます。 .It Cm vnode .Fl f Ar file によって指定されたファイルがメモリディスクのための バッキングストアになります。 .It Cm swap スワップ領域がこのメモリディスクを裏打ちします。 .El .It Fl f Ar file vnode 型のメモリディスクのために使用されるファイル名です。 .It Fl l 設定された .Xr md 4 デバイスについてのリスト情報です。 これと関連して .Fl u オプションが使用された場合には、出力は指定されたデバイスについての 情報に制限されます。 .It Fl n md デバイス名を表示する場合、md を付けずにユニット番号だけを表示します。 .It Fl s Ar size メモリディスクのサイズです。 .Ar size はそれぞれキロバイト、メガバイト、ギガバイトを表す、 .Cm k , m , .Cm g のいずれかがサフィックスとして付いていない場合には 512 バイトセクタの数です。 .It Fl S Ar sectorsize malloc に裏打ちされるデバイスのために使用されるブロックサイズです。 .It Fl x Ar sectors/track 下記の .Fl y オプションの説明を見て下さい。 .It Fl y Ar heads/cyl .Fl x と .Fl y オプションは、 .Cm malloc または .Cm vnode に裏打ちされたデバイスに対して、 人工的なジオメトリを指定するのに使います。 これは後で他のデバイスにダウンロードするブート可能なイメージを作成するのに 有用です。 .It Fl o Oo Cm no Oc Ns Ar option オプションの設定または解除をします。 .Bl -tag -width indent .It Oo Cm no Oc Ns Cm async .Cm vnode に裏打ちされたデバイス用です。 .Dv IO_SYNC をさけることで、パフォーマンスは向上しますが、 カーネル全体がデッドロックしてしまう危険があります。 .It Oo Cm no Oc Ns Cm reserve 必要なときにではなく、最初から必要な記憶領域の全てを割り当てて予約します。 .It Oo Cm no Oc Ns Cm cluster ディスクのクラスタリングを有効化します。 .It Oo Cm no Oc Ns Cm compress メモリ使用量の削減のため、圧縮機能を有効化/無効化します。 .It Oo Cm no Oc Ns Cm force ユーザがシステムに悪い影響を与えるかもしれないことを避けるために、 追加の整合性チェックを無効化/有効化します。 .It Oo Cm no Oc Ns Cm readonly 読出し専用モードを有効化/無効化します。 .El .It Fl u Ar unit 自動割当の代わりに .Xr md 4 デバイスのユニット番号の指定を要求します。 .El .Sh 使用例 .Xr malloc 9 で割り当てられたメモリに裏打ちされた 4 メガバイトのメモリディスクを作成します。 割り当てられたユニットは .Dq Li md3 のように標準出力に出力されます: .Pp .Dl mdconfig -a -t malloc -s 4m .Pp .Pa /tmp/boot.flp に裏打ちされた .Pa /dev/md4 という名前のディスクとして作成するには: .Pp .Dl mdconfig -a -t vnode -f /tmp/boot.flp -u 4 .Pp デタッチして .Pa /dev/md4 によって使用されているすべてのリソースを開放するには: .Pp .Dl mdconfig -d -u 4 .Pp 128MB のスワップに裏打ちされたファイルシステムを作成し .Pa /tmp にマウントするには: .Bd -literal -offset indent mdconfig -a -t swap -s 128M -u 10 newfs -U /dev/md10 mount /dev/md10 /tmp chmod 1777 /tmp .Ed .Pp 5MB のファイルに裏打ちされたディスクを作成するためには: .Bd -literal -offset indent dd if=/dev/zero of=somebackingfile bs=1k count=5k mdconfig -a -t vnode -f somebackingfile -u 0 bsdlabel -w md0 auto newfs md0c mount /dev/md0c /mnt .Ed .Sh 関連項目 .Xr md 4 , .Xr bsdlabel 8 , .Xr fdisk 8 , .Xr mdmfs 8 , .Xr malloc 9 .Sh 歴史 .Nm ユーティリティは .Xr vn 4 および .Xr vnconfig 8 の組み合わせの、よりきれいな置き換えとして、 .Fx 5.0 ではじめて登場しました。 .Sh 作者 .Nm ユーティリティは .An Poul-Henning Kamp .Aq phk@FreeBSD.org が書きました。