Add a manual page describing the LSI Fusion family of devices with a
[dragonfly.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: src/share/man/man4/md.4,v 1.3.2.4 2001/06/18 22:00:12 dd Exp $
9 .\" $DragonFly: src/share/man/man4/md.4,v 1.2 2003/06/17 04:36:59 dillon Exp $
10 .\"
11 .Dd July 4, 2000
12 .Dt MD 4
13 .Os
14 .Sh NAME
15 .Nm md
16 .Nd memory disk
17 .Sh SYNOPSIS
18 .Cd device md
19 .Pp
20 To specify the default maximum size of
21 .Xr malloc 9
22 backed disks:
23 .Cd options MD_NSECT=20000
24 .Sh DESCRIPTION
25 The
26 .Nm
27 driver provides support for two kinds of memory backed virtual disks:
28 .Xr malloc 9
29 backed
30 and pre-loaded module backed.
31 .Pp
32 The
33 .Xr malloc 9
34 backed
35 disks
36 are severely limited in size by constraints imposed by
37 .Xr malloc 9 .
38 Specifically, only one malloc bucket is used, which means that all
39 .Nm
40 devices with
41 .Xr malloc 9
42 backing must share the malloc per-bucket quota.
43 The exact size of this quota varies,
44 in particuar with the amount of RAM in the system.
45 The exact value can be determined with
46 .Xr vmstat 8 .
47 .Pp
48 A sector filled with identical bytes does not consume storage,
49 and therefore the storage allocated by a
50 .Nm
51 disk can be freed with a command such as this:
52 .Bd -literal -offset indent
53 dd if=/dev/zero of=/dev/md567
54 .Ed
55 .Pp
56 The default maximum size of a
57 .Nm
58 disk
59 backed by
60 .Xr malloc 9
61 is 20,000 sectors of 512 bytes each.
62 This can be changed
63 with the kernel option
64 .Dv MD_NSECT .
65 .Pp
66 At boot time the
67 .Nm
68 driver will search for pre-loaded modules of type
69 .Sq md_image
70 and instantiate a
71 .Nm
72 device for each of these modules.
73 The type
74 .Sq mfs_root
75 is also allowed for backward compatibility.
76 These devices are backed by the RAM reserved by the
77 .Xr loader 8 ,
78 and as such not limited by the
79 .Xr malloc 9
80 size constraints.
81 However, this also means that the storage cannot be released.
82 For the same reason,
83 the
84 .Dq identical byte
85 detection is not applicable.
86 .Pp
87 The
88 .Nm
89 driver uses the
90 .Dq almost-clone
91 convention,
92 whereby opening device number N creates device instance number N+1.
93 .Pp
94 The
95 .Xr vmstat 8
96 utility can be used to monitor memory usage by
97 .Xr malloc 9
98 backed
99 .Nm
100 disks,
101 but not those backed by pre-loaded modules.
102 .Sh EXAMPLES
103 To mount a
104 .Xr malloc 9
105 backed
106 .Nm
107 device on
108 .Pa /tmp :
109 .Bd -literal
110 if [ -e /dev/md0 -a -e /dev/md0c ]; then
111         disklabel -r -w md0 auto && \\
112         newfs /dev/md0c && \\
113         mount /dev/md0c /tmp && \\
114         chmod 1777 /tmp
115 fi
116 .Ed
117 .Sh SEE ALSO
118 .Xr disklabel 5 ,
119 .Xr disklabel 8 ,
120 .Xr fdisk 8 ,
121 .Xr loader 8 ,
122 .Xr newfs 8 ,
123 .Xr vmstat 8
124 .Sh HISTORY
125 The
126 .Nm
127 driver first appeared in
128 .Fx 4.0
129 as a cleaner replacement
130 for the MFS functionality previously used in PicoBSD
131 and in the
132 .Fx
133 installation process.
134 .Sh AUTHORS
135 The
136 .Nm
137 driver was written by
138 .An Poul-Henning Kamp
139 .Aq phk@FreeBSD.org .