Subject: kern/19847: Kernel panic by cgd on vnd
To: None <gnats-bugs@gnats.netbsd.org>
From: Christian Biere <christianbiere@gmx.de>
List: netbsd-bugs
Date: 01/14/2003 09:40:21
>Number:         19847
>Category:       kern
>Synopsis:       Kernel panic by cgd on vnd
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 14 00:41:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Christian Biere
>Release:        NetBSD 1.6K
>Organization:
>Environment:
NetBSD cyclonus 1.6K NetBSD 1.6K (UNICRON) #0: Thu Dec 26 03:55:28 CET
2002 root@ cyclonus:/usr/src/sys/arch/i386/compile/UNICRON i386

>Description:

This is what I found in /var/log/messages after the panic:

 uvm_fault(0xc0393cc0, 0x0, 0, 2) -> e
 fatal page fault in supervisor mode
 trap type 6 code 2 eip c01ec134 cs 8 eflags 10246 cr2 24 ilevel 6
 panic: trap
 Begin traceback...
 trap() at trap+0x206
 --- trap (number 6) ---
 vndstrategy(c0f8b310,c0f8b000,0,6,c0f95000) at vndstrategy+0x3c8
 spec_strategy(d37aba64,0,2,c0100bb2,0) at spec_strategy+0x4a
 cgdstart(c08de400,c0bba208,0,c0366ce4,c0bba208) at cgdstart+0x19a
 dk_strategy(c0367424,c08de400,c0bba208,c01e7501,1500) at
dk_strategy+0xba cgdstrategy(c0bba208,d37abb28,d39df760,1,c0bba208) at
cgdstrategy+0x25
spec_strategy(d37abbe8,c4960000,d37abb6c,c026c320,c0bba208) at
spec_strategy+0x4a ufs_strategy(d37abbe8,2,1,d37abbfc,d3c1dea0) at
ufs_strategy+0xfb genfs_gop_write(d3c1dea0,d37abc34,2,11,c07141a0) at
genfs_gop_write+0x39c
genfs_putpages(d37abde0,0,c089c800,c0cc2814,d3c1dea0) at
genfs_putpages+0x8f7
ffs_putpages(d37abde0,c0290a39,c089acd0,c089b000,d3c1dea0) at
ffs_putpages+0x11d ffs_full_fsync(d37abed8,0,d37abe2c,c0232f48,d3c1dea0)
at ffs_full_fsync+0xb5 ffs_fsync(d37abed8,10012,8,3246,0) at
ffs_fsync+0x3c ffs_sync(c09f9a00,3,c0828f00,d378ab40,d3ddd924) at
ffs_sync+0x10a sync_fsync(d37abf68,12,0,3206,d378ab40) at
sync_fsync+0x5c sched_sync(d378ab40,d379e4e0,0,0,c010030c) at
sched_sync+0x106 End traceback...
 syncing disks... uvm_fault(0xc0393cc0, 0x0, 0, 2) -> e
 fatal page fault in supervisor mode
 trap type 6 code 2 eip c01ec134 cs 8 eflags 10246 cr2 24 ilevel 6
 panic: trap
 Begin traceback...
 trap() at trap+0x206
 --- trap (number 6) ---
 vndstrategy(c0f8b380,0,c0c5f000,6,c0cbc000) at vndstrategy+0x3c8
 spec_strategy(d37ab384,0,2,1000,0) at spec_strategy+0x4a
 cgdstart(c08de400,c0bba618,0,1,c0bba618) at cgdstart+0x19a
 dk_strategy(c0367424,c08de400,c0bba618,c01e7501,1500) at
