cvs commit: src/sbin/mdconfig mdconfig.8

Giorgos Keramidas keramida at
Fri Nov 9 14:06:32 PST 2007

On 2007-11-09 21:34, Ceri Davies <ceri at> wrote:
> On Fri, Nov 09, 2007 at 06:02:52PM +0000, Giorgos Keramidas wrote:
> > keramida    2007-11-09 18:02:51 UTC
> >
> >   FreeBSD src repository (doc committer)
> >
> >   Modified files:
> >     sbin/mdconfig        mdconfig.8
> >   Log:
> >   Instead of hardcoding md10 as the device node in the cd9660 example,
> >   use a trick submitted by Ruslan.
> > | @@ -218,8 +218,7 @@ mount /dev/md0c /mnt
> > |  .Pp
> > |  To mount an ISO 9660 CD image file:
> > |  .Bd -literal -offset indent
> > | -mdconfig -a -t vnode -u 10 -f cdimage.iso
> > | -mount_cd9660 /dev/md10 /mnt
> > | +mount -t cd9660 /dev/`mdconfig -a -t vnode -f cdimage.iso` /mnt
> > |  .Ed
> > |  .Sh SEE ALSO
> > |  .Xr md 4 ,
> I'm concerned that this actually misses the point, which is to create
> an md device backed by a .iso file.

Similar concerns have been raised by bde a while ago.  I have a slightly
improved patch now, which describes *all* the steps of the example.

This one actually *notes* that the mdconfig command creates an md(4)
device, and then mounts it, instead of saying that we 'mount an iso'.

Index: mdconfig.8
RCS file: /home/ncvs/src/sbin/mdconfig/mdconfig.8,v
retrieving revision 1.38
diff -u -5 -r1.38 mdconfig.8
--- mdconfig.8	9 Nov 2007 18:02:51 -0000	1.38
+++ mdconfig.8	9 Nov 2007 20:00:07 -0000
@@ -94,11 +94,11 @@
 malloc-backed memory disk is a very easy way to
 panic a system.
 .It Cm vnode
 A file specified with
 .Fl f Ar file
-becomes the backingstore for this memory disk.
+becomes the backing store for this memory disk.
 .It Cm swap
 Swap space is used to back this memory disk.
 .It Fl f Ar file
 Filename to use for the vnode type memory disk. Options
@@ -183,47 +183,58 @@
 To create a disk named
 .Pa /dev/md4
 .Pa /tmp/boot.flp
-as backing:
+as backing storage:
 .Dl mdconfig -a -t vnode -f /tmp/boot.flp -u 4
 To detach and free all resources used by
 .Pa /dev/md4 :
 .Dl mdconfig -d -u 4
-To create and mount a 128MByte swap backed file system on
+To create a 128MByte 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 10
 newfs -U /dev/md10
 mount /dev/md10 /tmp
 chmod 1777 /tmp
-To create a 5MB file-backed disk (
-.Fl -a
+To create a 5MB file-backed disk
+.Ns ( Fl a
-.Fl -t Ar vnode
+.Fl t Ar vnode
 are implied):
 .Bd -literal -offset indent
 dd if=/dev/zero of=somebackingfile bs=1k count=5k
 mdconfig -f somebackingfile -u 0
 bsdlabel -w md0 auto
 newfs md0c
 mount /dev/md0c /mnt
-To mount an ISO 9660 CD image file:
+To create an
+.Xr md 4
+disk out of an ISO 9660 CD image file
+.Ns ( Fl a
+.Fl t Ar vnode
+are implied), using the first available
+.Xr md 4
+device node, and then mount the new memory disk:
 .Bd -literal -offset indent
-mount -t cd9660 /dev/`mdconfig -a -t vnode -f cdimage.iso` /mnt
+mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt
 .Xr md 4 ,
+.Xr ffs 7 ,
 .Xr bsdlabel 8 ,
 .Xr fdisk 8 ,
 .Xr mdmfs 8 ,
 .Xr malloc 9

More information about the cvs-src mailing list