*BSD News Article 45434


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!zombie.ncsc.mil!news.mathworks.com!news.alpha.net!uwm.edu!spool.mu.edu!howland.reston.ans.net!Germany.EU.net!zib-berlin.de!news.tu-chemnitz.de!irz401!narcisa.sax.de!not-for-mail
From: j@narcisa.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: vnode devices
Date: 14 Jun 1995 11:44:36 +0200
Organization: Private U**x site, Dresden.
Lines: 112
Message-ID: <3rmb24$4pq@bonnie.tcd-dresden.de>
References: <3r609i$7e5@news.bu.edu> <3r7bk5$qn1@news.bu.edu> <3rhalo$n1n@bonnie.tcd-dresden.de> <3ri7pi$ll4@news.bu.edu>
Reply-To: joerg_wunsch@uriah.heep.sax.de
NNTP-Posting-Host: 192.109.108.139
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Mikhail Teterin <mi@cs.bu.edu> wrote:

>My life is fine except for one thing -- how to make vnode devices?
>My kernel should support them, but MAKEDEV fails. Which man-page to read?
>Thanks!

Hmm, i believe i've actually made them with MAKEDEV.  Wait...

Anyway, in order to have really working vnode devices, you need a very
recent kernel (preferably 2.0.5R, even the April SNAP won't do it).
All earlier versions are more or less broken.

From MAKEDEV:
# Disks:
...
#       vn*     "vnode disks"
...
sd*s*|vn*s*|wd*s*)
        umask 37
        case $i in
        sd*s*) name=sd; blk=4;  chr=13;;
        wd*s*) name=wd; blk=0;  chr=3;;
        vn*s*) name=vn; blk=15; chr=43;;
        esac
...

j@uriah 53% ls -l /dev/*vn0*
crw-r-----  1 root  operator   43, 65538 Apr 29 17:21 /dev/rvn0
crw-r-----  1 root  operator   43,   0 Apr 16 21:12 /dev/rvn0a
crw-r-----  1 root  operator   43,   1 Apr  2 22:46 /dev/rvn0b
crw-r-----  1 root  operator   43,   2 Apr 30 08:17 /dev/rvn0c
crw-r-----  1 root  operator   43,   3 Apr  2 22:46 /dev/rvn0d
crw-r-----  1 root  operator   43,   4 Apr  2 22:46 /dev/rvn0e
crw-r-----  1 root  operator   43,   5 Apr  2 22:46 /dev/rvn0f
crw-r-----  1 root  operator   43,   6 Apr  2 22:46 /dev/rvn0g
crw-r-----  1 root  operator   43,   7 Apr  2 22:46 /dev/rvn0h
crw-r-----  1 root  operator   43, 131074 Apr  2 22:46 /dev/rvn0s1
crw-r-----  1 root  operator   43, 196610 Apr  2 22:46 /dev/rvn0s2
crw-r-----  1 root  operator   43, 262146 Apr  2 22:46 /dev/rvn0s3
crw-r-----  1 root  operator   43, 327682 Apr  2 22:46 /dev/rvn0s4
brw-r-----  1 root  operator   15, 65538 Apr  2 22:46 /dev/vn0
brw-r-----  1 root  operator   15,   0 Apr 14 10:17 /dev/vn0a
brw-r-----  1 root  operator   15,   1 Apr  2 22:46 /dev/vn0b
brw-r-----  1 root  operator   15,   2 Apr  2 22:46 /dev/vn0c
brw-r-----  1 root  operator   15,   3 Apr  2 22:46 /dev/vn0d
brw-r-----  1 root  operator   15,   4 Apr  2 22:46 /dev/vn0e
brw-r-----  1 root  operator   15,   5 Apr  2 22:46 /dev/vn0f
brw-r-----  1 root  operator   15,   6 Apr  2 22:46 /dev/vn0g
brw-r-----  1 root  operator   15,   7 Apr  2 22:46 /dev/vn0h
brw-r-----  1 root  operator   15, 131074 Apr  2 22:46 /dev/vn0s1
brw-r-----  1 root  operator   15, 196610 Apr  2 22:46 /dev/vn0s2
brw-r-----  1 root  operator   15, 262146 Apr  2 22:46 /dev/vn0s3
brw-r-----  1 root  operator   15, 327682 Apr  2 22:46 /dev/vn0s4

There's a vnconfig(8) man page, but it's slightly disagreeing with
the reality.

Here's a short log of what you can do with a `vn' device.

[[Create a floppy image]]
uriah # dd if=/dev/zero of=image bs=18k count=80
80+0 records in
80+0 records out
1474560 bytes transferred in 1 secs (1474560 bytes/sec)

[[vnconfig it, allow disk labels to be written]]
uriah # vnconfig -c -s labels /dev/rvn0 image 

[[label & newfs it]]
uriah # disklabel -B -b /usr/mdec/boot1 -s /usr/mdec/boot2 vn0
uriah # disklabel -r -w /dev/rvn0c floppy5
uriah # newfs /dev/rvn0c
Warning: calculated sectors per cylinder (4096) disagrees with disk label (30)
Warning: Block size and bytes per inode restrict cylinders per group to 5.
Warning: 1696 sector(s) in last cylinder unallocated
/dev/rvn0c:     2400 sectors in 1 cylinders of 1 tracks, 4096 sectors
        1.2MB in 1 cyl groups (5 c/g, 10.00MB/g, 4448 i/g)
super-block backups (for fsck -b #) at:
 32,

[[now, create something]]
uriah # mount /dev/vn0c /mnt
uriah # mkdir /mnt/foo
uriah # touch /mnt/foo/bar
uriah # umount /mnt
[[and un-wire]]
uriah # vnconfig -u /dev/rvn0

[[just to make sure it's going into a different object, this is only
to confuse the cache and demonstrate that the data are really there]]
uriah # cp image image2

[[wire the new file, and look what we've got]]
uriah # vnconfig -c /dev/rvn0 image2
uriah # mount /dev/vn0c /mnt
uriah # ls -lR /mnt
total 1
drwxr-xr-x  2 root  wheel  512 Jun 14 11:31 foo/

/mnt/foo:
total 0
-rw-r--r--  1 root  wheel  0 Jun 14 11:31 bar

[[Yeah!, it's there, good-bye]]
uriah # umount /mnt
uriah # vnconfig -u /dev/rvn0
uriah # rm image*
-- 
cheers, J"org                      private:   joerg_wunsch@uriah.heep.sax.de
                                   http://www.sax.de/~joerg/

Never trust an operating system you don't have sources for. ;-)