dk_strategy+0xba cgdstrategy(c0bba618,24,d3be8d84,1,c0bba618) at
cgdstrategy+0x25
spec_strategy(d37ab508,c4961000,d37ab48c,c026c320,c0bba618) at
spec_strategy+0x4a ufs_strategy(d37ab508,2,1,d37ab51c,d39784e0) at
ufs_strategy+0xfb genfs_gop_write(d39784e0,d37ab554,1,11,c06a3168) at
genfs_gop_write+0x39c
genfs_putpages(d37ab700,d37ab73b,20,c02b27a8,d39784e0) at
genfs_putpages+0x8f7
ffs_putpages(d37ab700,c012183e,c0beaf00,54,d39784e0) at
ffs_putpages+0x11d ffs_full_fsync(d37ab7f8,0,d37ab74c,c0232f48,d39784e0)
at ffs_full_fsync+0xb5 ffs_fsync(d37ab7f8,10012,0,c020c575,0) at
ffs_fsync+0x3c ffs_sync(c09f9a00,2,c0828f00,d378ab40,100) at
ffs_sync+0x10a sys_sync(d378ab40,0,0,c020c7bc,100) at sys_sync+0x5a
 vfs_shutdown(d37ab8e8,1,fff0,c031dd12,c020c71c) at vfs_shutdown+0x90
 cpu_reboot(100,0,d37ab92c,c02812e2,0) at cpu_reboot+0x3b
 panic(c033261e,c03325c0,d37ab934,2,6) at panic+0x123
 trap() at trap+0x206
 --- trap (number 6) ---
 vndstrategy(c0f8b310,c0f8b000,0,6,c0f95000) at vndstrategy+0x3c8
 spec_strategy(d37aba64,0,2,c0100bb2,0) at spec_strategy+0x4a
 cgdstart(c08de400,c0bba208,0,c0366ce4,c0bba208) at cgdstart+0x19a
 dk_strategy(c0367424,c08de400,c0bba208,c01e7501,1500) at
dk_strategy+0xba cgdstrategy(c0bba208,d37abb28,d39df760,1,c0bba208) at
cgdstrategy+0x25
spec_strategy(d37abbe8,c4960000,d37abb6c,c026c320,c0bba208) at
spec_strategy+0x4a ufs_strategy(d37abbe8,2,1,d37abbfc,d3c1dea0) at
ufs_strategy+0xfb genfs_gop_write(d3c1dea0,d37abc34,2,11,c07141a0) at
genfs_gop_write+0x39c
genfs_putpages(d37abde0,0,c089c800,c0cc2814,d3c1dea0) at
genfs_putpages+0x8f7
ffs_putpages(d37abde0,c0290a39,c089acd0,c089b000,d3c1dea0) at
ffs_putpages+0x11d ffs_full_fsync(d37abed8,0,d37abe2c,c0232f48,d3c1dea0)
at ffs_full_fsync+0xb5 ffs_fsync(d37abed8,10012,8,3246,0) at
ffs_fsync+0x3c ffs_sync(c09f9a00,3,c0828f00,d378ab40,d3ddd924) at
ffs_sync+0x10a sync_fsync(d37abf68,12,0,3206,d378ab40) at
sync_fsync+0x5c sched_sync(d378ab40,d379e4e0,0,0,c010030c) at
sched_sync+0x106 End traceback...
 
 dumping to dev 0,1 offset 8967
 dump panic: wddump: polled command has been queued
 Begin traceback...
 wddump(1,2307,d37aaf6c,200,82000) at wddump+0x1ed
 cpu_dump(104,c033261e,104,c020c7bc,c033261e) at cpu_dump+0xd1
 dumpsys(d37ab208,1,ffde,c031dd12,c020c71c) at dumpsys+0x109
 cpu_reboot(104,0,d37ab24c,c02812e2,0) at cpu_reboot+0x66
 panic(c033261e,c03325c0,d37ab254,2,6) at panic+0x123
 trap() at trap+0x206
 --- trap (number 6) ---
 vndstrategy(c0f8b380,0,c0c5f000,6,c0cbc000) at vndstrategy+0x3c8
 spec_strategy(d37ab384,0,2,1000,0) at spec_strategy+0x4a
 cgdstart(c08de400,c0bba618,0,1,c0bba618) at cgdstart+0x19a
 dk_strategy(c0367424,c08de400,c0bba618,c01e7501,1500) at
