From owner-freebsd-hackers Mon Sep 30 23:21:35 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id XAA00358 for hackers-outgoing; Mon, 30 Sep 1996 23:21:35 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id XAA00343 for ; Mon, 30 Sep 1996 23:21:28 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.7.6/8.6.9) id QAA15452; Tue, 1 Oct 1996 16:15:06 +1000 Date: Tue, 1 Oct 1996 16:15:06 +1000 From: Bruce Evans Message-Id: <199610010615.QAA15452@godzilla.zeta.org.au> To: guido@gvr.win.tue.nl, phk@critter.tfs.com Subject: Re: disklabeling a vn device Cc: FreeBSD-hackers@freebsd.org Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >> >I am pretty I once managed to create an empty file, vnconfig it and >> >then label amnd newfs it. I forgot how though and I'm stuk with a >> > disklabel: ioctl DIOCWDINFO: Inappropriate ioctl for device >> >error. How is this doen? Label ioctls work better if labels are enabled. Labels are disabled by default for vn disks. Type `vnconfig' with no args to get a usage method about how to enable labels. This isn't documented properly in the man page. >> Dig into src/release/Makefile for the final clue, I can't remember >> but I know that works. > >I just foud out how it can be done: > newfs /dev/rvn0c > >This is undocumented in the newfs manpage though...If I have time >I'll fix it. The equivalent -T option is documented. newfs on unlabeled disk is most often used for floppies. It is convenient because floppy sizes are standard and there are entries in /etc/disktab for them. It is inconvenient for vn and real disks of assorted sizes because you have to edit /etc/disktab to add entries. See /usr/src/release/doFS.sh for how to do it. Gak! NOT. It edits /etc/disktab. It's much easier and cleaner to edit an ASCII label (perhaps in a pipe) and use the -R option to disklabel, e.g.: cd /tmp dd if=/dev/zero of=vnfile bs=1024k count=4 vnconfig -c -s labels /dev/rvn0 vnfile # Extract dummy in-core label for whole disk (/dev/rvn0) and put # it on the (`c' partition on the compatibility slice on the) # disk (/dev/rvn0c). disklabel /dev/rvn0 | disklabel -R -r vn0 /dev/stdin # I'm too lazy to edit the label to create an `a' partition, so # use the `c' partition. newfs /dev/rvn0c Bruce