]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - share/man/man4/md.4
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / share / man / man4 / md.4
1 .\" ----------------------------------------------------------------------------
2 .\" "THE BEER-WARE LICENSE" (Revision 42):
3 .\" <phk@FreeBSD.org> wrote this file.  As long as you retain this notice you
4 .\" can do whatever you want with this stuff. If we meet some day, and you think
5 .\" this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
6 .\" ----------------------------------------------------------------------------
7 .\"
8 .\" $FreeBSD$
9 .\"
10 .Dd October 30, 2007
11 .Dt MD 4
12 .Os
13 .Sh NAME
14 .Nm md
15 .Nd memory disk
16 .Sh SYNOPSIS
17 .Cd device md
18 .Sh DESCRIPTION
19 The
20 .Nm
21 driver provides support for four kinds of memory backed virtual disks:
22 .Bl -tag -width preload
23 .It Cm malloc
24 Backing store is allocated using
25 .Xr malloc 9 .
26 Only one malloc-bucket is used, which means that all
27 .Nm
28 devices with
29 .Cm malloc
30 backing must share the malloc-per-bucket-quota.
31 The exact size of this quota varies, in particular with the amount
32 of RAM in the
33 system.
34 The exact value can be determined with
35 .Xr vmstat 8 .
36 .It Cm preload
37 A file loaded by
38 .Xr loader 8
39 with type
40 .Sq md_image
41 is used for backing store.
42 For backwards compatibility the type
43 .Sq mfs_root
44 is also recognized.
45 If the kernel is created with option
46 .Dv MD_ROOT
47 the first preloaded image found will become the root file system.
48 .It Cm vnode
49 A regular file is used as backing store.
50 This allows for mounting ISO images without the tedious
51 detour over actual physical media.
52 .It Cm swap
53 Backing store is allocated from buffer memory.
54 Pages get pushed out to the swap when the system is under memory
55 pressure, otherwise they stay in the operating memory.
56 Using
57 .Cm swap
58 backing is generally preferable over
59 .Cm malloc
60 backing.
61 .El
62 .Pp
63 For more information, please see
64 .Xr mdconfig 8 .
65 .Sh EXAMPLES
66 To create a kernel with a ramdisk or MD file system, your kernel config
67 needs the following options:
68 .Bd -literal -offset indent
69 options         MD_ROOT                 # MD is a potential root device
70 options         MD_ROOT_SIZE=8192       # 8MB ram disk
71 makeoptions     MFS_IMAGE=/h/foo/ARM-MD
72 options         ROOTDEVNAME=\\"ufs:md0\\"
73 .Ed
74 .Pp
75 The image in
76 .Pa /h/foo/ARM-MD
77 will be loaded as the initial image each boot.
78 To create the image to use, please follow the steps to create a file-backed
79 disk found in the
80 .Xr mdconfig 8
81 man page.
82 Other tools will also create these images, such as NanoBSD.
83 .Sh SEE ALSO
84 .Xr disklabel 8 ,
85 .Xr fdisk 8 ,
86 .Xr loader 8 ,
87 .Xr mdconfig 8 ,
88 .Xr mdmfs 8 ,
89 .Xr newfs 8 ,
90 .Xr vmstat 8
91 .Sh HISTORY
92 The
93 .Nm
94 driver first appeared in
95 .Fx 4.0
96 as a cleaner replacement
97 for the MFS functionality previously used in
98 .Tn PicoBSD
99 and in the
100 .Fx
101 installation process.
102 .Pp
103 The
104 .Nm
105 driver did a hostile takeover of the
106 .Xr vn 4
107 driver in
108 .Fx 5.0 .
109 .Sh AUTHORS
110 The
111 .Nm
112 driver was written by
113 .An Poul-Henning Kamp
114 .Aq phk@FreeBSD.org .