dk_strategy+0xba cgdstrategy(c0bba618,24,d3be8d84,1,c0bba618) at
cgdstrategy+0x25
spec_strategy(d37ab508,c4961000,d37ab48c,c026c320,c0bba618) at
spec_strategy+0x4a ufs_strategy(d37ab508,2,1,d37ab51c,d39784e0) at
ufs_strategy+0xfb genfs_gop_write(d39784e0,d37ab554,1,11,c06a3168) at
genfs_gop_write+0x39c
genfs_putpages(d37ab700,d37ab73b,20,c02b27a8,d39784e0) at
genfs_putpages+0x8f7
ffs_putpages(d37ab700,c012183e,c0beaf00,54,d39784e0) at
ffs_putpages+0x11d ffs_full_fsync(d37ab7f8,0,d37ab74c,c0232f48,d39784e0)
at ffs_full_fsync+0xb5 ffs_fsync(d37ab7f8,10012,0,c020c575,0) at
ffs_fsync+0x3c ffs_sync(c09f9a00,2,c0828f00,d378ab40,100) at
ffs_sync+0x10a sys_sync(d378ab40,0,0,c020c7bc,100) at sys_sync+0x5a
 vfs_shutdown(d37ab8e8,1,fff0,c031dd12,c020c71c) at vfs_shutdown+0x90
 cpu_reboot(100,0,d37ab92c,c02812e2,0) at cpu_reboot+0x3b
 panic(c033261e,c03325c0,d37ab934,2,6) at panic+0x123
 trap() at trap+0x206
 --- trap (number 6) ---
 vndstrategy(c0f8b310,c0f8b000,0,6,c0f95000) at vndstrategy+0x3c8
 spec_strategy(d37aba64,0,2,c0100bb2,0) at spec_strategy+0x4a
 cgdstart(c08de400,c0bba208,0,c0366ce4,c0bba208) at cgdstart+0x19a
 dk_strategy(c0367424,c08de400,c0bba208,c01e7501,1500) at
dk_strategy+0xba cgdstrategy(c0bba208,d37abb28,d39df760,1,c0bba208) at
cgdstrategy+0x25
spec_strategy(d37abbe8,c4960000,d37abb6c,c026c320,c0bba208) at
spec_strategy+0x4a ufs_strategy(d37abbe8,2,1,d37abbfc,d3c1dea0) at
ufs_strategy+0xfb genfs_gop_write(d3c1dea0,d37abc34,2,11,c07141a0) at
genfs_gop_write+0x39c
genfs_putpages(d37abde0,0,c089c800,c0cc2814,d3c1dea0) at
genfs_putpages+0x8f7
ffs_putpages(d37abde0,c0290a39,c089acd0,c089b000,d3c1dea0) at
ffs_putpages+0x11d ffs_full_fsync(d37abed8,0,d37abe2c,c0232f48,d3c1dea0)
at ffs_full_fsync+0xb5 ffs_fsync(d37abed8,10012,8,3246,0) at
ffs_fsync+0x3c ffs_sync(c09f9a00,3,c0828f00,d378ab40,d3ddd924) at
ffs_sync+0x10a sync_fsync(d37abf68,12,0,3206,d378ab40) at
sync_fsync+0x5c sched_sync(d378ab40,d379e4e0,0,0,c010030c) at
sched_sync+0x106 End traceback...
 
 dumping to dev 0,1 offset 8967
 dump device not ready
 
 
 panic: wdc_exec_command: polled command not done
 Begin traceback...
 wdc_exec_command(c089ad14,d37aae4c,1,c02a3f91,104) at
wdc_exec_command+0xe9
wd_flushcache(c089c800,10,d37aae8c,c02b07d7,c03348e0) at
wd_flushcache+0x5a wd_shutdown(c089c800,5,0,0,d37aaed8) at
wd_shutdown+0x13 doshutdownhooks(d37aaf08,1,ffd9,c031dd12,c020c71c) at
doshutdownhooks+0x26 cpu_reboot(104,0,d37aaf2c,c02b1979,c089c800) at
cpu_reboot+0x6b panic(c03348e0,c089c8d8,f00,d2f43124,0) at panic+0x123
 wddump(1,2307,d37aaf6c,200,82000) at wddump+0x1ed
 cpu_dump(104,c033261e,104,c020c7bc,c033261e) at cpu_dump+0xd1
 dumpsys(d37ab208,1,ffde,c031dd12,c020c71c) at dumpsys+0x109
 cpu_reboot(104,0,d37ab24c,c02812e2,0) at cpu_reboot+0x66
 panic(c033261e,c03325c0,d37ab254,2,6) at panic+0x123
 trap() at trap+0x206
 --- trap (number 6) ---
 vndstrategy(c0f8b380,0,c0c5f000,6,c0cbc000) at vndstrategy+0x3c8
 spec_strategy(d37ab384,0,2,1000,0) at spec_strategy+0x4a
 cgdstart(c08de400,c0bba618,0,1,c0bba618) at cgdstart+0x19a
 dk_strategy(c0367424,c08de400,c0bba618,c01e7501,1500) at
