Changeset View
Standalone View
sbin/mdconfig/mdconfig.8
Show All 31 Lines | |||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)vnconfig.8 8.1 (Berkeley) 6/5/93 | .\" @(#)vnconfig.8 8.1 (Berkeley) 6/5/93 | ||||
.\" from: src/usr.sbin/vnconfig/vnconfig.8,v 1.19 2000/12/27 15:30:29 | .\" from: src/usr.sbin/vnconfig/vnconfig.8,v 1.19 2000/12/27 15:30:29 | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd November 30, 2013 | .Dd July 25, 2015 | ||||
.Dt MDCONFIG 8 | .Dt MDCONFIG 8 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm mdconfig | .Nm mdconfig | ||||
.Nd configure and enable memory disks | .Nd configure memory disks | ||||
wblock: See below, I think this should be:
.Nd configure and create memory disks | |||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Fl a | .Fl a | ||||
.Fl t Ar type | .Fl t Ar type | ||||
.Op Fl n | .Op Fl n | ||||
.Oo Fl o Oo Cm no Oc Ns Ar option Oc ... | .Oo Fl o Oo Cm no Oc Ns Ar option Oc ... | ||||
.Op Fl f Ar file | .Op Fl f Ar file | ||||
.Op Fl s Ar size | .Op Fl s Ar size | ||||
Show All 16 Lines | |||||
.Op Fl v | .Op Fl v | ||||
.Op Fl f Ar file | .Op Fl f Ar file | ||||
.Op Fl u Ar unit | .Op Fl u Ar unit | ||||
.Nm | .Nm | ||||
.Ar file | .Ar file | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
utility configures and enables | utility is used to configure | ||||
wblockUnsubmitted Not Done Inline ActionsThis can be just: utility configures But I think the original wording was trying to say that this program does not just configure memory disks, but creates them: utility configures and creates wblock: This can be just:
utility configures
But I think the original wording was trying to say that… | |||||
traszAuthorUnsubmitted Not Done Inline ActionsWell, actually, it creates and destroys them, the only non-destructive thing it can do with an existing memory disk is resizing. But I kind of thought "configure" includes creation and destruction. Doesn't it? If not - how about "utility creates, destroys, and configures"? trasz: Well, actually, it creates and destroys them, the only non-destructive thing it can do with an… | |||||
wblockUnsubmitted Not Done Inline ActionsTrying to think of a less redundant way to say this. How about "creates and controls"? The point of this sentence is to communicate that this one command is the one that does everything needed for md devices. "Destroys" is just a negative form of creation, if want to look at it like that. wblock: Trying to think of a less redundant way to say this. How about "creates and controls"? The… | |||||
.Xr md 4 | .Xr md 4 | ||||
devices. | devices. | ||||
.Pp | .Pp | ||||
Options indicate an action to be performed: | Options indicate an action to be performed: | ||||
.Bl -tag -width indent | .Bl -tag -width indent | ||||
.It Fl a | .It Fl a | ||||
Attach a memory disk. | Attach a memory disk. | ||||
This will configure and attach a memory disk with the | This will configure and attach a memory disk with the | ||||
Show All 11 Lines | |||||
.It Cm malloc | .It Cm malloc | ||||
Storage for this type of memory disk is allocated with | Storage for this type of memory disk is allocated with | ||||
.Xr malloc 9 . | .Xr malloc 9 . | ||||
This limits the size to the malloc bucket limit in the kernel. | This limits the size to the malloc bucket limit in the kernel. | ||||
If the | If the | ||||
.Fl o Cm reserve | .Fl o Cm reserve | ||||
option is not set, creating and filling a large | option is not set, creating and filling a large | ||||
malloc-backed memory disk is a very easy way to | malloc-backed memory disk is a very easy way to | ||||
panic a system. | panic the system. | ||||
wblockUnsubmitted Not Done Inline ActionsThe original is kind of an idiomatic way of saying it in English, but this works also. wblock: The original is kind of an idiomatic way of saying it in English, but this works also. | |||||
traszAuthorUnsubmitted Not Done Inline ActionsErm, but which one is better? trasz: Erm, but which one is better? | |||||
wblockUnsubmitted Not Done Inline ActionsThey are about equal. "panic the system" is okay. wblock: They are about equal. "panic the system" is okay. | |||||
.It Cm vnode | .It Cm vnode | ||||
A file specified with | A file specified with | ||||
.Fl f Ar file | .Fl f Ar file | ||||
becomes the backing store for this memory disk. | becomes the backing store for this memory disk. | ||||
.It Cm swap | .It Cm swap | ||||
Storage for this type of memory disk is allocated from buffer | Storage for this type of memory disk is allocated from buffer | ||||
memory. | memory. | ||||
Pages get pushed out to swap when the system is under memory | Pages get pushed out to swap when the system is under memory | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
Size of the memory disk. | Size of the memory disk. | ||||
.Ar Size | .Ar Size | ||||
is the number of 512 byte sectors unless suffixed with a | is the number of 512 byte sectors unless suffixed with a | ||||
.Cm b , k , m , g , | .Cm b , k , m , g , | ||||
or | or | ||||
.Cm t | .Cm t | ||||
which | which | ||||
denotes byte, kilobyte, megabyte, gigabyte and terabyte respectively. | denotes byte, kilobyte, megabyte, gigabyte and terabyte respectively. | ||||
The | |||||
.Fl a | |||||
and | |||||
.Fl t Ar swap | |||||
options are implied if not specified. | |||||
wblockUnsubmitted Not Done Inline ActionsWhy remove these? wblock: Why remove these? | |||||
traszAuthorUnsubmitted Not Done Inline ActionsI thought it was a copy-paste error, but now I've read this again, it's ok, but unclear. What this should be saying, is something like this: "When used without the -r option, the -a and -t swap options are implied if not specified". Which means, they will be implied when used like this: mdconfig -s1g which translates to "mdconfig -a -t swap -s 1g", but not when used like this: mdconfig -rs1g trasz: I thought it was a copy-paste error, but now I've read this again, it's ok, but unclear. What… | |||||
.It Fl S Ar sectorsize | .It Fl S Ar sectorsize | ||||
Sectorsize to use for the memory disk, in bytes. | Sectorsize to use for the memory disk, in bytes. | ||||
.It Fl x Ar sectors/track | .It Fl x Ar sectors/track | ||||
See the description of the | See the description of the | ||||
.Fl y | .Fl y | ||||
option below. | option below. | ||||
.It Fl y Ar heads/cylinder | .It Fl y Ar heads/cylinder | ||||
For | For | ||||
Show All 21 Lines | |||||
Allocate and reserve all needed storage from the start, rather than as needed. | Allocate and reserve all needed storage from the start, rather than as needed. | ||||
.It Oo Cm no Oc Ns Cm cluster | .It Oo Cm no Oc Ns Cm cluster | ||||
Enable clustering on this disk. | Enable clustering on this disk. | ||||
.It Oo Cm no Oc Ns Cm compress | .It Oo Cm no Oc Ns Cm compress | ||||
Enable/disable compression features to reduce memory usage. | Enable/disable compression features to reduce memory usage. | ||||
.It Oo Cm no Oc Ns Cm force | .It Oo Cm no Oc Ns Cm force | ||||
Disable/enable extra sanity checks to prevent the user from doing something | Disable/enable extra sanity checks to prevent the user from doing something | ||||
that might adversely affect the system. | that might adversely affect the system. | ||||
This can be used with the | |||||
.Fl u | |||||
flag, to forcibly destroy an | |||||
wblockUnsubmitted Not Done Inline ActionsThe comma is not needed. wblock: The comma is not needed. | |||||
.Xr md 4 | |||||
disk that is still in use. | |||||
.It Oo Cm no Oc Ns Cm readonly | .It Oo Cm no Oc Ns Cm readonly | ||||
Enable/disable readonly mode. | Enable/disable readonly mode. | ||||
.El | .El | ||||
.It Fl u Ar unit | .It Fl u Ar unit | ||||
Request a specific unit number or device name for the | Request a specific unit number or device name for the | ||||
.Xr md 4 | .Xr md 4 | ||||
device instead of automatic allocation. | device instead of automatic allocation. | ||||
If a device name is specified, it must be start with | If a device name is specified, it must be start with | ||||
.Dq md | .Dq md | ||||
followed by the unit number. | followed by the unit number. | ||||
.El | .El | ||||
.Pp | .Pp | ||||
The last form, | The last form, | ||||
.Nm | .Nm | ||||
.Ar file , | .Ar file , | ||||
is provided for convenience as an abbreviation of | is provided for convenience as an abbreviation of | ||||
.Nm | .Nm | ||||
.Fl a | .Fl a | ||||
.Fl t Ar vnode | .Fl t Ar vnode | ||||
.Fl f Ar file . | .Fl f Ar file . | ||||
.Sh EXAMPLES | .Sh EXAMPLES | ||||
Create a 4 megabyte | Create a disk with /tmp/boot.flp as backing storage. | ||||
wblockUnsubmitted Not Done Inline ActionsNeeds markup for the filename: Create a disk with wblock: Needs markup for the filename:
Create a disk with
.Pa /tmp/boot.flp
as backing storage. | |||||
.Xr malloc 9 | |||||
backed memory disk. | |||||
The name of the allocated unit will be printed on stdout, such as | The name of the allocated unit will be printed on stdout, such as | ||||
.Dq Li md3 : | .Dq Li md0 : | ||||
.Pp | .Pp | ||||
.Dl mdconfig -a -t malloc -s 4m | .Dl mdconfig /tmp/boot.flp | ||||
wblockUnsubmitted Not Done Inline ActionsAll of these examples should probably be consistent, using .Bd/.Ed instead of .Dl wblock: All of these examples should probably be consistent, using .Bd/.Ed instead of .Dl | |||||
.Pp | .Pp | ||||
Create a disk named | Create a 1 gigabyte | ||||
.Pa /dev/md4 | .Cm swap | ||||
wblockUnsubmitted Not Done Inline ActionsI'm not sure about .Cm (command modifier) as markup for swap. Probably it is fine without markup at all, since "swap" is not a special word. wblock: I'm not sure about .Cm (command modifier) as markup for swap. Probably it is fine without… | |||||
with | backed memory disk named | ||||
.Pa /tmp/boot.flp | .Dq Li md3 : | ||||
as backing storage: | |||||
.Pp | .Pp | ||||
.Dl mdconfig -a -t vnode -f /tmp/boot.flp -u md4 | .Dl mdconfig -s 1g -u md3 | ||||
.Pp | .Pp | ||||
Detach and free all resources used by | Detach and free all resources used by | ||||
.Pa /dev/md4 : | .Pa /dev/md3 : | ||||
.Pp | .Pp | ||||
.Dl mdconfig -d -u md4 | .Dl mdconfig -du md3 | ||||
.Pp | .Pp | ||||
Create a 128MByte swap backed disk, initialize an | Show detailed information on currently configured memory disks: | ||||
wblockUnsubmitted Not Done Inline Actions"currently configured" is potentially ambiguous. "existing" might be better. wblock: "currently configured" is potentially ambiguous. "existing" might be better. | |||||
.Pp | |||||
Not Done Inline ActionsThis looks like the only comment not done. "Existing" is not great, "extant" is too obscure. How about just "current memory disks"? wblock: This looks like the only comment not done. "Existing" is not great, "extant" is too obscure. | |||||
.Dl mdconfig -lv | |||||
.Pp | |||||
Resize the | |||||
.Dq Li md3 | |||||
memory disk to 2 gigabytes: | |||||
.Pp | |||||
.Dl mdconfig -rs 2g -u md3 | |||||
.Pp | |||||
Create a 1 gigabyte | |||||
.Cm swap | |||||
wblockUnsubmitted Not Done Inline ActionsSame as above, markup is probably not needed on "swap". wblock: Same as above, markup is probably not needed on "swap". | |||||
backed disk, initialize an | |||||
.Xr ffs 7 | .Xr ffs 7 | ||||
file system on it, and mount it on | file system on it, and mount it on | ||||
.Pa /tmp : | .Pa /tmp : | ||||
.Bd -literal -offset indent | .Bd -literal -offset indent | ||||
mdconfig -a -t swap -s 128M -u md10 | mdconfig -s 1g -u md10 | ||||
newfs -U /dev/md10 | newfs -U /dev/md10 | ||||
mount /dev/md10 /tmp | mount /dev/md10 /tmp | ||||
chmod 1777 /tmp | chmod 1777 /tmp | ||||
.Ed | .Ed | ||||
.Pp | .Pp | ||||
Create a 5MB file-backed disk | Create a memory disk out of an ISO 9660 CD image file, | ||||
.Po Fl a | using the first available | ||||
and | |||||
.Fl t Ar vnode | |||||
are implied | |||||
.Pc : | |||||
.Bd -literal -offset indent | |||||
dd if=/dev/zero of=somebackingfile bs=1k count=5k | |||||
mdconfig -f somebackingfile -u md0 | |||||
bsdlabel -w md0 auto | |||||
newfs md0c | |||||
mount /dev/md0c /mnt | |||||
.Ed | |||||
.Pp | |||||
Create an | |||||
.Xr md 4 | .Xr md 4 | ||||
device out of an ISO 9660 CD image file | device, and then mount it: | ||||
.Po Fl a | |||||
and | |||||
.Fl t Ar vnode | |||||
are implied | |||||
.Pc , using the first available | |||||
.Xr md 4 | |||||
device, and then mount the new memory disk: | |||||
.Bd -literal -offset indent | .Bd -literal -offset indent | ||||
mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt | mount -t cd9660 /dev/`mdconfig cdimage.iso` /mnt | ||||
.Pp | |||||
.Ed | .Ed | ||||
.Pp | |||||
Create a file-backed device from a hard disk image that begins | Create a file-backed device from a hard disk image that begins | ||||
with 512K of raw header information. | with 512K of raw header information. | ||||
.Xr gnop 8 | .Xr gnop 8 | ||||
is used to skip over the header information, positioning | is used to skip over the header information, positioning | ||||
.Pa md1.nop | .Pa md1.nop | ||||
to the start of the filesystem in the image. | to the start of the filesystem in the image. | ||||
.Bd -literal -offset indent | .Bd -literal -offset indent | ||||
mdconfig -f diskimage.img -u md1 | mdconfig -u md1 diskimage.img | ||||
wblockUnsubmitted Not Done Inline ActionsRearranging the arguments to use the implied -f kind of makes it look like the filename is expected as the last argument to mdconfig, which does not agree with the synopsis. It does no real harm to leave the -f, as examples are often more strict and more explicit than real-life usage because that provides the reader with more information. Same thing on the cdimage example. wblock: Rearranging the arguments to use the implied -f kind of makes it look like the filename is… | |||||
gnop create -o 512K md1 | gnop create -o 512K md1 | ||||
mount /dev/md1.nop /mnt | mount /dev/md1.nop /mnt | ||||
.Ed | .Ed | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr md 4 , | .Xr md 4 , | ||||
.Xr ffs 7 , | .Xr ffs 7 , | ||||
.Xr bsdlabel 8 , | .Xr bsdlabel 8 , | ||||
.Xr fdisk 8 , | .Xr fdisk 8 , | ||||
Show All 17 Lines |
See below, I think this should be:
.Nd configure and create memory disks