From owner-svn-src-head@freebsd.org Thu Aug 6 07:47:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E2C99B58B5; Thu, 6 Aug 2015 07:47:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EC22C2E; Thu, 6 Aug 2015 07:47:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t767lEi0001865; Thu, 6 Aug 2015 07:47:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t767lEDw001864; Thu, 6 Aug 2015 07:47:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508060747.t767lEDw001864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 6 Aug 2015 07:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286360 - head/sbin/mdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Aug 2015 07:47:14 -0000 Author: trasz Date: Thu Aug 6 07:47:13 2015 New Revision: 286360 URL: https://svnweb.freebsd.org/changeset/base/286360 Log: Tweak mdconfig(8) manual page, in particular revise the EXAMPLES section. This removes stuff that doesn't really belong there, and simplifies examples for the basic operations. Reviewed by: wblock@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3198 Modified: head/sbin/mdconfig/mdconfig.8 Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Thu Aug 6 06:47:28 2015 (r286359) +++ head/sbin/mdconfig/mdconfig.8 Thu Aug 6 07:47:13 2015 (r286360) @@ -37,12 +37,12 @@ .\" .\" $FreeBSD$ .\" -.Dd November 30, 2013 +.Dd August 6, 2015 .Dt MDCONFIG 8 .Os .Sh NAME .Nm mdconfig -.Nd configure and enable memory disks +.Nd create and control memory disks .Sh SYNOPSIS .Nm .Fl a @@ -75,7 +75,7 @@ .Sh DESCRIPTION The .Nm -utility configures and enables +utility creates and controls .Xr md 4 devices. .Pp @@ -103,7 +103,7 @@ If the .Fl o Cm reserve option is not set, creating and filling a large malloc-backed memory disk is a very easy way to -panic a system. +panic the system. .It Cm vnode A file specified with .Fl f Ar file @@ -164,7 +164,9 @@ or .Cm t which denotes byte, kilobyte, megabyte, gigabyte and terabyte respectively. -The +When used without the +.Fl r +option, the .Fl a and .Fl t Ar swap @@ -206,6 +208,11 @@ Enable/disable compression features to r .It Oo Cm no Oc Ns Cm force Disable/enable extra sanity checks to prevent the user from doing something that might adversely affect the system. +This can be used with the +.Fl u +flag to forcibly destroy an +.Xr md 4 +disk that is still in use. .It Oo Cm no Oc Ns Cm readonly Enable/disable readonly mode. .El @@ -227,66 +234,58 @@ is provided for convenience as an abbrev .Fl t Ar vnode .Fl f Ar file . .Sh EXAMPLES -Create a 4 megabyte -.Xr malloc 9 -backed memory disk. -The name of the allocated unit will be printed on stdout, such as -.Dq Li md3 : -.Pp -.Dl mdconfig -a -t malloc -s 4m -.Pp -Create a disk named -.Pa /dev/md4 -with +Create a disk with .Pa /tmp/boot.flp -as backing storage: +as backing storage. +The name of the allocated unit will be printed on stdout, such as +.Dq Li md0 : +.Bd -literal -offset indent +mdconfig /tmp/boot.flp +.Ed .Pp -.Dl mdconfig -a -t vnode -f /tmp/boot.flp -u md4 +Create a 1 gigabyte swap backed memory disk named +.Dq Li md3 : +.Bd -literal -offset indent +mdconfig -s 1g -u md3 +.Ed .Pp Detach and free all resources used by -.Pa /dev/md4 : +.Pa /dev/md3 : +.Bd -literal -offset indent +mdconfig -du md3 +.Ed +.Pp +Show detailed information on current memory disks: +.Bd -literal -offset indent +mdconfig -lv +.Ed .Pp -.Dl mdconfig -d -u md4 +Resize the +.Dq Li md3 +memory disk to 2 gigabytes: +.Bd -literal -offset indent +mdconfig -rs 2g -u md3 +.Ed .Pp -Create a 128MByte swap backed disk, initialize an +Create a 1 gigabyte swap backed disk, initialize an .Xr ffs 7 file system on it, and mount it on .Pa /tmp : .Bd -literal -offset indent -mdconfig -a -t swap -s 128M -u md10 +mdconfig -s 1g -u md10 newfs -U /dev/md10 mount /dev/md10 /tmp chmod 1777 /tmp .Ed .Pp -Create a 5MB file-backed disk -.Po Fl a -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 -device out of an ISO 9660 CD image file -.Po Fl a -and -.Fl t Ar vnode -are implied -.Pc , using the first available +Create a memory disk out of an ISO 9660 CD image file, +using the first available .Xr md 4 -device, and then mount the new memory disk: +device, and then mount it: .Bd -literal -offset indent mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt -.Pp .Ed +.Pp Create a file-backed device from a hard disk image that begins with 512K of raw header information. .Xr gnop 8 @@ -294,7 +293,7 @@ is used to skip over the header informat .Pa md1.nop to the start of the filesystem in the image. .Bd -literal -offset indent -mdconfig -f diskimage.img -u md1 +mdconfig -u md1 -f diskimage.img gnop create -o 512K md1 mount /dev/md1.nop /mnt .Ed