dk_strategy+0xba cgdstrategy(c0bba618,24,d3be8d84,1,c0bba618) at
cgdstrategy+0x25
spec_strategy(d37ab508,c4961000,d37ab48c,c026c320,c0bba618) at
spec_strategy+0x4a ufs_strategy(d37ab508,2,1,d37ab51c,d39784e0) at
ufs_strategy+0xfb genfs_gop_write(d39784e0,d37ab554,1,11,c06a3168) at
genfs_gop_write+0x39c
genfs_putpages(d37ab700,d37ab73b,20,c02b27a8,d39784e0) at
genfs_putpages+0x8f7
ffs_putpages(d37ab700,c012183e,c0beaf00,54,d39784e0) at
ffs_putpages+0x11d ffs_full_fsync(d37ab7f8,0,d37ab74c,c0232f48,d39784e0)
at ffs_full_fsync+0xb5 ffs_fsync(d37ab7f8,10012,0,c020c575,0) at
ffs_fsync+0x3c ffs_sync(c09f9a00,2,c0828f00,d378ab40,100) at
ffs_sync+0x10a sys_sync(d378ab40,0,0,c020c7bc,100) at sys_sync+0x5a
 vfs_shutdown(d37ab8e8,1,fff0,c031dd12,c020c71c) at vfs_shutdown+0x90
 cpu_reboot(100,0,d37ab92c,c02812e2,0) at cpu_reboot+0x3b
 panic(c033261e,c03325c0,d37ab934,2,6) at panic+0x123
 trap() at trap+0x206
 --- trap (number 6) ---
 vndstrategy(c0f8b310,c0f8b000,0,6,c0f95000) at vndstrategy+0x3c8
 spec_strategy(d37aba64,0,2,c0100bb2,0) at spec_strategy+0x4a
 cgdstart(c08de400,c0bba208,0,c0366ce4,c0bba208) at cgdstart+0x19a
 dk_strategy(c0367424,c08de400,c0bba208,c01e7501,1500) at
dk_strategy+0xba cgdstrategy(c0bba208,d37abb28,d39df760,1,c0bba208) at
cgdstrategy+0x25
spec_strategy(d37abbe8,c4960000,d37abb6c,c026c320,c0bba208) at
spec_strategy+0x4a ufs_strategy(d37abbe8,2,1,d37abbfc,d3c1dea0) at
ufs_strategy+0xfb genfs_gop_write(d3c1dea0,d37abc34,2,11,c07141a0) at
genfs_gop_write+0x39c
genfs_putpages(d37abde0,0,c089c800,c0cc2814,d3c1dea0) at
genfs_putpages+0x8f7
ffs_putpages(d37abde0,c0290a39,c089acd0,c089b000,d3c1dea0) at
ffs_putpages+0x11d ffs_full_fsync(d37abed8,0,d37abe2c,c0232f48,d3c1dea0)
at ffs_full_fsync+0xb5 ffs_fsync(d37abed8,10012,8,3246,0) at
ffs_fsync+0x3c ffs_sync(c09f9a00,3,c0828f00,d378ab40,d3ddd924) at
ffs_sync+0x10a sync_fsync(d37abf68,12,0,3206,d378ab40) at
sync_fsync+0x5c sched_sync(d378ab40,d379e4e0,0,0,c010030c) at NetBSD
1.6K (UNICRON) #0: Thu Dec 26 03:55:28 CET 2002    
root@cyclonus:/usr/src/sys/arch/i386/compile/UNICRON total memory = 255
MB avail memory = 233 MB
 using 3297 buffers containing 13188 KB of memory
 BIOS32 rev. 0 found at 0xfdae0
 mainbus0 (root)
 cpu0 at mainbus0: (uniprocessor)
 cpu0: AMD Duron (686-class), 896.24 MHz, id 0x631
 cpu0: features c1c7f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR>
 cpu0: features c1c7f9ff<PGE,MCA,CMOV,PAT,PSE36,PN,MMXX,MMX>
 cpu0: features c1c7f9ff<FXSR,3DNOW2,3DNOW>
 cpu0: I-cache 64 KB 64b/line 2-way, D-cache 64 KB 64b/line 2-way
 cpu0: L2 cache 64 KB 64b/line 16-way
 cpu0: ITLB 16 4 KB entries fully associative, 8 4 MB entries fully
