xref: /freebsd/sbin/mdconfig/mdconfig.8 (revision e461c7bc7dde5dc84dc9e04cb623c6f567bfe6e5)
1c2ef0b73SPoul-Henning Kamp.\" Copyright (c) 1993 University of Utah.
2c2ef0b73SPoul-Henning Kamp.\" Copyright (c) 1980, 1989, 1991, 1993
3c2ef0b73SPoul-Henning Kamp.\"	The Regents of the University of California.  All rights reserved.
4c2ef0b73SPoul-Henning Kamp.\" Copyright (c) 2000
5c2ef0b73SPoul-Henning Kamp.\"	Poul-Henning Kamp  All rights reserved.
6c2ef0b73SPoul-Henning Kamp.\"
7c2ef0b73SPoul-Henning Kamp.\" This code is derived from software contributed to Berkeley by
8c2ef0b73SPoul-Henning Kamp.\" the Systems Programming Group of the University of Utah Computer
9c2ef0b73SPoul-Henning Kamp.\" Science Department.
10c2ef0b73SPoul-Henning Kamp.\"
11c2ef0b73SPoul-Henning Kamp.\" Redistribution and use in source and binary forms, with or without
12c2ef0b73SPoul-Henning Kamp.\" modification, are permitted provided that the following conditions
13c2ef0b73SPoul-Henning Kamp.\" are met:
14c2ef0b73SPoul-Henning Kamp.\" 1. Redistributions of source code must retain the above copyright
15c2ef0b73SPoul-Henning Kamp.\"    notice, this list of conditions and the following disclaimer.
16c2ef0b73SPoul-Henning Kamp.\" 2. Redistributions in binary form must reproduce the above copyright
17c2ef0b73SPoul-Henning Kamp.\"    notice, this list of conditions and the following disclaimer in the
18c2ef0b73SPoul-Henning Kamp.\"    documentation and/or other materials provided with the distribution.
19dda5b397SEitan Adler.\" 3. Neither the name of the University nor the names of its contributors
20c2ef0b73SPoul-Henning Kamp.\"    may be used to endorse or promote products derived from this software
21c2ef0b73SPoul-Henning Kamp.\"    without specific prior written permission.
22c2ef0b73SPoul-Henning Kamp.\"
23c2ef0b73SPoul-Henning Kamp.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24c2ef0b73SPoul-Henning Kamp.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25c2ef0b73SPoul-Henning Kamp.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26c2ef0b73SPoul-Henning Kamp.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27c2ef0b73SPoul-Henning Kamp.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28c2ef0b73SPoul-Henning Kamp.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29c2ef0b73SPoul-Henning Kamp.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30c2ef0b73SPoul-Henning Kamp.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31c2ef0b73SPoul-Henning Kamp.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32c2ef0b73SPoul-Henning Kamp.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33c2ef0b73SPoul-Henning Kamp.\" SUCH DAMAGE.
34c2ef0b73SPoul-Henning Kamp.\" from: src/usr.sbin/vnconfig/vnconfig.8,v 1.19 2000/12/27 15:30:29
35c2ef0b73SPoul-Henning Kamp.\"
36*e461c7bcSAlan Somers.Dd June 1, 2024
37c2ef0b73SPoul-Henning Kamp.Dt MDCONFIG 8
389fe48c6eSRuslan Ermilov.Os
39c2ef0b73SPoul-Henning Kamp.Sh NAME
40c2ef0b73SPoul-Henning Kamp.Nm mdconfig
416be30a30SEdward Tomasz Napierala.Nd create and control memory disks
42c2ef0b73SPoul-Henning Kamp.Sh SYNOPSIS
43c2ef0b73SPoul-Henning Kamp.Nm
44c2ef0b73SPoul-Henning Kamp.Fl a
45c2ef0b73SPoul-Henning Kamp.Fl t Ar type
46f79c46d3SRobert Watson.Op Fl n
47d04b5dfeSRuslan Ermilov.Oo Fl o Oo Cm no Oc Ns Ar option Oc ...
48c2ef0b73SPoul-Henning Kamp.Op Fl f Ar file
49d04b5dfeSRuslan Ermilov.Op Fl s Ar size
50ebe789d6SPoul-Henning Kamp.Op Fl S Ar sectorsize
51c2ef0b73SPoul-Henning Kamp.Op Fl u Ar unit
52076cb6a8SPoul-Henning Kamp.Op Fl x Ar sectors/track
53db280204SJoel Dahl.Op Fl y Ar heads/cylinder
54f7ca2bbeSMaxim Sobolev.Op Fl L Ar label
55c2ef0b73SPoul-Henning Kamp.Nm
56c2ef0b73SPoul-Henning Kamp.Fl d
57c2ef0b73SPoul-Henning Kamp.Fl u Ar unit
58a9ebb311SEdward Tomasz Napierala.Op Fl o Oo Cm no Oc Ns Ar force
59174b5e9aSPoul-Henning Kamp.Nm
60dc604f0cSEdward Tomasz Napierala.Fl r
61dc604f0cSEdward Tomasz Napierala.Fl u Ar unit
62dc604f0cSEdward Tomasz Napierala.Fl s Ar size
63dc604f0cSEdward Tomasz Napierala.Op Fl o Oo Cm no Oc Ns Ar force
64dc604f0cSEdward Tomasz Napierala.Nm
65174b5e9aSPoul-Henning Kamp.Fl l
66f79c46d3SRobert Watson.Op Fl n
67c94b8307SDmitry Morozovsky.Op Fl v
68b78ae23fSHiroki Sato.Op Fl f Ar file
69174b5e9aSPoul-Henning Kamp.Op Fl u Ar unit
706c49c6cfSDag-Erling Smørgrav.Nm
716c49c6cfSDag-Erling Smørgrav.Ar file
72c2ef0b73SPoul-Henning Kamp.Sh DESCRIPTION
73c2ef0b73SPoul-Henning KampThe
74c2ef0b73SPoul-Henning Kamp.Nm
756be30a30SEdward Tomasz Napieralautility creates and controls
76739cdd4bSRuslan Ermilov.Xr md 4
77c2ef0b73SPoul-Henning Kampdevices.
78c2ef0b73SPoul-Henning Kamp.Pp
79c2ef0b73SPoul-Henning KampOptions indicate an action to be performed:
80c2ef0b73SPoul-Henning Kamp.Bl -tag -width indent
81c2ef0b73SPoul-Henning Kamp.It Fl a
82739cdd4bSRuslan ErmilovAttach a memory disk.
83739cdd4bSRuslan ErmilovThis will configure and attach a memory disk with the
84c2ef0b73SPoul-Henning Kampparameters specified and attach it to the system.
858cde1e8aSJohn-Mark GurneyIf the
868cde1e8aSJohn-Mark Gurney.Fl u Ar unit
878cde1e8aSJohn-Mark Gurneyoption is not provided, the newly created device name will be printed on stdout.
88c2ef0b73SPoul-Henning Kamp.It Fl d
89739cdd4bSRuslan ErmilovDetach a memory disk from the system and release all resources.
90dc604f0cSEdward Tomasz Napierala.It Fl r
91dc604f0cSEdward Tomasz NapieralaResize a memory disk.
92739cdd4bSRuslan Ermilov.It Fl t Ar type
93c2ef0b73SPoul-Henning KampSelect the type of the memory disk.
94ac5b109fSBenjamin Kaduk.Bl -tag -width "malloc"
95739cdd4bSRuslan Ermilov.It Cm malloc
96c2ef0b73SPoul-Henning KampStorage for this type of memory disk is allocated with
97c2ef0b73SPoul-Henning Kamp.Xr malloc 9 .
98c2ef0b73SPoul-Henning KampThis limits the size to the malloc bucket limit in the kernel.
99b4bca2d5SPoul-Henning KampIf the
100b4bca2d5SPoul-Henning Kamp.Fl o Cm reserve
101b4bca2d5SPoul-Henning Kampoption is not set, creating and filling a large
102b4bca2d5SPoul-Henning Kampmalloc-backed memory disk is a very easy way to
1036be30a30SEdward Tomasz Napieralapanic the system.
104739cdd4bSRuslan Ermilov.It Cm vnode
105c2ef0b73SPoul-Henning KampA file specified with
106c2ef0b73SPoul-Henning Kamp.Fl f Ar file
107c2ef0b73SPoul-Henning Kampbecomes the backing store for this memory disk.
108739cdd4bSRuslan Ermilov.It Cm swap
109d18e0134SRemko LodderStorage for this type of memory disk is allocated from buffer
1103655c14dSRemko Loddermemory.
111ac5b109fSBenjamin KadukPages get pushed out to swap when the system is under memory
1123655c14dSRemko Lodderpressure, otherwise they stay in the operating memory.
1133655c14dSRemko LodderUsing
114d18e0134SRemko Lodder.Cm swap
115ac5b109fSBenjamin Kadukbacking is generally preferred instead of using
116d18e0134SRemko Lodder.Cm malloc
117d18e0134SRemko Lodderbacking.
1180efd9bfdSEdward Tomasz Napierala.It Cm null
1190efd9bfdSEdward Tomasz NapieralaBitsink; all writes do nothing, all reads return zeroes.
120c2ef0b73SPoul-Henning Kamp.El
121c2ef0b73SPoul-Henning Kamp.It Fl f Ar file
122ac5b109fSBenjamin KadukFilename to use for the vnode type memory disk.
123ac5b109fSBenjamin KadukThe
12435ce0ff2SNick Hibma.Fl a
12535ce0ff2SNick Hibmaand
1268bd4b3f9SMateusz Piotrowski.Fl t Cm vnode
127ac5b109fSBenjamin Kadukoptions are implied if not specified.
128174b5e9aSPoul-Henning Kamp.It Fl l
129df5f8fa7SDima DorfmanList configured devices.
130e08f2053SDima DorfmanIf given with
131e08f2053SDima Dorfman.Fl u ,
132e08f2053SDima Dorfmandisplay details about that particular device.
133b78ae23fSHiroki SatoIf given with
134b78ae23fSHiroki Sato.Fl f Ar file ,
135b78ae23fSHiroki Satodisplay
136b78ae23fSHiroki Sato.Xr md 4
137b78ae23fSHiroki Satodevice names of which
138b78ae23fSHiroki Sato.Ar file
139b78ae23fSHiroki Satois used as the backing store.
140b78ae23fSHiroki SatoIf both of
141b78ae23fSHiroki Sato.Fl u
142b78ae23fSHiroki Satoand
143b78ae23fSHiroki Sato.Fl f
144b78ae23fSHiroki Satooptions are specified,
145b78ae23fSHiroki Satodisplay devices which match the two conditions.
146ac5b109fSBenjamin KadukIf the
147c94b8307SDmitry Morozovsky.Fl v
148ac5b109fSBenjamin Kadukoption is specified, show all details.
149f79c46d3SRobert Watson.It Fl n
150ac5b109fSBenjamin KadukWhen printing
151ac5b109fSBenjamin Kaduk.Xr md 4
152ac5b109fSBenjamin Kadukdevice names, print only the unit number without the
153ac5b109fSBenjamin Kaduk.Xr md 4
154ac5b109fSBenjamin Kadukprefix.
155c2ef0b73SPoul-Henning Kamp.It Fl s Ar size
156c2ef0b73SPoul-Henning KampSize of the memory disk.
157c2ef0b73SPoul-Henning Kamp.Ar Size
15891f9647dSPoul-Henning Kampis the number of 512 byte sectors unless suffixed with a
159d5b0fb47SEdward Tomasz Napierala.Cm b , k , m , g , t ,
160739cdd4bSRuslan Ermilovor
161d5b0fb47SEdward Tomasz Napierala.Cm p
162739cdd4bSRuslan Ermilovwhich
163d5b0fb47SEdward Tomasz Napieraladenotes byte, kilobyte, megabyte, gigabyte, terabyte and petabyte respectively.
1646be30a30SEdward Tomasz NapieralaWhen used without the
1656be30a30SEdward Tomasz Napierala.Fl r
1666be30a30SEdward Tomasz Napieralaoption, the
16735ce0ff2SNick Hibma.Fl a
16835ce0ff2SNick Hibmaand
1698bd4b3f9SMateusz Piotrowski.Fl t Cm swap
170ac5b109fSBenjamin Kadukoptions are implied if not specified.
171ebe789d6SPoul-Henning Kamp.It Fl S Ar sectorsize
172b45c4eb9SGavin AtkinsonSectorsize to use for the memory disk, in bytes.
173076cb6a8SPoul-Henning Kamp.It Fl x Ar sectors/track
174d04b5dfeSRuslan ErmilovSee the description of the
175076cb6a8SPoul-Henning Kamp.Fl y
176d04b5dfeSRuslan Ermilovoption below.
177076cb6a8SPoul-Henning Kamp.It Fl y Ar heads/cylinder
178d04b5dfeSRuslan ErmilovFor
179d04b5dfeSRuslan Ermilov.Cm malloc
180d04b5dfeSRuslan Ermilovor
181d04b5dfeSRuslan Ermilov.Cm vnode
182d04b5dfeSRuslan Ermilovbacked devices, the
183076cb6a8SPoul-Henning Kamp.Fl x
184076cb6a8SPoul-Henning Kampand
185076cb6a8SPoul-Henning Kamp.Fl y
186076cb6a8SPoul-Henning Kampoptions can be used to specify a synthetic geometry.
187076cb6a8SPoul-Henning KampThis is useful for constructing bootable images for later download to
188076cb6a8SPoul-Henning Kampother devices.
189f7ca2bbeSMaxim Sobolev.It Fl L Ar label
190f7ca2bbeSMaxim SobolevAssociate a label (arbitrary string) with the new memory disk.
191f7ca2bbeSMaxim SobolevThe label can then be inspected with
192f7ca2bbeSMaxim Sobolev.Bd -literal -offset indent
193f7ca2bbeSMaxim Sobolev.Nm Fl l v
194f7ca2bbeSMaxim Sobolev.Ed
195b8758111SRuslan Ermilov.It Fl o Oo Cm no Oc Ns Ar option
196c2ef0b73SPoul-Henning KampSet or reset options.
197c2ef0b73SPoul-Henning Kamp.Bl -tag -width indent
1987a6b2b64SPoul-Henning Kamp.It Oo Cm no Oc Ns Cm async
199d04b5dfeSRuslan ErmilovFor
200d04b5dfeSRuslan Ermilov.Cm vnode
201d04b5dfeSRuslan Ermilovbacked devices: avoid
202d04b5dfeSRuslan Ermilov.Dv IO_SYNC
203d04b5dfeSRuslan Ermilovfor increased performance but
2047a6b2b64SPoul-Henning Kampat the risk of deadlocking the entire kernel.
2059e5ed859SBruce Evans.It Oo Cm no Oc Ns Cm cache
2069e5ed859SBruce EvansFor
2079e5ed859SBruce Evans.Cm vnode
2089e5ed859SBruce Evansbacked devices: enable/disable caching of data in system caches.
2099e5ed859SBruce EvansThe default is to not cache.
2109e5ed859SBruce Evans.Pp
2119e5ed859SBruce EvansAccesses via the device are converted to accesses via the vnode.
2129e5ed859SBruce EvansThe caching policy for the vnode is used initially.
2139e5ed859SBruce EvansThis is normally to cache.
2149e5ed859SBruce EvansThis caching policy is retained if the
2159e5ed859SBruce Evans.Cm cache
2169e5ed859SBruce Evansoption is used.
2179e5ed859SBruce EvansOtherwise, caching is limited
2189e5ed859SBruce Evansby releasing data from caches soon after each access.
2199e5ed859SBruce EvansThe release has the same semantics as the
2209e5ed859SBruce Evans.Dv POSIX_FADV_DONTNEED
2219e5ed859SBruce Evansfeature of
2229e5ed859SBruce Evans.Xr posix_fadvise 2 .
2239e5ed859SBruce EvansThe result is that with normal (non-zfs) caching,
2249e5ed859SBruce Evansbuffers are released from the buffer cache soon after they are constructed,
2259e5ed859SBruce Evansbut their data is kept in the page cache at lower priority.
2269e5ed859SBruce Evans.Pp
2279e5ed859SBruce EvansThe
2289e5ed859SBruce Evans.Cm cache
2299e5ed859SBruce Evansoption tends to waste memory by giving unwanted double caching,
2309e5ed859SBruce Evansbut it saves time if there is memory to spare.
231b8758111SRuslan Ermilov.It Oo Cm no Oc Ns Cm reserve
232c2ef0b73SPoul-Henning KampAllocate and reserve all needed storage from the start, rather than as needed.
233b8758111SRuslan Ermilov.It Oo Cm no Oc Ns Cm compress
234ac5b109fSBenjamin KadukEnable/disable compression features to reduce memory usage.
235b8758111SRuslan Ermilov.It Oo Cm no Oc Ns Cm force
236ac5b109fSBenjamin KadukDisable/enable extra sanity checks to prevent the user from doing something
23726a0ee75SDima Dorfmanthat might adversely affect the system.
2386be30a30SEdward Tomasz NapieralaThis can be used with the
2393bb60789SEdward Tomasz Napierala.Fl d
2406be30a30SEdward Tomasz Napieralaflag to forcibly destroy an
2416be30a30SEdward Tomasz Napierala.Xr md 4
2426be30a30SEdward Tomasz Napieraladisk that is still in use.
2433703c188SKa Ho Ng.It Oo Cm no Oc Ns Cm mustdealloc
2443703c188SKa Ho NgFor
2453703c188SKa Ho Ng.Cm vnode
2463703c188SKa Ho Ngbacked devices: detect whether hole-punching is supported by the underlying file
2473703c188SKa Ho Ngsystem.
2483703c188SKa Ho NgIf the file system supports hole-punching, then to handle a
2493703c188SKa Ho Ng.Dv BIO_DELETE
2503703c188SKa Ho Ngrequest, some or all of the request's operation range may be turned into a hole
2513703c188SKa Ho Ngin the file used for backing store.
2523703c188SKa Ho NgAny parts which are not turned into holes are zero-filled in
2533703c188SKa Ho Ngthe file.
2543703c188SKa Ho NgIf the file system does not support
2553703c188SKa Ho Nghole-punching,
2563703c188SKa Ho Ng.Dv BIO_DELETE
2573703c188SKa Ho Ngrequests to the device are not handled and will fail with
2583703c188SKa Ho Ng.Er EOPNOTSUPP .
2593703c188SKa Ho Ng.Pp
2603703c188SKa Ho NgWhen
2613703c188SKa Ho Ng.Cm mustdealloc
2623703c188SKa Ho Ngis not specified or
2633703c188SKa Ho Ng.Oo Cm no Oc Ns Cm mustdealloc
2643703c188SKa Ho Ngis specified, for a
2653703c188SKa Ho Ng.Dv BIO_DELETE
2663703c188SKa Ho Ngrequest, if the file system supports hole-punching, some or all of the request's
2673703c188SKa Ho Ngoperation range may be turned into a hole in the file used for backing store.
2683703c188SKa Ho NgAny parts which are not turned into holes are zero-filled in the file.
2693703c188SKa Ho NgIf the file system of the vnode type memory disk does not support hole-punching,
2703703c188SKa Ho Ngthe request's operation range is zero-filled in the file.
271b8758111SRuslan Ermilov.It Oo Cm no Oc Ns Cm readonly
272ac5b109fSBenjamin KadukEnable/disable readonly mode.
2739a81ba0fSStephen J. Kiernan.It Oo Cm no Oc Ns Cm verify
2749a81ba0fSStephen J. KiernanFor
2759a81ba0fSStephen J. Kiernan.Cm vnode
2769a81ba0fSStephen J. Kiernanbacked devices: enable/disable requesting verification of the
2779a81ba0fSStephen J. Kiernanfile used for backing store.
2789a81ba0fSStephen J. KiernanThe type of verification depends on which security features are available.
2799a81ba0fSStephen J. KiernanOne example of verification is testing file integrity with
2809a81ba0fSStephen J. Kiernanchecksums or cryptographic signatures.
281c2ef0b73SPoul-Henning Kamp.El
282e06b153aSPoul-Henning Kamp.It Fl u Ar unit
2838cde1e8aSJohn-Mark GurneyRequest a specific unit number or device name for the
284739cdd4bSRuslan Ermilov.Xr md 4
2853f6f9216SPoul-Henning Kampdevice instead of automatic allocation.
286f35062c7SMateusz PiotrowskiIf a device name is specified, it must start with
2878cde1e8aSJohn-Mark Gurney.Dq md
2888cde1e8aSJohn-Mark Gurneyfollowed by the unit number.
289c2ef0b73SPoul-Henning Kamp.El
2906c49c6cfSDag-Erling Smørgrav.Pp
2916c49c6cfSDag-Erling SmørgravThe last form,
2926c49c6cfSDag-Erling Smørgrav.Nm
2936c49c6cfSDag-Erling Smørgrav.Ar file ,
2946c49c6cfSDag-Erling Smørgravis provided for convenience as an abbreviation of
2956c49c6cfSDag-Erling Smørgrav.Nm
2966c49c6cfSDag-Erling Smørgrav.Fl a
2978bd4b3f9SMateusz Piotrowski.Fl t Cm vnode
2986c49c6cfSDag-Erling Smørgrav.Fl f Ar file .
299c2ef0b73SPoul-Henning Kamp.Sh EXAMPLES
3006be30a30SEdward Tomasz NapieralaCreate a disk with
301c2ef0b73SPoul-Henning Kamp.Pa /tmp/boot.flp
3026be30a30SEdward Tomasz Napieralaas backing storage.
3036be30a30SEdward Tomasz NapieralaThe name of the allocated unit will be printed on stdout, such as
3046be30a30SEdward Tomasz Napierala.Dq Li md0 :
3056be30a30SEdward Tomasz Napierala.Bd -literal -offset indent
3066be30a30SEdward Tomasz Napieralamdconfig /tmp/boot.flp
3076be30a30SEdward Tomasz Napierala.Ed
308c2ef0b73SPoul-Henning Kamp.Pp
3096be30a30SEdward Tomasz NapieralaCreate a 1 gigabyte swap backed memory disk named
3106be30a30SEdward Tomasz Napierala.Dq Li md3 :
3116be30a30SEdward Tomasz Napierala.Bd -literal -offset indent
3126be30a30SEdward Tomasz Napieralamdconfig -s 1g -u md3
3136be30a30SEdward Tomasz Napierala.Ed
314c2ef0b73SPoul-Henning Kamp.Pp
315ac5b109fSBenjamin KadukDetach and free all resources used by
3166be30a30SEdward Tomasz Napierala.Pa /dev/md3 :
3176be30a30SEdward Tomasz Napierala.Bd -literal -offset indent
3186be30a30SEdward Tomasz Napieralamdconfig -du md3
3196be30a30SEdward Tomasz Napierala.Ed
320c2ef0b73SPoul-Henning Kamp.Pp
3216be30a30SEdward Tomasz NapieralaShow detailed information on current memory disks:
3226be30a30SEdward Tomasz Napierala.Bd -literal -offset indent
3236be30a30SEdward Tomasz Napieralamdconfig -lv
3246be30a30SEdward Tomasz Napierala.Ed
325c2ef0b73SPoul-Henning Kamp.Pp
3266be30a30SEdward Tomasz NapieralaResize the
3276be30a30SEdward Tomasz Napierala.Dq Li md3
3286be30a30SEdward Tomasz Napieralamemory disk to 2 gigabytes:
3296be30a30SEdward Tomasz Napierala.Bd -literal -offset indent
3306be30a30SEdward Tomasz Napieralamdconfig -rs 2g -u md3
3316be30a30SEdward Tomasz Napierala.Ed
3326be30a30SEdward Tomasz Napierala.Pp
3336be30a30SEdward Tomasz NapieralaCreate a 1 gigabyte swap backed disk, initialize an
3341a720cbeSAlexander Ziaee.Xr ffs 4
335d257bc4aSGiorgos Keramidasfile system on it, and mount it on
336c2ef0b73SPoul-Henning Kamp.Pa /tmp :
337739cdd4bSRuslan Ermilov.Bd -literal -offset indent
3386be30a30SEdward Tomasz Napieralamdconfig -s 1g -u md10
339ea396d5bSPoul-Henning Kampnewfs -U /dev/md10
340ea396d5bSPoul-Henning Kampmount /dev/md10 /tmp
341353f4b39SPoul-Henning Kampchmod 1777 /tmp
342739cdd4bSRuslan Ermilov.Ed
34384783ceaSMarc Fonvieille.Pp
3446be30a30SEdward Tomasz NapieralaCreate a memory disk out of an ISO 9660 CD image file,
3456be30a30SEdward Tomasz Napieralausing the first available
346d257bc4aSGiorgos Keramidas.Xr md 4
3476be30a30SEdward Tomasz Napieraladevice, and then mount it:
3485810c7efSGiorgos Keramidas.Bd -literal -offset indent
349d257bc4aSGiorgos Keramidasmount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt
3502f78ba90SWarren Block.Ed
3516be30a30SEdward Tomasz Napierala.Pp
3522f78ba90SWarren BlockCreate a file-backed device from a hard disk image that begins
3532f78ba90SWarren Blockwith 512K of raw header information.
3542f78ba90SWarren Block.Xr gnop 8
3552f78ba90SWarren Blockis used to skip over the header information, positioning
3562f78ba90SWarren Block.Pa md1.nop
3572f78ba90SWarren Blockto the start of the filesystem in the image.
3582f78ba90SWarren Block.Bd -literal -offset indent
3596be30a30SEdward Tomasz Napieralamdconfig -u md1 -f diskimage.img
3602f78ba90SWarren Blockgnop create -o 512K md1
3612f78ba90SWarren Blockmount /dev/md1.nop /mnt
3625810c7efSGiorgos Keramidas.Ed
363c2ef0b73SPoul-Henning Kamp.Sh SEE ALSO
3643703c188SKa Ho Ng.Xr fpathconf 2 ,
3653703c188SKa Ho Ng.Xr fspacectl 2 ,
3669a81ba0fSStephen J. Kiernan.Xr open 2 ,
3671a720cbeSAlexander Ziaee.Xr ffs 4 ,
368c2ef0b73SPoul-Henning Kamp.Xr md 4 ,
369b8c19fd7SEdward Tomasz Napierala.Xr gpart 8 ,
3701b6c6f4aSDoug Barton.Xr mdmfs 8 ,
3713703c188SKa Ho Ng.Xr malloc 9 ,
3723703c188SKa Ho Ng.Xr vn_deallocate 9
373e10469feSPoul-Henning Kamp.Sh HISTORY
374e10469feSPoul-Henning KampThe
375e10469feSPoul-Henning Kamp.Nm
376e1205e80SPhilippe Charnierutility first appeared in
377e10469feSPoul-Henning Kamp.Fx 5.0
378f35062c7SMateusz Piotrowskias a cleaner replacement for the vn kernel module
379f35062c7SMateusz Piotrowskiand the vnconfig utility combo.
380e10469feSPoul-Henning Kamp.Sh AUTHORS
381e10469feSPoul-Henning KampThe
382e10469feSPoul-Henning Kamp.Nm
383e1205e80SPhilippe Charnierutility was written by
384bd0891ceSBaptiste Daroussin.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .
385