Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Oct 1996 16:15:06 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        guido@gvr.win.tue.nl, phk@critter.tfs.com
Cc:        FreeBSD-hackers@freebsd.org
Subject:   Re: disklabeling a vn device
Message-ID:  <199610010615.QAA15452@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> >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 <disk type>
>
>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610010615.QAA15452>