associative cpu0: DTLB 24 4 KB entries fully associative, 8 4 MB entries
4-way cpu0: 8 page colors
 pci0 at mainbus0 bus 0: configuration mode 1
 pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
 pchb0 at pci0 dev 0 function 0
 pchb0: Silicon Integrated System SiS 735 Host Bridge (rev. 0x01)
 agp0 at pchb0: aperture at 0xd0000000, size 0x400000
 ppb0 at pci0 dev 1 function 0: Silicon Integrated System 86C201 (rev.
0x00) pci1 at ppb0 bus 1
 pci1: memory space enabled
 pcib0 at pci0 dev 2 function 0
 pcib0: Silicon Integrated System 85C503 or 5597/5598 ISA bridge (rev.
0x00) pciide0 at pci0 dev 2 function 5: Silicon Integrated System
5597/5598 IDE controller (rev. 0xd0) pciide0: bus-master DMA support
present pciide0: primary channel wired to compatibility mode
 wd0 at pciide0 channel 0 drive 0: <QUANTUM FIREBALLlct10 10>
 wd0: drive supports 16-sector PIO transfers, LBA addressing
 wd0: 9787 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 20044080
sectors wd0: 32-bit data port
 wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4 (Ultra/66)
 wd1 at pciide0 channel 0 drive 1: <ST51270A>
 wd1: drive supports 32-sector PIO transfers, LBA addressing
 wd1: 1223 MB, 2485 cyl, 16 head, 63 sec, 512 bytes/sect x 2504880
sectors wd1: 32-bit data port
 wd1: drive supports PIO mode 4, DMA mode 2
 pciide0: primary channel interrupting at irq 14
 wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 4 (Ultra/66) (using
DMA data transfers) wd1(pciide0:0:1): using PIO mode 4, DMA mode 2
(using DMA data transfers) pciide0: secondary channel wired to
compatibility mode atapibus0 at pciide0 channel 1: 2 targets
 cd0 at atapibus0 drive 0: <LG CD-RW CED-8080B, 2000/08/17, 1.08> cdrom
removable cd0: 32-bit data port
 cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
 pciide0: secondary channel interrupting at irq 15
 cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using
DMA data transfers) sip0 at pci0 dev 3 function 0: SiS 900 10/100
Ethernet, rev 0x90 sip0: interrupting at irq 10
 sip0: Ethernet address 00:07:95:a9:a5:7f
 ukphy0 at sip0 phy 1: Generic IEEE 802.3u media interface
 ukphy0: OUI 0x000004, model 0x0020, rev. 1
 ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 vga0 at pci0 dev 9 function 0: S3 ViRGE/DX (rev. 0x01)
 wsdisplay0 at vga0 kbdmux 1: console (80x25, vt100 emulation)
 wsmux1: connecting to wsdisplay0
 rtk0 at pci0 dev 13 function 0: RealTek 8139 10/100BaseTX
 rtk0: interrupting at irq 11
 rtk0: Ethernet address 00:30:84:29:09:2a
 ukphy1 at rtk0 phy 7: Generic IEEE 802.3u media interface
 ukphy1: OUI 0x000000, model 0x0000, rev. 0
 ukphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 cmpci0 at pci0 dev 15 function 0: C-Media Electronics Inc CMI8738/C3DX
PCI Audio Device (rev. 0x10) cmpci0: interrupting at irq 5
 audio0 at cmpci0: full duplex, mmap, independent
 opl at cmpci0 not configured
 mpu at cmpci0 not configured
 isa0 at pcib0
 com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
 com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
 pckbc0 at isa0 port 0x60-0x64
 pckbd0 at pckbc0 (kbd slot)
 pckbc0: using irq 1 for kbd slot
 wskbd0 at pckbd0: console keyboard, using wsdisplay0
 pms0 at pckbc0 (aux slot)
 pckbc0: using irq 12 for aux slot
 wsmouse0 at pms0 mux 0
 lpt0 at isa0 port 0x378-0x37b irq 7
 npx0 at isa0 port 0xf0-0xff: using exception 16
 fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
 fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
 apm0 at mainbus0: Power Management spec V1.2
 IPsec: Initialized Security Association Processing.
 boot device: wd0
 root on wd0a dumps on wd0b
 root file system type: ffs

I tried it again and got this - in this case, I have to admit that I did
a fsck /dev/cgd0a after I had mounted it:

mode = 0100600, inum = 11649, fs = /usr/homes/chris
panic: ffs_valloc: dup alloc
Begin traceback...
ffs_valloc(d37cac74,10002,1,0,d37cadf8) at ffs_valloc+0x16d
ufs_makeinode(8180,d3ac4e04,d37caef0,d37caf04,d37cadf8) at
ufs_makeinode+0x93 ufs_create(d37cadf8,d37caee0,d37caf80,c0228459,602)
at ufs_create+0x2c vn_open(d37caee0,602,180,c01f356a,d37caf80) at
vn_open+0xf1 sys_open(d3a2c008,d37caf80,d37caf78,d3a2c008,0) at
sys_open+0xd4 syscall_plain(1f,1f,1f,1f,485e5d10) at syscall_plain+0xa7
End traceback...
syncing disks... panic: lockmgr: locking against myself
Begin traceback...
lockmgr(d3ac4e70,10012,d3ac4e04,c089b000,1) at lockmgr+0x5e1
genfs_lock(d37caa74,0,0,0,d3ac4e04) at genfs_lock+0x1c
vn_lock(d3ac4e04,10012,d37c0010,c0200010,d3ac4e04) at vn_lock+0x75
vget(d3ac4e04,10012,8,202,0) at vget+0xcd
ffs_sync(c0984a00,2,c09bbe80,d3a2c008,100) at ffs_sync+0xa3
sys_sync(d3a2c008,0,0,c020c7bc,100) at sys_sync+0x5a
vfs_shutdown(d37cabdc,1,fffa,c031dd12,c020c71c) at vfs_shutdown+0x90
cpu_reboot(100,0,0,0,d3b78774) at cpu_reboot+0x3b
panic(c0311100,1,d37cac30,c01c2e88,c03110e0) at panic+0x123
ffs_valloc(d37cac74,10002,1,0,d37cadf8) at ffs_valloc+0x16d
ufs_makeinode(8180,d3ac4e04,d37caef0,d37caf04,d37cadf8) at
ufs_makeinode+0x93 ufs_create(d37cadf8,d37caee0,d37caf80,c0228459,602)
at ufs_create+0x2c vn_open(d37caee0,602,180,c01f356a,d37caf80) at
vn_open+0xf1 sys_open(d3a2c008,d37caf80,d37caf78,d3a2c008,0) at
sys_open+0xd4 syscall_plain(1f,1f,1f,1f,485e5d10) at syscall_plain+0xa7

>How-To-Repeat:

dd if=/dev/zero of=image bs=32k count=10k
vnconfig -c vnd0 image
disklabel -iI vnd0
cgdconfig cgd0 /dev/vnd0d  /etc/cgd/image
disklabel -iI cgd0
newfs -m 0 cgd0a
mount /dev/cgd0a /mnt

*using mounted device*

However, I don't think using vnd0d is a good idea but when I tried
to use vnd0a, I could not put a disklabel on cgd0. disklabel claimed
"read-only filesystem"  and I got this message on the console:
cgd0: error 30

>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: